23 buildPythonPackage rec {
24 pname = "cryptography";
25 version = "3.3.2"; # Also update the hash in vectors-3.3.nix
28 inherit pname version;
29 sha256 = "1vcvw4lkw1spiq322pm1256kail8nck6bbgpdxx3pqa905wd6q2s";
32 patches = [ ./cryptography-py27-warning.patch ];
34 outputs = [ "out" "dev" ];
36 nativeBuildInputs = lib.optionals (!isPyPy) [
40 buildInputs = [ openssl ]
41 ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
42 propagatedBuildInputs = [
45 ] ++ lib.optionals (!isPyPy) [
47 ] ++ lib.optionals isPy27 [
61 py.test --disable-pytest-warnings tests
64 # IOKit's dependencies are inconsistent between OSX versions, so this is the best we
65 # can do until nix 1.11's release
66 __impureHostDeps = [ "/usr/lib" ];
69 description = "A package which provides cryptographic recipes and primitives";
71 Cryptography includes both high level recipes and low level interfaces to
72 common cryptographic algorithms such as symmetric ciphers, message
73 digests, and key derivation functions.
74 Our goal is for it to be your "cryptographic standard library". It
75 supports Python 2.7, Python 3.5+, and PyPy 5.4+.
77 homepage = "https://github.com/pyca/cryptography";
78 changelog = "https://cryptography.io/en/latest/changelog/#v"
79 + replaceStrings [ "." ] [ "-" ] version;
80 license = with licenses; [ asl20 bsd3 psfl ];
81 maintainers = with maintainers; [ primeos ];