Hi,
I am trying to write a simple flake to package the lorem python package.
Here is my flake, with a simple shell to test it:
{
description = "python-lorem python package";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
};
outputs = { self, nixpkgs }: {
packages.x86_64-linux.lorem = let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
pkgs.python3Packages.buildPythonPackage rec {
pname = "python-lorem";
version = "1.3.0.post3";
src = pkgs.fetchFromGitHub {
owner = "JarryShaw";
repo = "lorem";
rev = "v${version}";
hash = "sha256-H43DujOJxUefYEHC5QuTtNksph67TGV76OIa/2xkq08=";
};
build-system = [
pkgs.python3Packages.setuptools
pkgs.python3Packages.wheel
];
};
devShells.x86_64-linux.default = let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
pkgs.mkShell {
packages = [
(pkgs.python3.withPackages (ps: with ps; [
self.packages.x86_64-linux.lorem
]))
];
};
packages.x86_64-linux.default = self.packages.x86_64-linux.lorem;
};
}
With github:nixos/nixpkgs?ref=nixos-24.05
as input, the build fails with ModuleNotFoundError: No module named 'setuptools.command.bdist_wheel'
, while it succeeds with input github:nixos/nixpkgs?ref=nixos-unstable
.
Could someone explain why ? I’d be happy to have a solution to use this package with my python3 interpreter on Nixos-24.05.
NB: when making a shell with setuptools
, the setuptools.caommand.bdist_wheel
module is indeed available with nixpkgs-unstable and not with nixpkgs-24.05. There seem to be ongoing work on setuptools
packaging in nixpkgs (see eg: python3Packages.setuptools, thrift: Fix setuptools to give thrift python 3.12 support by kfollesdal · Pull Request #328415 · NixOS/nixpkgs · GitHub) but I do not understand the technical points discussed in this post.