-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
Unable to override cryptography package #1519
Comments
This probably does not work due to the change in #899 — overrides = [ poetry2nix.defaultPoetryOverrides (self: super: {
# ... package overrides here ...
}) ]; |
This issue was helpful: nix-community/poetry2nix#1519 Waiting until this PR gets merged: nix-community/poetry2nix#1538
This issue was helpful: nix-community/poetry2nix#1519 Waiting until this PR gets merged: nix-community/poetry2nix#1538
Hi, thanks to your snippet I was able to update cryptography to 42.0.4. My patch looked like this: diff --git a/backend/flake.nix b/backend/flake.nix
index 1e4a34fb..f227fd13 100644
--- a/backend/flake.nix
+++ b/backend/flake.nix
@@ -68,6 +68,15 @@
buildInputs = (old.buildInputs or [ ]) ++ [ super.hatchling super.setuptools ];
}
);
+ cryptography = super.cryptography.overridePythonAttrs (old: rec {
+ cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
+ inherit (old) src;
+ name = "${old.pname}-${old.version}";
+ sourceRoot = "${old.pname}-${old.version}/${cargoRoot}";
+ sha256 = "sha256-qaXQiF1xZvv4sNIiR2cb5TfD7oNiYdvUwcm37nh2P2M=";
+ };
+ cargoRoot = "src/rust";
+ });
});
poetryEnv = mkPoetryEnv {
inherit projectDir; See this commit here My overrides are created with overrides = defaultPoetryOverrides.extend (self: super: { based off the poetry2nix flake guide, and just like @sigprof here recommended as well -- so perhaps that made a difference? |
I am seeing this with cryptography 43.0.0 as well (currently the most recent release). I can also confirm that the workaround above works (thanks @justuswilhelm!). EDIT: I guess I wrote too soon :( ~ the workaround above does not work, cryptography switched to maturin recently. With just the workaround above, it fails to build complaining However, I can't help but feel that this is an awkward way to address the underlying problem: that Would it then make sense to expose a simpler override API in addition to the current one, that simply takes as input these things: the package name, the published PyPI version, and its expected SHA-256? We'd then have a way to override just the necessary bits, and remove these manual overrides when poetry2nix is updated. |
@sigprof this advice saved me another hours, thank you very much. I'll try to push that to FAQ |
Not sure why, but it looks like it isn't possible to override cryptography package.
It looks like an issue was raised here: #1337, but the original author closed it because update to cryptography was pushed and the override was no longer needed.
Here's example of override:
And I still get error that the hash is not being set:
It's surprising because overriding other packages works.
The text was updated successfully, but these errors were encountered: