add setuptools to build fasthtml from source

This commit is contained in:
Kristian Krsnik 2024-08-05 00:09:41 +02:00
parent fad0f6e5dd
commit 9f2e496f4f
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85

View File

@ -18,6 +18,15 @@
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems; forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (system: inputs.nixpkgs.legacyPackages.${system}); pkgs = forAllSystems (system: inputs.nixpkgs.legacyPackages.${system});
poetry2nix = forAllSystems (system: inputs.poetry2nix-lib.lib.mkPoetry2Nix {pkgs = pkgs.${system};}); poetry2nix = forAllSystems (system: inputs.poetry2nix-lib.lib.mkPoetry2Nix {pkgs = pkgs.${system};});
addSetuptools = self: super: list:
builtins.listToAttrs (builtins.map (package: {
name = "${package}";
value = super."${package}".overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or []) ++ [self.setuptools];
});
})
list);
in { in {
# `nix build` # `nix build`
packages = forAllSystems (system: let packages = forAllSystems (system: let
@ -29,8 +38,11 @@
then "pyright && pytest" then "pyright && pytest"
else ""; else "";
# doCheck = debug; # doCheck = debug;
preferWheels = true; preferWheels = false;
nativeBuildInputs = with pkgs.${system}; [pyright]; nativeBuildInputs = with pkgs.${system}; [pyright];
overrides =
poetry2nix.${system}.overrides.withDefaults (self: super:
addSetuptools self super ["sqlite-minutils" "fastlite" "python-fasthtml"]);
}; };
in { in {
default = mkPackage {debug = false;}; default = mkPackage {debug = false;};