poetry: add naive impl of build-system.requires

This commit is contained in:
phaer 2022-11-29 13:37:38 +01:00
parent f11fa0fced
commit eb88125101
3 changed files with 16 additions and 6 deletions

View File

@ -11,7 +11,11 @@
"type": "object"
},
"application": { "type": "boolean" },
"pythonAttr": { "type": "string" }
"pythonAttr": { "type": "string" },
"buildRequirements": {
"type": "array",
"items": { "type": "string" }
}
}
}
}

View File

@ -46,7 +46,6 @@
[pkgs.autoPatchelfHook]
++ (with python.pkgs; [
pip
poetry-core
wheel
]);
propagatedBuildInputs = [python.pkgs.setuptools];
@ -61,15 +60,21 @@
fname=$(stripHash $fname)
cp $file dist/$fname
done
${python}/bin/python -m pip install \
--find-links ./dist/ \
mkdir -p "$out/${python.sitePackages}"
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
pipInstallFlags="--find-links ./dist/ \
--no-build-isolation \
--no-index \
--no-warn-script-location \
--prefix="$out" \
--no-cache \
. \
$pipInstallFlags
--ignore-installed \
$pipInstallFlags"
${python}/bin/python -m pip install $pipInstallFlags ${lib.concatStringsSep " " subsystemAttrs.buildRequirements}
${python}/bin/python -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist .
${python}/bin/python -m pip install $pipInstallFlags .\
'';
installPhase = "true";
});

View File

@ -115,6 +115,7 @@ in {
application = false;
pythonAttr = "python3";
sourceFormats = {};
buildRequirements = pyproject.build-system.requires or [];
};
cyclicDependencies = {};