Slightly improve evaluation performance

This commit is contained in:
adisbladis 2020-02-24 12:36:36 +00:00
parent 35d38a1b11
commit 5d902c8bab
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7

View file

@ -52,12 +52,13 @@ let
# Filter packages by their PEP508 markers & pyproject interpreter version
partitions = let
compat = isCompatible python.pythonVersion;
supportsPythonVersion = pkgMeta: let
pep508Result = if pkgMeta ? marker then (evalPep508 pkgMeta.marker) else true;
flatDeps = (pyProject.tool.poetry.dependencies or {}) // (pyProject.tool.poetry.dev-dependencies or {});
constraints = flatDeps.${pkgMeta.name}.python or "";
pyprojectResult = isCompatible python.pythonVersion constraints;
pyprojectResult = compat constraints;
in
pyprojectResult && pep508Result;
in