From 9115354fff4514bedb8e07e5ebaa9d09ea367483 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sun, 18 Aug 2024 22:37:25 +1200 Subject: [PATCH] renderers: Add PEP-508 environment argument 2nix tools needs to be able to pass an already constructed environment for both efficiency & flexibility. --- lib/renderers.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/renderers.nix b/lib/renderers.nix index 1199cea..98a9f78 100644 --- a/lib/renderers.nix +++ b/lib/renderers.nix @@ -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; @@ -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;