fix default for format/pyproject in pip and pdm

This commit is contained in:
phaer 2024-06-27 12:41:00 +02:00
parent 1dda463e0b
commit 9c38c4fe41
2 changed files with 9 additions and 14 deletions

View File

@ -186,14 +186,11 @@ in {
inherit name;
version = lib.mkDefault pkg.version;
sourceSelector = lib.mkOptionDefault config.pdm.sourceSelector;
buildPythonPackage =
buildPythonPackage.format = lib.mkDefault (
if lib.hasSuffix ".whl" source.file
then {
format = lib.mkDefault "wheel";
}
else {
pyproject = lib.mkDefault true;
};
then "wheel"
else null
);
mkDerivation = {
# TODO: handle sources outside pypi.org
src = lib.mkDefault (libpyproject-fetchers.fetchFromLegacy {

View File

@ -56,14 +56,12 @@
# deps.python cannot be defined in commonModule as this would trigger an
# infinite recursion.
deps = {inherit python;};
buildPythonPackage =
buildPythonPackage.format = lib.mkDefault (
if lib.hasSuffix ".whl" cfg.mkDerivation.src
then {
format = lib.mkDefault "wheel";
}
else {
pyproject = lib.mkDefault true;
};
then "wheel"
else null
);
mkDerivation.buildInputs =
lib.optionals
(! lib.hasSuffix ".whl" cfg.mkDerivation.src)