diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index a440e7e480da..29076051578e 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -3,12 +3,12 @@ stdenv, buildPythonPackage, callPackage, - cargo, + setuptools, + bcrypt, certifi, cffi, cryptography-vectors ? (callPackage ./vectors.nix { }), fetchPypi, - fetchpatch2, isPyPy, libiconv, libxcrypt, @@ -18,39 +18,29 @@ pytest-xdist, pytestCheckHook, pythonOlder, - rustc, rustPlatform, Security, - setuptoolsRustBuildHook, }: buildPythonPackage rec { pname = "cryptography"; - version = "42.0.8"; # Also update the hash in vectors.nix + version = "43.0.0"; # Also update the hash in vectors.nix pyproject = true; disabled = pythonOlder "3.7"; src = fetchPypi { inherit pname version; - hash = "sha256-jQnQVDnOe6qOnpWwfsW2yIb1SN634Pae8l9ks7zoQvI="; + hash = "sha256-uIB1raLVGqnxgoNTLJ9g5yFwBBu6iNfzfknLsQJ1KZ4="; }; cargoDeps = rustPlatform.fetchCargoTarball { inherit src; sourceRoot = "${pname}-${version}/${cargoRoot}"; name = "${pname}-${version}"; - hash = "sha256-PgxPcFocEhnQyrsNtCN8YHiMptBmk1PUhEDQFdUR1nU="; + hash = "sha256-TEQy8PrIaZshiBFTqR/OJp3e/bVM1USjcmpDYcjPJPM="; }; - patches = [ - (fetchpatch2 { - # skip overflowing tests on 32 bit; https://github.com/pyca/cryptography/pull/10366 - url = "https://github.com/pyca/cryptography/commit/d741901dddd731895346636c0d3556c6fa51fbe6.patch"; - hash = "sha256-eC+MZg5O8Ia5CbjRE4y+JhaFs3Q5c62QtPHr3x9T+zw="; - }) - ]; - postPatch = '' substituteInPlace pyproject.toml \ --replace-fail "--benchmark-disable" "" @@ -58,12 +48,11 @@ buildPythonPackage rec { cargoRoot = "src/rust"; - nativeBuildInputs = [ + build-system = [ rustPlatform.cargoSetupHook - setuptoolsRustBuildHook - cargo - rustc + rustPlatform.maturinBuildHook pkg-config + setuptools ] ++ lib.optionals (!isPyPy) [ cffi ]; buildInputs = @@ -74,7 +63,9 @@ buildPythonPackage rec { ] ++ lib.optionals (pythonOlder "3.9") [ libxcrypt ]; - propagatedBuildInputs = lib.optionals (!isPyPy) [ cffi ]; + dependencies = lib.optionals (!isPyPy) [ cffi ]; + + optional-dependencies.ssh = [ bcrypt ]; nativeCheckInputs = [ certifi @@ -82,7 +73,7 @@ buildPythonPackage rec { pretend pytestCheckHook pytest-xdist - ]; + ] ++ optional-dependencies.ssh; pytestFlagsArray = [ "--disable-pytest-warnings" ]; @@ -91,6 +82,10 @@ buildPythonPackage rec { "tests/bench" ]; + passthru = { + vectors = cryptography-vectors; + }; + meta = with lib; { description = "Package which provides cryptographic recipes and primitives"; longDescription = '' diff --git a/pkgs/development/python-modules/cryptography/vectors.nix b/pkgs/development/python-modules/cryptography/vectors.nix index 8d1bb48d623a..d0f635df8b9e 100644 --- a/pkgs/development/python-modules/cryptography/vectors.nix +++ b/pkgs/development/python-modules/cryptography/vectors.nix @@ -15,7 +15,7 @@ buildPythonPackage rec { src = fetchPypi { pname = "cryptography_vectors"; inherit version; - hash = "sha256-31ZXNnvAqQw3QwnLJhAJosU8rpGkWHgTOaD3JPgZpGo="; + hash = "sha256-XJ0JpzLVQzzt4VQqluzXCoDhIq8EfudAS83x88y45wI="; }; nativeBuildInputs = [ flit-core ];