Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remaining Python bootstrapping fixes (part 1) #250905

Merged
merged 18 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
d318144
python3.pkgs.autarco: remove setuptools dependency
tjni Aug 23, 2023
223663e
python3.pkgs.celery-types: remove extraneous build dependencies
tjni Aug 23, 2023
97ce7c0
python3.pkgs.cemm: remove setuptools dependency
tjni Aug 23, 2023
51a34ae
python3.pkgs.cohere: replace poetry with poetry-core
tjni Aug 23, 2023
5c0c531
python3.pkgs.grpc-interceptor: replace poetry with poetry-core
tjni Aug 23, 2023
6258bfd
python3.pkgs.knx-frontend: relax build dependencies
tjni Aug 23, 2023
a967c0f
python3.pkgs.laszip: fix how cmake and ninja dependencies are consumed
tjni Aug 23, 2023
07fd57b
python3.pkgs.msprime: add missing build dependencies
tjni Aug 23, 2023
4e48147
python3.pkgs.multiset: relax setuptools-scm dependency
tjni Aug 23, 2023
3e17382
python3.pkgs.napalm-hp-procurve: add pip dependency and other improve…
tjni Aug 23, 2023
9ca3487
python3.pkgs.netcdf4: add missing build dependencies
tjni Aug 23, 2023
2b83a56
python3.pkgs.newversion: remove setuptools dependency
tjni Aug 23, 2023
a2bb835
python3.pkgs.nitime: add build dependencies and relax numpy constraint
tjni Aug 23, 2023
42926ea
python3.pkgs.pipdeptree: fix propagatedBuildInputs typo
tjni Aug 23, 2023
269bf50
python3.pkgs.polyline: relax build dependencies
tjni Aug 23, 2023
cc05774
python3.pkgs.py-dormakaba-dkey: relax setuptools dependency
tjni Aug 23, 2023
75e94e3
python3.pkgs.pydeck: add missing build dependencies
tjni Aug 23, 2023
7dee41d
python3.pkgs.pydicom-seg: replace poetry with poetry-core
tjni Aug 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions pkgs/development/python-modules/autarco/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, aresponses
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, poetry-core
, pytest-asyncio
, pytestCheckHook
Expand All @@ -24,6 +25,22 @@ buildPythonPackage rec {
hash = "sha256-3f6N4b6WZPAUUQTuGeb20q0f7ZqDR+O24QRze5RpRlw=";
};

patches = [
# https://github.com/klaasnicolaas/python-autarco/pull/265
(fetchpatch {
name = "remove-setuptools-dependency.patch";
url = "https://github.com/klaasnicolaas/python-autarco/commit/bf40e8a4f64cd9c9cf72930260895537ea5b2adc.patch";
hash = "sha256-Fgijy7sd67LUIqh3qjQjyothnjdW7Zcil/bQSuVsBR8=";
})
];

postPatch = ''
# Upstream doesn't set a version for the pyproject.toml
substituteInPlace pyproject.toml \
--replace "0.0.0" "${version}" \
--replace "--cov" ""
'';

nativeBuildInputs = [
poetry-core
];
Expand All @@ -33,19 +50,14 @@ buildPythonPackage rec {
yarl
];

__darwinAllowLocalNetworking = true;

nativeCheckInputs = [
aresponses
pytest-asyncio
pytestCheckHook
];

postPatch = ''
# Upstream doesn't set a version for the pyproject.toml
substituteInPlace pyproject.toml \
--replace "0.0.0" "${version}" \
--replace "--cov" ""
'';

pythonImportsCheck = [
"autarco"
];
Expand Down
14 changes: 10 additions & 4 deletions pkgs/development/python-modules/celery-types/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, poetry-core
, pythonOlder
Expand All @@ -18,10 +19,15 @@ buildPythonPackage rec {
hash = "sha256-1OLUJxsuxG/sCKDxKiU4i7o5HyaJdIW8rPo8UofMI28=";
};

patchPhase = ''
substituteInPlace pyproject.toml \
--replace "poetry.masonry.api" "poetry.core.masonry.api"
'';
patches = [
# remove extraneous build dependencies:
# https://github.com/sbdchd/celery-types/pull/138
(fetchpatch {
name = "clean-up-build-dependencies.patch";
url = "https://github.com/sbdchd/celery-types/commit/ff83f06a0302084e1a690e2a5a8b25f2c0dfc6e7.patch";
hash = "sha256-c68SMugg6Qk88FC842/czoxLpk0uVAVSlWsvo4NI9uo=";
})
];

