Merge pull request #749 from K900/science

treewide: more vaguely related fixes
This commit is contained in:
adisbladis 2022-10-09 12:46:14 +13:00 committed by GitHub
commit 061b8a6fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 2262 additions and 32 deletions

View file

@ -182,36 +182,31 @@ lib.makeScope pkgs.newScope (self: {
builtins.map
(
pkgMeta:
if builtins.elem pkgMeta.name nixpkgsBuildSystems then {
name = pkgMeta.name;
value = super."${pkgMeta.name}";
} else rec {
name = normalizePackageName pkgMeta.name;
let normalizedName = normalizePackageName pkgMeta.name; in
{
name = normalizedName;
value = self.mkPoetryDep (
pkgMeta // {
inherit pwd preferWheels;
source = pkgMeta.source or null;
files = lockFiles.${name};
files = lockFiles.${normalizedName};
pythonPackages = self;
sourceSpec =
let
normalizedName = normalizePackageName pkgMeta.name;
in
(
(normalizePackageSet pyProject.tool.poetry.dependencies or { }).${normalizedName}
or (normalizePackageSet pyProject.tool.poetry.dev-dependencies or { }).${normalizedName}
or (normalizePackageSet pyProject.tool.poetry.group.dev.dependencies { }).${normalizedName} # Poetry 1.2.0+
or { }
);
sourceSpec = (
(normalizePackageSet pyProject.tool.poetry.dependencies or { }).${normalizedName}
or (normalizePackageSet pyProject.tool.poetry.dev-dependencies or { }).${normalizedName}
or (normalizePackageSet pyProject.tool.poetry.group.dev.dependencies { }).${normalizedName} # Poetry 1.2.0+
or { }
);
}
);
}
)
(lib.reverseList compatible)
);
buildSystems = builtins.listToAttrs (builtins.map (x: { name = x; value = super.${x}; }) nixpkgsBuildSystems);
in
lockPkgs // {
lockPkgs // buildSystems // {
# Create a dummy null package for the current project in case any dependencies depend on the root project (issue #307)
${pyProject.tool.poetry.name} = null;
};

View file

@ -7,6 +7,7 @@
"flitBuildHook",
"cython",
"hatchling",
"hatch-vcs",
"setuptools",
"setuptools-scm"
]

View file

