Skip to content

Commit

Permalink
Merge pull request #1739 from bow/feature/pendulum-with-rust
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored Sep 29, 2024
2 parents c9d0732 + 07bb042 commit ecb1843
Show file tree
Hide file tree
Showing 7 changed files with 564 additions and 0 deletions.
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

0 comments on commit ecb1843

Please sign in to comment.