mirror of
https://github.com/nix-community/dream2nix.git
synced 2025-01-09 00:08:02 +03:00
treewide: format = "pyproject" -> pyproject = true
It's important to get the default in our PDM module fixed, because upstream documentation recommends using pyproject = true; and ships an assertion assertion '((pyproject != null) -> (format == null))' that fails with the current default in pdm.
This commit is contained in:
parent
26097d341a
commit
97d181ccd8
@ -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 {
|
||||
|
@ -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"
|
||||
];
|
||||
|
@ -30,7 +30,7 @@ in {
|
||||
};
|
||||
|
||||
buildPythonPackage = {
|
||||
format = lib.mkForce "pyproject";
|
||||
pyproject = true;
|
||||
pythonImportsCheck = [
|
||||
"mytool"
|
||||
];
|
||||
|
@ -105,7 +105,7 @@ in {
|
||||
};
|
||||
};
|
||||
buildPythonPackage = {
|
||||
format = lib.mkDefault "pyproject";
|
||||
pyproject = lib.mkDefault true;
|
||||
};
|
||||
mkDerivation = {
|
||||
buildInputs = map (name: config.deps.python.pkgs.${name}) buildSystemNames;
|
||||
@ -187,13 +187,14 @@ 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 =
|
||||
if lib.hasSuffix ".whl" source.file
|
||||
then {
|
||||
format = lib.mkDefault "wheel";
|
||||
}
|
||||
else {
|
||||
pyproject = lib.mkDefault true;
|
||||
};
|
||||
mkDerivation = {
|
||||
# TODO: handle sources outside pypi.org
|
||||
src = lib.mkDefault (libpyproject-fetchers.fetchFromLegacy {
|
||||
|
@ -19,7 +19,7 @@ in {
|
||||
};
|
||||
|
||||
buildPythonPackage = {
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
};
|
||||
|
||||
name = pyproject.project.name;
|
||||
|
@ -56,11 +56,14 @@
|
||||
# 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
|
||||
then "wheel"
|
||||
else "pyproject"
|
||||
);
|
||||
buildPythonPackage =
|
||||
if lib.hasSuffix ".whl" cfg.mkDerivation.src
|
||||
then {
|
||||
format = lib.mkDefault "wheel";
|
||||
}
|
||||
else {
|
||||
pyproject = lib.mkDefault true;
|
||||
};
|
||||
mkDerivation.buildInputs =
|
||||
lib.optionals
|
||||
(! lib.hasSuffix ".whl" cfg.mkDerivation.src)
|
||||
|
@ -25,7 +25,7 @@ in {
|
||||
};
|
||||
|
||||
buildPythonPackage = {
|
||||
format = lib.mkForce "pyproject";
|
||||
pyproject = true;
|
||||
pythonImportsCheck = [
|
||||
"my_tool"
|
||||
];
|
||||
|
@ -25,7 +25,7 @@ in {
|
||||
};
|
||||
|
||||
buildPythonPackage = {
|
||||
format = lib.mkForce "pyproject";
|
||||
pyproject = true;
|
||||
pythonImportsCheck = [
|
||||
"my_tool"
|
||||
];
|
||||
|
@ -7,7 +7,7 @@
|
||||
}: let
|
||||
package = python3.pkgs.buildPythonPackage {
|
||||
name = "fetch-pip-metadata";
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
src = ./src;
|
||||
nativeBuildInputs = [
|
||||
gitMinimal
|
||||
|
Loading…
Reference in New Issue
Block a user