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

Add override for Pendulum version 3.0.0 with Rust #1739

Merged
merged 12 commits into from
Sep 29, 2024
Merged
19 changes: 19 additions & 0 deletions overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,25 @@ lib.composeManyExtensions [
}
);

pendulum = prev.pendulum.overridePythonAttrs (
old:
# NOTE: Versions <3.0.0 is pure Python and is not PEP-517 compliant,
# which means they can not be built using recent Poetry versions.
lib.optionalAttrs (lib.versionAtLeast old.version "3" && (!old.src.isWheel or false)) {
cargoRoot = "rust";
cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = ./pendulum/3.0.0-Cargo.lock;
};
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [
pkgs.rustPlatform.cargoSetupHook
pkgs.rustPlatform.maturinBuildHook
];
buildInputs = old.buildInputs or [ ] ++ lib.optionals pkgs.stdenv.isDarwin [
pkgs.libiconv
];
}
);

pikepdf = prev.pikepdf.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ pkgs.qpdf final.pybind11 ];
Expand Down
318 changes: 318 additions & 0 deletions overrides/pendulum/3.0.0-Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ in
} // lib.optionalAttrs (stdenv.isLinux && stdenv.isx86_64) {
# x86_86-linux
pendulum = callTest ./pendulum { };
pendulum-with-rust = callTest ./pendulum-with-rust { };
tensorflow = callTest ./tensorflow { };
# Test deadlocks on darwin and fails to start at all with aarch64-linux,
# sandboxing issue?
Expand Down
7 changes: 7 additions & 0 deletions tests/pendulum-with-rust/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ lib, poetry2nix, python39 }:
poetry2nix.mkPoetryApplication {
pyproject = ./pyproject.toml;
poetrylock = ./poetry.lock;
src = lib.cleanSource ./.;
python = python39;
}
Loading