mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-23 06:21:30 +03:00
Merge pull request #1001 from phaer/pyproject-true
treewide: format = "pyproject" -> pyproject = true
This commit is contained in:
commit
5206af5fd5
@ -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"
|
||||
];
|
||||
@ -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];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -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
|
||||
];
|
||||
|
@ -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 {
|
||||
|
@ -19,7 +19,7 @@ in {
|
||||
};
|
||||
|
||||
buildPythonPackage = {
|
||||
format = "pyproject";
|
||||
pyproject = true;
|
||||
};
|
||||
|
||||
name = pyproject.project.name;
|
||||
|
@ -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)
|
||||
|
@ -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