@ -790,6 +790,7 @@
"setuptools"
],
"apipkg": [
"hatch-vcs",
"hatchling",
"setuptools"
],
@ -1918,8 +1919,12 @@
],
"black": [
{
"buildSystem": "hatch-fancy-pypi-readme",
"from": "22.10.0"
"buildSystem": "setuptools",
"until": "22.10.0"
},
{
"buildSystem": "setuptools-scm",
"until": "22.10.0"
},
{
"buildSystem": "hatchling",
@ -1929,8 +1934,10 @@
"buildSystem": "hatch-vcs",
"from": "22.10.0"
},
"setuptools",
"setuptools-scm"
{
"buildSystem": "hatch-fancy-pypi-readme",
"from": "22.10.0"
}
],
"black-macchiato": [
"setuptools"
@ -3367,7 +3374,8 @@
"setuptools"
],
"dbus-fast": [
"poetry-core"
"poetry-core",
"setuptools"
],
"dbus-next": [
"setuptools"
@ -7206,7 +7214,10 @@
"buildSystem": "hatchling",
"from": "4.11.0"
},
"setuptools"
{
"buildSystem": "setuptools",
"until": "4.11.0"
}
],
"jupyter-lsp": [
"setuptools"
@ -8681,6 +8692,9 @@
"poetry-core",
"setuptools"
],
"mypy-boto3-cognito": [
"setuptools"
],
"mypy-boto3-cognito-idp": [
"setuptools"
],
@ -8794,15 +8808,37 @@
"setuptools"
],
"nbconvert": [
"setuptools"
{
"buildSystem": "setuptools",
"until": "7.0.0"
},
{
"buildSystem": "hatchling",
"from": "7.0.0"
}
],
"nbdime": [
"setuptools",
"setuptools-scm"
],
"nbformat": [
"flit-core",
"setuptools"
{
"buildSystem": "setuptools",
"until": "5.4.0"
},
{
"buildSystem": "flit-core",
"from": "5.4.0",
"until": "5.6.0"
},
{
"buildSystem": "hatchling",
"from": "5.6.0"
},
{
"buildSystem": "hatch-nodejs-version",
"from": "5.6.0"
}
],
"nbmerge": [
"setuptools"
@ -10104,6 +10140,7 @@
"setuptools"
],
"pipdeptree": [
"hatch-vcs",
"hatchling",
"setuptools"
],
@ -10383,6 +10420,9 @@
"prayer-times-calculator": [
"setuptools"
],
"pre-commit": [
"setuptools"
],
"pre-commit-hooks": [
"setuptools"
],
@ -11409,6 +11449,7 @@
"setuptools"
],
"pyhamcrest": [
"hatch-vcs",
"hatchling",
"setuptools"
],
@ -14697,8 +14738,14 @@
"setuptools"
],
"seaborn": [
"flit-core",
"setuptools"
{
"buildSystem": "setuptools",
"until": "0.12.0"
},
{
"buildSystem": "flit-core",
"from": "0.12.0"
}
],
"seabreeze": [
"cython",
@ -17069,6 +17116,7 @@
"setuptools-scm"
],
"vector": [
"hatch-vcs",
"hatchling"
],
"vega": [

View file

@ -194,7 +194,6 @@ lib.composeManyExtensions [
}.${version} or (
lib.warn "Unknown bcrypt version: '${version}'. Please update getCargoHash." lib.fakeHash
);
sha256 = getCargoHash super.bcrypt.version;
in
super.bcrypt.overridePythonAttrs (
old: {
@ -206,7 +205,7 @@ lib.composeManyExtensions [
(old.nativeBuildInputs or [ ])
++ lib.optionals (lib.versionAtLeast old.version "4")
(with pkgs.rustPlatform; [ rust.rustc rust.cargo cargoSetupHook self.setuptools-rust ]);
} // lib.optionalAttrs (lib.versionAtLeast old.version "4") rec {
} // lib.optionalAttrs (lib.versionAtLeast old.version "4") {
cargoDeps =
pkgs.rustPlatform.fetchCargoTarball
{
@ -269,6 +268,10 @@ lib.composeManyExtensions [
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
});
cerberus = super.cerberus.overridePythonAttrs (old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
});
cssselect2 = super.cssselect2.overridePythonAttrs (
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ];
@ -806,6 +809,12 @@ lib.composeManyExtensions [
}
);
ipython = super.ipython.overridePythonAttrs (
old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
}
);
isort = super.isort.overridePythonAttrs (
old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
@ -884,7 +893,7 @@ lib.composeManyExtensions [
);
jupyter-packaging = super.jupyter-packaging.overridePythonAttrs (old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.wheel ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools self.wheel ];
});
jupyterlab-widgets = super.jupyterlab-widgets.overridePythonAttrs (
@ -1059,6 +1068,9 @@ lib.composeManyExtensions [
self.setuptools-scm-git-archive
];
# Clang doesn't understand -fno-strict-overflow, and matplotlib builds with -Werror
hardeningDisable = if stdenv.isDarwin then [ "strictoverflow" ] else [ ];
passthru = old.passthru or { } // passthru;
MPLSETUPCFG = pkgs.writeText "mplsetup.cfg" (lib.generators.toINI { } passthru.config);
@ -1251,6 +1263,8 @@ lib.composeManyExtensions [
};
in
{
# fails to build with format=pyproject and setuptools >= 65
format = if (old.format == "poetry2nix") then "setuptools" else old.format;
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.gfortran ];
buildInputs = (old.buildInputs or [ ]) ++ [ blas ];
enableParallelBuilding = true;

View file

@ -19,7 +19,7 @@ let
inherit (drv) src version meta;
buildInputs = drv.buildInputs ++ drv.propagatedBuildInputs ++ buildInputs;
nativeBuildInputs = drv.nativeBuildInputs ++ nativeBuildInputs;
nativeBuildInputs = builtins.filter (x: x.name != "python-output-dist-hook") (drv.nativeBuildInputs ++ nativeBuildInputs);
dontConfigure = true;
dontBuild = true;

View file

@ -123,5 +123,7 @@ builtins.removeAttrs
manylinux = callTest ./manylinux { };
shapely = callTest ./shapely { };
setuptools = callTest ./setuptools { };
scientific = callTest ./scientific { };
}
skipTests

View file

@ -7,6 +7,12 @@ let
editablePackageSources = {
dep1 = null;
};
overrides = poetry2nix.overrides.withDefaults (self: super: {
dep1 = super.dep1.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools ];
});
});
};
in

View file

@ -0,0 +1,8 @@
{ lib, poetry2nix, python3 }:
poetry2nix.mkPoetryApplication {
python = python3;
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
src = lib.cleanSource ./.;
}

2134
tests/scientific/poetry.lock generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,22 @@
[tool.poetry]
name = "scientific_test"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
[tool.poetry.dependencies]
python = "^3.10"
numpy = "*"
scipy = "*"
scikit-learn = "*"
matplotlib = "*"
seaborn = "*"
pandas = "*"
jupyter = "*"
# FIXME: pin a lower version until we figure out how to build newer ones
nbconvert = "<7"
[build-system]
requires = ["poetry-core>=1.1"]
build-backend = "poetry.core.masonry.api"