Merge pull request #1001 from phaer/pyproject-true

treewide: format = "pyproject" -> pyproject = true
This commit is contained in:
Paul Haerle 2024-06-27 13:03:08 +02:00 committed by GitHub
commit 5206af5fd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 21 additions and 25 deletions

View File

@ -6,7 +6,7 @@
}: let
pyproject = lib.importTOML ./subpkg1/pyproject.toml;
buildWithSetuptools = {
buildPythonPackage.format = "pyproject";
buildPythonPackage.pyproject = true;
mkDerivation.buildInputs = [config.deps.python.pkgs.setuptools];
};
in {

View File

@ -9,10 +9,6 @@
dream2nix.modules.dream2nix.WIP-python-pdm
];
deps = {nixpkgs, ...}: {
python = nixpkgs.python3;
};
mkDerivation = {
src = lib.cleanSourceWith {
src = lib.cleanSource ./.;
@ -28,7 +24,6 @@
pdm.pyproject = ./pyproject.toml;
buildPythonPackage = {
format = lib.mkForce "pyproject";
pythonImportsCheck = [
"mytool"
];

View File

@ -30,7 +30,7 @@ in {
};
buildPythonPackage = {
format = lib.mkForce "pyproject";
pyproject = true;
pythonImportsCheck = [
"mytool"
];
@ -50,6 +50,9 @@ in {
++ pyproject.project.dependencies;
flattenDependencies = true;
overrides.click.mkDerivation.nativeBuildInputs = [config.deps.python.pkgs.flit-core];
overrides.click = {
buildPythonPackage.pyproject = true;
mkDerivation.nativeBuildInputs = [config.deps.python.pkgs.flit-core];
};
};
}

View File

@ -54,7 +54,7 @@ in {
# We include fixes from nixpkgs for pendulum, but keep
# our dependencies to avoid version conflicts
pendulum = {
env.pyproject = null;
buildPythonPackage.pyproject = true;
mkDerivation.propagatedBuildInputs = [
python.pkgs.poetry-core
];

View File

@ -84,7 +84,6 @@ in {
writeText
unzip
;
python = lib.mkDefault config.deps.python3;
};
overrideType = {
imports = [commonModule];
@ -105,7 +104,7 @@ in {
};
};
buildPythonPackage = {
format = lib.mkDefault "pyproject";
pyproject = lib.mkDefault true;
};
mkDerivation = {
buildInputs = map (name: config.deps.python.pkgs.${name}) buildSystemNames;
@ -187,13 +186,11 @@ in {
inherit name;
version = lib.mkDefault pkg.version;
sourceSelector = lib.mkOptionDefault config.pdm.sourceSelector;
buildPythonPackage = {
format = lib.mkDefault (
if lib.hasSuffix ".whl" source.file
then "wheel"
else "pyproject"
);
};
buildPythonPackage.format = lib.mkDefault (
if lib.hasSuffix ".whl" source.file
then "wheel"
else null
);
mkDerivation = {
# TODO: handle sources outside pypi.org
src = lib.mkDefault (libpyproject-fetchers.fetchFromLegacy {

View File

@ -19,7 +19,7 @@ in {
};
buildPythonPackage = {
format = "pyproject";
pyproject = true;
};
name = pyproject.project.name;

View File

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

View File

@ -25,7 +25,7 @@ in {
};
buildPythonPackage = {
format = lib.mkForce "pyproject";
pyproject = true;
pythonImportsCheck = [
"my_tool"
];

View File

@ -25,7 +25,7 @@ in {
};
buildPythonPackage = {
format = lib.mkForce "pyproject";
pyproject = true;
pythonImportsCheck = [
"my_tool"
];

View File

@ -7,7 +7,7 @@
}: let
package = python3.pkgs.buildPythonPackage {
name = "fetch-pip-metadata";
format = "pyproject";
pyproject = true;
src = ./src;
nativeBuildInputs = [
gitMinimal