From 22714ad6d05756a33219ae7a81fd8629001db3f3 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 2 Mar 2019 10:31:30 +0100 Subject: [PATCH 1/3] python37Packages.cryptography: Improve the test vectors integration This should make the management easier. The package cryptography_vectors contains the test vectors for cryptography and should therefore always have the same version. By linking the version of cryptography_vectors to cryptography, this simply cannot be forgotten. --- pkgs/development/python-modules/cryptography/default.nix | 3 +-- .../default.nix => cryptography/vectors.nix} | 6 +++--- pkgs/top-level/python-packages.nix | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) rename pkgs/development/python-modules/{cryptography_vectors/default.nix => cryptography/vectors.nix} (77%) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index dfbb14eb7e6..5e42774fdd9 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -20,9 +20,8 @@ }: buildPythonPackage rec { - # also bump cryptography_vectors pname = "cryptography"; - version = "2.5"; + version = "2.5"; # Also update the hash in vectors.nix src = fetchPypi { inherit pname version; diff --git a/pkgs/development/python-modules/cryptography_vectors/default.nix b/pkgs/development/python-modules/cryptography/vectors.nix similarity index 77% rename from pkgs/development/python-modules/cryptography_vectors/default.nix rename to pkgs/development/python-modules/cryptography/vectors.nix index f02a986ec02..86b16586f68 100644 --- a/pkgs/development/python-modules/cryptography_vectors/default.nix +++ b/pkgs/development/python-modules/cryptography/vectors.nix @@ -1,9 +1,9 @@ -{ buildPythonPackage, fetchPypi, lib }: +{ buildPythonPackage, fetchPypi, lib, cryptography }: buildPythonPackage rec { - # also bump cryptography pname = "cryptography_vectors"; - version = "2.5"; + # The test vectors must have the same version as the cryptography package: + version = cryptography.version; src = fetchPypi { inherit pname version; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index eb53f2dd5e0..0b7002cfe34 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1481,7 +1481,7 @@ in { cryptography = callPackage ../development/python-modules/cryptography { }; - cryptography_vectors = callPackage ../development/python-modules/cryptography_vectors { }; + cryptography_vectors = callPackage ../development/python-modules/cryptography/vectors.nix { }; curtsies = callPackage ../development/python-modules/curtsies { }; From 047af233cd2d8dd3606868d1cfbd3104bb28f58d Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 2 Mar 2019 12:11:33 +0100 Subject: [PATCH 2/3] python37Packages.cryptography: 2.5 -> 2.6.1 Changelog: https://cryptography.io/en/latest/changelog/#v2-6-1 Important changes: - BACKWARDS INCOMPATIBLE: Removed cryptography.hazmat.primitives.asymmetric.utils.encode_rfc6979_signature and cryptography.hazmat.primitives.asymmetric.utils.decode_rfc6979_signature, which had been deprecated for nearly 4 years. Use encode_dss_signature() and decode_dss_signature() instead. - BACKWARDS INCOMPATIBLE: Removed cryptography.x509.Certificate.serial, which had been deprecated for nearly 3 years. Use serial_number instead. --- pkgs/development/python-modules/cryptography/default.nix | 4 ++-- pkgs/development/python-modules/cryptography/vectors.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index 5e42774fdd9..93bbc28340e 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -21,11 +21,11 @@ buildPythonPackage rec { pname = "cryptography"; - version = "2.5"; # Also update the hash in vectors.nix + version = "2.6.1"; # Also update the hash in vectors.nix src = fetchPypi { inherit pname version; - sha256 = "00c4d7gvsymlaw0r13zrm32dcnarmpayjyrh65yymlmr6mrbcij9"; + sha256 = "19iwz5avym5zl6jrrrkym1rdaa9h61j20ph4cswsqgv8xg5j3j16"; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/python-modules/cryptography/vectors.nix b/pkgs/development/python-modules/cryptography/vectors.nix index 86b16586f68..5679905cd14 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 = "15qfl3pnw2f11r0z0zhwl56f6pb60ysav8fxmpnz5p80cfwljdik"; + sha256 = "1bsqcv3h49dzqnyn29ijq8r7k1ra8ikl1y9qcpcns9nbvhaq3wq3"; }; # No tests included From 186fc20392a9c523c4b3fc85037e16f25dfd2256 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sat, 30 Mar 2019 12:13:09 -0400 Subject: [PATCH 3/3] pythonPackages.cryptography: vectors are checkInputs --- .../python-modules/cryptography/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index 93bbc28340e..69c9f729294 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -30,7 +30,7 @@ buildPythonPackage rec { outputs = [ "out" "dev" ]; - buildInputs = [ openssl cryptography_vectors ] + buildInputs = [ openssl ] ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security; propagatedBuildInputs = [ asn1crypto @@ -41,11 +41,12 @@ buildPythonPackage rec { ++ stdenv.lib.optional (!isPyPy) cffi; checkInputs = [ - pytest - pretend - iso8601 - pytz + cryptography_vectors hypothesis + iso8601 + pretend + pytest + pytz ]; checkPhase = ''