propagatedBuildInputs = [
typing-extensions
Expand Down
12 changes: 12 additions & 0 deletions pkgs/development/python-modules/cemm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, aresponses
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, poetry-core
, pytest-asyncio
, pytestCheckHook
Expand All @@ -24,6 +25,15 @@ buildPythonPackage rec {
hash = "sha256-BorgGHxoEeIGyJKqe9mFRDpcGHhi6/8IV7ubEI8yQE4=";
};

patches = [
# https://github.com/klaasnicolaas/python-cemm/pull/360
(fetchpatch {
name = "remove-setuptools-dependency.patch";
url = "https://github.com/klaasnicolaas/python-cemm/commit/1e373dac078f18563264e6733baf6a93962cac4b.patch";
hash = "sha256-DVNn4BZwi8yNpKFmzt7YSYhzzB4vaAyrd/My8TtYzj0=";
})
];

postPatch = ''
substituteInPlace pyproject.toml \
--replace '"0.0.0"' '"${version}"' \
Expand All @@ -39,6 +49,8 @@ buildPythonPackage rec {
yarl
];

__darwinAllowLocalNetworking = true;

nativeCheckInputs = [
aresponses
pytest-asyncio
Expand Down
10 changes: 10 additions & 0 deletions pkgs/development/python-modules/cohere/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, poetry-core
, pythonOlder
Expand All @@ -21,6 +22,15 @@ buildPythonPackage rec {
hash = "sha256-i6kbjugulAcmmInFb+rH4WB50dM7SDO1HNW/JgD4OTQ=";
};

patches = [
# https://github.com/cohere-ai/cohere-python/pull/289
(fetchpatch {
name = "replace-poetry-with-poetry-core.patch";
url = "https://github.com/cohere-ai/cohere-python/commit/e86480336331c0cf6f67e26b0825467dfca5b277.patch";
hash = "sha256-P1Ioq5ypzT3tx6cxrI3ep34Fi4cUx88YkfJ5ErN3VHk=";
})
];

nativeBuildInputs = [
poetry-core
];
Expand Down
17 changes: 12 additions & 5 deletions pkgs/development/python-modules/grpc-interceptor/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, pythonOlder
, poetry-core
, grpcio
Expand All @@ -20,13 +21,17 @@ buildPythonPackage rec {
owner = "d5h-foss";
repo = pname;
rev = "refs/tags/v${version}";
sha256 = "sha256-zulK0SVehzHcrmgIyH0D5sUOiAN53eIg88IoVyF6/DA=";
hash = "sha256-zulK0SVehzHcrmgIyH0D5sUOiAN53eIg88IoVyF6/DA=";
};

postPatch = ''
substituteInPlace pyproject.toml \
--replace "poetry.masonry.api" "poetry.core.masonry.api"
'';
patches = [
# https://github.com/d5h-foss/grpc-interceptor/pull/44
(fetchpatch {
name = "replace-poetry-with-poetry-core.patch";
url = "https://github.com/d5h-foss/grpc-interceptor/commit/916cb394acd8dd7abb4f5edcb4e88aee961a32d0.patch";
hash = "sha256-W2SF2zyjusTxgvCxBDLpisD03bofzDug1eyd4FLJmKs=";
})
];

nativeBuildInputs = [
poetry-core
Expand All @@ -37,6 +42,8 @@ buildPythonPackage rec {
protobuf
];

__darwinAllowLocalNetworking = true;

nativeCheckInputs = [
pytest-asyncio
pytestCheckHook
Expand Down
12 changes: 12 additions & 0 deletions pkgs/development/python-modules/knx-frontend/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, setuptools
, wheel
}:

buildPythonPackage rec {
Expand All @@ -16,8 +18,18 @@ buildPythonPackage rec {
hash = "sha256-MeurZ6731qjeBK6HTwXYLVs6+nXF9Hf1p8/NNwxmae4=";
};

patches = [
# https://github.com/XKNX/knx-frontend/pull/96
(fetchpatch {
name = "relax-setuptools-dependency.patch";
url = "https://github.com/XKNX/knx-frontend/commit/72ac6dc42eeeb488992b0709ee58ea4a79287817.patch";
hash = "sha256-EpfgEq4pIx7ahqJZalzo30ruj8NlZYHcKHxFXCGL98w=";
})
];

nativeBuildInputs = [
setuptools
wheel
];

pythonImportsCheck = [
Expand Down
18 changes: 15 additions & 3 deletions pkgs/development/python-modules/laszip/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
, stdenv
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, scikit-build-core
, pybind11
, cmake
, LASzip
, ninja
, pythonOlder
}:

buildPythonPackage rec {
pname = "laszip-python";
version = "0.2.3";

format = "pyproject";

disabled = pythonOlder "3.7";
Expand All @@ -24,14 +25,25 @@ buildPythonPackage rec {
hash = "sha256-MiPzL9TDCf1xnCv7apwdfcpkFnBRi4PO/atTQxqL8cw=";
};

patches = [
# Removes depending on the cmake and ninja PyPI packages, since we can pass
# in the tools directly, and scikit-build-core can use them.
# https://github.com/tmontaigu/laszip-python/pull/9
(fetchpatch {
name = "remove-cmake-ninja-pypi-dependencies.patch";
url = "https://github.com/tmontaigu/laszip-python/commit/17e648d04945fa2d095d6d74d58c790a4fcde84a.patch";
hash = "sha256-k58sS1RqVzT1WPh2OVt/D4Y045ODtj6U3bUjegd44VY=";
})
];

env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=c++17";

nativeBuildInputs = [
cmake
ninja
pybind11
scikit-build-core
scikit-build-core.optional-dependencies.pyproject
];
] ++ scikit-build-core.optional-dependencies.pyproject;

dontUseCmakeConfigure = true;

Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/python-modules/msprime/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{ lib
, buildPythonPackage
, fetchPypi
, oldest-supported-numpy
, setuptools-scm
, wheel
, pythonOlder
, gsl
, numpy
Expand All @@ -25,8 +27,10 @@ buildPythonPackage rec {
};

nativeBuildInputs = [
setuptools-scm
gsl
oldest-supported-numpy
setuptools-scm
wheel
];

buildInputs = [
Expand Down
18 changes: 15 additions & 3 deletions pkgs/development/python-modules/multiset/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, setuptools
, setuptools-scm
, wheel
, pytestCheckHook
}:

Expand All @@ -16,16 +18,26 @@ buildPythonPackage rec {
hash = "sha256-5FZxyug4Wo5iSKmwejqDKAwtDMQxJxMFjPus3F7Jlz4=";
};

nativeBuildInputs = [
setuptools
setuptools-scm
patches = [
# https://github.com/wheerd/multiset/pull/115
(fetchpatch {
name = "relax-setuptools-scm-dependency.patch";
url = "https://github.com/wheerd/multiset/commit/296187b07691c94b783f65504afc580a355abd96.patch";
hash = "sha256-vnZR1cyM/2/JfbLuVOxJuC9oMVVVploUHpbzagmo+AE=";
})
];

postPatch = ''
# Drop broken version specifier
sed -i '/python_requires/d' setup.cfg
'';

nativeBuildInputs = [
setuptools
setuptools-scm
wheel
];

pythonImportsCheck = [
"multiset"
];
Expand Down
22 changes: 18 additions & 4 deletions pkgs/development/python-modules/napalm/hp-procurve.nix
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
{ lib, buildPythonPackage, fetchFromGitHub, setuptools, napalm, netmiko
, pytestCheckHook }:
{ lib
, buildPythonPackage
, fetchFromGitHub
, napalm
, netmiko
, pip
, pytestCheckHook
}:

buildPythonPackage rec {
pname = "napalm-hp-procurve";
version = "0.7.0";
format = "setuptools";

src = fetchFromGitHub {
owner = "napalm-automation-community";
repo = pname;
rev = version;
sha256 = "1lspciddkd1w5lfyz35i0qwgpbn5jq9cbqkwjbsvi4kliz229vkh";
hash = "sha256-cO4kxI90krj1knzixRKWxa77OAaxjO8dLTy02VpkV9M=";
};

nativeBuildInputs = [
pip
];

# dependency installation in setup.py doesn't work
patchPhase = ''
echo -n > requirements.txt
'';

buildInputs = [ setuptools napalm ];
buildInputs = [ napalm ];

propagatedBuildInputs = [ netmiko ];

# setup.cfg seems to contain invalid pytest parameters
preCheck = ''
rm setup.cfg
'';

nativeCheckInputs = [ pytestCheckHook ];

disabledTests = [
# AssertionError: Some methods vary.
"test_method_signatures"
Expand Down
9 changes: 8 additions & 1 deletion pkgs/development/python-modules/netcdf4/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
, fetchPypi
, isPyPy
, python
, oldest-supported-numpy
, setuptools
, wheel
, numpy
, zlib
, netcdf
Expand All @@ -26,7 +28,12 @@ buildPythonPackage rec {
hash = "sha256-A4KwL/aiiEGfb/7IXexA9FH0G4dVVHFUxXXd2fD0rlM=";
};

nativeBuildInputs = [ setuptools cython ];
nativeBuildInputs = [
cython
oldest-supported-numpy
setuptools
wheel
];

propagatedBuildInputs = [
cftime
Expand Down
Loading