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

overrides: update build system for pyzmq 26.0.0 to scikit-build #1603

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions overrides/build-systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -20235,8 +20235,18 @@
"pyzmq": [
"cython",
"packaging",
"setuptools",
"setuptools-scm"
{
"buildSystem": "setuptools",
"until": "26.0.0"
},
{
"buildSystem": "setuptools-scm",
"until": "26.0.0"
},
{
"buildSystem": "scikit-build-core",
"from": "26.0.0"
}
],
"pyzufall": [
"setuptools"
Expand Down
25 changes: 25 additions & 0 deletions overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2939,6 +2939,18 @@ lib.composeManyExtensions [
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.zeromq ];
# setting dontUseCmakeConfigure is necessary because:
#
# 1. pyzmq uses scikit-build-core as of pyzmq version 26.0.0
# 2. scikit-build-core requires the *Python* cmake package to find the cmake binary
# 3. since scikit-build-core's is in nativeBuildInputs and python
# cmake depends on pkgs.cmake that puts cmake in pyzmq's
# nativeBuildInputs
# 4. point 3 causes the pyzmq build it use vanilla cmake configure
# instead of cmake via scikit-build-core
#
# what a heaping mess
dontUseCmakeConfigure = lib.versionAtLeast old.version "26.0.0";
}
);

Expand Down Expand Up @@ -3256,6 +3268,19 @@ lib.composeManyExtensions [
} else old
);

scikit-build-core = super.scikit-build-core.overridePythonAttrs (
old: {
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [
self.pyproject-metadata
self.pathspec
# these are _intentionally_ the *Python* wrappers for cmake and
# ninja, both of which are used by scikit-build-core
self.cmake
self.ninja
];
}
);

scikit-image = super.scikit-image.overridePythonAttrs (
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
Expand Down
1 change: 1 addition & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ in
scientific = callTest ./scientific { };
apsw = callTest ./apsw { };
no-infinite-recur-on-missing-gitignores = callTest ./no-infinite-recur-on-missing-gitignores { };
pyzmq = callTest ./pyzmq { };
} // lib.optionalAttrs (!stdenv.isDarwin) {
# pyqt5 = (callTest ./pyqt5 { });
pyqt6 = callTest ./pyqt6 { };
Expand Down
11 changes: 11 additions & 0 deletions tests/pyzmq/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ poetry2nix, python3, runCommand }:
let
env = poetry2nix.mkPoetryEnv {
python = python3;
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
};
in
runCommand "pyzmq-test" { } ''
${env}/bin/python -c 'import zmq; print(zmq.__version__)' > $out
''
Loading