diff --git a/default.nix b/default.nix index 0e19898..0310051 100644 --- a/default.nix +++ b/default.nix @@ -14,11 +14,6 @@ let python_machnix = import ./mach_nix/nix/python.nix { inherit pkgs; }; - python_deps = (builtins.attrValues (import ./mach_nix/nix/python-deps.nix { - python = python_machnix; - fetchurl = pkgs.fetchurl; - })); - pypiFetcher = (import ./mach_nix/nix/deps-db-and-fetcher.nix { inherit pkgs; pypi_deps_db_commit = pypiDataRev; @@ -58,11 +53,16 @@ rec { version = builtins.readFile ./mach_nix/VERSION; name = "${pname}-${version}"; src = ./.; - propagatedBuildInputs = python_deps; + propagatedBuildInputs = pythonDeps; checkInputs = [ python_machnix.pkgs.pytest ]; checkPhase = "pytest"; }; + pythonDeps = (builtins.attrValues (import ./mach_nix/nix/python-deps.nix { + python = python_machnix; + fetchurl = pkgs.fetchurl; + })); + # the main functions mkPython = args: __mkPython "mkPython" args; mkPythonShell = args: (__mkPython "mkPythonShell" args).env; diff --git a/flake.nix b/flake.nix index 7f8e299..4f1a4c8 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,14 @@ shellWith dockerImageWith; "with" = pythonWith; + sdist = pkgs.runCommand "mach-nix-sdist" + { buildInputs = mach-nix-default.pythonDeps; } + '' + mkdir src + cp -r ${./.}/* src + cd src + python setup.py sdist -d $out + ''; }; defaultPackage = packages.mach-nix; diff --git a/mach_nix/generators/overides_generator.py b/mach_nix/generators/overides_generator.py index 876859b..1a47f8a 100644 --- a/mach_nix/generators/overides_generator.py +++ b/mach_nix/generators/overides_generator.py @@ -167,7 +167,6 @@ def _gen_prop_build_inputs(self, prop_build_inputs_local, prop_build_inputs_nixp def _gen_overrideAttrs( self, name, ver, circular_deps, nix_name, provider, build_inputs_str, prop_build_inputs_str, keep_src=False): - # TODO: apply the buildInput replacement to all kinds of buildInputs out = f""" "{name}" = override python-super.{nix_name} ( oldAttrs: (mapAttrs (n: v: if elem n depNamesOther then map (dep: updatePythonDepsRec python-self dep) v else v ) oldAttrs) // {{ diff --git a/mach_nix/nix/python-deps.nix b/mach_nix/nix/python-deps.nix index c99603e..4eae12f 100644 --- a/mach_nix/nix/python-deps.nix +++ b/mach_nix/nix/python-deps.nix @@ -29,4 +29,5 @@ rec { packaging = python.pkgs.packaging; setuptools = python.pkgs.setuptools; toml = python.pkgs.toml; + wheel = python.pkgs.wheel; }