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; inherit name;
version = lib.mkDefault pkg.version; version = lib.mkDefault pkg.version;
sourceSelector = lib.mkOptionDefault config.pdm.sourceSelector; sourceSelector = lib.mkOptionDefault config.pdm.sourceSelector;
buildPythonPackage = buildPythonPackage.format = lib.mkDefault (
if lib.hasSuffix ".whl" source.file if lib.hasSuffix ".whl" source.file
then { then "wheel"
format = lib.mkDefault "wheel"; else null
} );
else {
pyproject = lib.mkDefault true;
};
mkDerivation = { mkDerivation = {
# TODO: handle sources outside pypi.org # TODO: handle sources outside pypi.org
src = lib.mkDefault (libpyproject-fetchers.fetchFromLegacy { src = lib.mkDefault (libpyproject-fetchers.fetchFromLegacy {

View File

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