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

python3Packages.cryptography: 3.3.2 -> 3.4.2 #112402

Closed
wants to merge 1 commit into from
Closed
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
19 changes: 11 additions & 8 deletions pkgs/development/python-modules/cryptography/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
, buildPythonPackage
, fetchPypi
, fetchpatch
, isPy27
, ipaddress
, openssl
, setuptools-rust
, cryptography_vectors
, darwin
, packaging
Expand All @@ -13,20 +12,20 @@
, isPyPy
, cffi
, pytest
, pytest-subtests
, pretend
, iso8601
, pytz
, hypothesis
, enum34
}:

buildPythonPackage rec {
pname = "cryptography";
version = "3.3.2"; # Also update the hash in vectors.nix
version = "3.4.2"; # Also update the hash in vectors.nix

src = fetchPypi {
inherit pname version;
sha256 = "1vcvw4lkw1spiq322pm1256kail8nck6bbgpdxx3pqa905wd6q2s";
sha256 = "1i1mx5y9hkyfi9jrrkcw804hmkcglxi6rmf7vin7jfnbr2bf4q64";
};

outputs = [ "out" "dev" ];
Expand All @@ -35,15 +34,13 @@ buildPythonPackage rec {
cffi
];

buildInputs = [ openssl ]
buildInputs = [ openssl setuptools-rust ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this isn't meant to be used at runtime, it should probably go into nativeBuildInputs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually never sure about this for buildPythonPackage. Is our manual outdated in this regard?

Because e.g. https://nixos.org/manual/nixpkgs/unstable/#python ("15.20.1.2.2. Handling dependencies") states:

According to the manual, buildPythonPackage uses the arguments buildInputs and propagatedBuildInputs to specify dependencies. If something is exclusively a build-time dependency, then the dependency should be included in buildInputs, but if it is (also) a runtime dependency, then it should be added to propagatedBuildInputs. Test dependencies are considered build-time dependencies and passed to checkInputs.

(I'm also not sure if "According to the manual" in the manual is an accidental self-reference :D)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonringer @FRidh should setuptools-rust be part of nativeBuildInputs or buildInputs now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nativeBuildInputs

++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
propagatedBuildInputs = [
packaging
six
] ++ lib.optionals (!isPyPy) [
cffi
] ++ lib.optionals isPy27 [
ipaddress enum34
];

checkInputs = [
Expand All @@ -52,9 +49,15 @@ buildPythonPackage rec {
iso8601
pretend
pytest
pytest-subtests
pytz
];

# TODO: This temporary workaround is only supported for Cryptography 3.4.x
# and we need to figure out how to build it with the Rust dependencies.
# https://cryptography.io/en/latest/faq.html?highlight=rust#installing-cryptography-fails-with-error-can-not-find-rust-compiler
CRYPTOGRAPHY_DONT_BUILD_RUST = 1;

checkPhase = ''
py.test --disable-pytest-warnings tests
'';
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/cryptography/vectors.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildPythonPackage rec {

src = fetchPypi {
inherit pname version;
sha256 = "1yhaps0f3h2yjb6lmz953z1l1d84y9swk4k3gj9nqyk4vbx5m7cc";
sha256 = "0i888rrfn7116lj7f2nr4amd2z45sk6866zizjfpsn5wh2713cls";
};

# No tests included
Expand Down