Skip to content

Commit

Permalink
renderers: Add PEP-508 environment argument
Browse files Browse the repository at this point in the history
2nix tools needs to be able to pass an already constructed environment for both efficiency & flexibility.
  • Loading branch information
adisbladis committed Aug 18, 2024
1 parent cfc19df commit 9115354
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/renderers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ in
extras ? [ ]
, # Extra withPackages function
extraPackages ? _ps: [ ]
, # PEP-508 environment
environ ? pep508.mkEnviron python
}:
let
filteredDeps = pep621.filterDependencies {
inherit (project) dependencies;
environ = pep508.mkEnviron python;
inherit extras;
inherit environ extras;
};
namedDeps = pep621.getDependenciesNames filteredDeps;
flatDeps = namedDeps.dependencies ++ flatten (attrValues namedDeps.extras) ++ namedDeps.build-systems;
Expand Down Expand Up @@ -86,12 +87,13 @@ in
, # Which package format to pass to buildPythonPackage
# If the format is "wheel" PEP-518 build-systems are excluded from the build.
format ? "pyproject"
, # PEP-508 environment
environ ? pep508.mkEnviron python
}:
let
filteredDeps = pep621.filterDependencies {
inherit (project) dependencies;
environ = pep508.mkEnviron python;
inherit extras;
inherit environ extras;
};

pythonVersion = pep440.parseVersion python.version;
Expand Down

0 comments on commit 9115354

Please sign in to comment.