diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index eb4eba0f587..d64f4a9792b 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -2,8 +2,8 @@ , buildPythonPackage , fetchPypi , fetchpatch -, isPy27 -, ipaddress +, rustPlatform +, setuptools-rust , openssl , cryptography_vectors , darwin @@ -13,27 +13,38 @@ , 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"; }; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + sourceRoot = "${pname}-${version}/${cargoRoot}"; + name = "${pname}-${version}"; + hash = "sha256-PS562W4L1NimqDV2H0jl5vYhL08H9est/pbIxSdYVfo="; + }; + + cargoRoot = "src/rust"; + outputs = [ "out" "dev" ]; nativeBuildInputs = lib.optionals (!isPyPy) [ cffi - ]; + rustPlatform.cargoSetupHook + setuptools-rust + ] ++ (with rustPlatform; [ rust.cargo rust.rustc ]); buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security; @@ -42,8 +53,6 @@ buildPythonPackage rec { six ] ++ lib.optionals (!isPyPy) [ cffi - ] ++ lib.optionals isPy27 [ - ipaddress enum34 ]; checkInputs = [ @@ -52,6 +61,7 @@ buildPythonPackage rec { iso8601 pretend pytest + pytest-subtests pytz ]; diff --git a/pkgs/development/python-modules/cryptography/vectors.nix b/pkgs/development/python-modules/cryptography/vectors.nix index f9b7c525237..16151a84124 100644 --- a/pkgs/development/python-modules/cryptography/vectors.nix +++ b/pkgs/development/python-modules/cryptography/vectors.nix @@ -7,7 +7,7 @@ buildPythonPackage rec { src = fetchPypi { inherit pname version; - sha256 = "1yhaps0f3h2yjb6lmz953z1l1d84y9swk4k3gj9nqyk4vbx5m7cc"; + sha256 = "0i888rrfn7116lj7f2nr4amd2z45sk6866zizjfpsn5wh2713cls"; }; # No tests included