Skip to content
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
40 changes: 20 additions & 20 deletions pkgs/development/python-modules/cryptography/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,47 @@
, callPackage
, buildPythonPackage
, fetchPypi
, rustPlatform
, cargo
, rustc
, setuptools-rust
, openssl
, Security
, isPyPy
, cffi
, pkg-config
, pytestCheckHook
, pytest-subtests
, pythonOlder
, pretend
, hypothesis
, isPyPy
, iso8601
, libiconv
, libxcrypt
, iso8601
, openssl
, pkg-config
, pretend
, py
, pytest-subtests
, pytestCheckHook
, pythonOlder
, pytz
, hypothesis
, rustPlatform
, rustc
, Security
, setuptools
, setuptools-rust
}:

let
cryptography-vectors = callPackage ./vectors.nix { };
in
buildPythonPackage rec {
pname = "cryptography";
version = "40.0.1"; # Also update the hash in vectors.nix
format = "setuptools";
disabled = pythonOlder "3.6";
version = "41.0.1"; # Also update the hash in vectors.nix
format = "pyproject";
disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
hash = "sha256-KAPy+LHpX2FEGZJsfm9V2CivxhTKXtYVQ4d65mjMNHI=";
hash = "sha256-00V5CFQB0/SXYtL31mNNa2wq4SQiAuhg9NJrBG46EAY=";
};

cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
sourceRoot = "${pname}-${version}/${cargoRoot}";
name = "${pname}-${version}";
hash = "sha256-gFfDTc2QWBWHBCycVH1dYlCsWQMVcRZfOBIau+njtDU=";
hash = "sha256-38q81vRf8QHR8lFRM2KbH7Ng5nY7nmtWRMoPWS9VO/U=";
};

postPatch = ''
Expand All @@ -57,6 +58,7 @@ buildPythonPackage rec {
pkg-config
] ++ [
rustPlatform.cargoSetupHook
setuptools
setuptools-rust
cargo
rustc
Expand Down Expand Up @@ -100,8 +102,6 @@ buildPythonPackage rec {
Cryptography includes both high level recipes and low level interfaces to
common cryptographic algorithms such as symmetric ciphers, message
digests, and key derivation functions.
Our goal is for it to be your "cryptographic standard library". It
supports Python 2.7, Python 3.5+, and PyPy 5.4+.
'';
homepage = "https://github.com/pyca/cryptography";
changelog = "https://cryptography.io/en/latest/changelog/#v"
Expand Down
10 changes: 6 additions & 4 deletions pkgs/development/python-modules/cryptography/vectors.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{ buildPythonPackage, fetchPypi, lib, cryptography }:
{ buildPythonPackage, fetchPypi, lib, cryptography, setuptools }:

buildPythonPackage rec {
pname = "cryptography-vectors";
# The test vectors must have the same version as the cryptography package
inherit (cryptography) version;
format = "setuptools";
format = "pyproject";

src = fetchPypi {
pname = "cryptography_vectors";
inherit version;
hash = "sha256-hGBwa1tdDOSoVXHKM4nPiPcAu2oMYTPcn+D1ovW9oEE=";
hash = "sha256-I7CMOXd+x7J3ShH5RdF0YwGx6I7P8uUybX9Q6g9C1YA=";
};

nativeBuildInputs = [ setuptools ];

# No tests included
doCheck = false;

Expand All @@ -20,7 +22,7 @@ buildPythonPackage rec {
meta = with lib; {
description = "Test vectors for the cryptography package";
homepage = "https://cryptography.io/en/latest/development/test-vectors/";
# Source: https://github.com/pyca/cryptography/tree/master/vectors;
downloadPage = "https://github.com/pyca/cryptography/tree/master/vectors";
license = with licenses; [ asl20 bsd3 ];
maintainers = with maintainers; [ SuperSandro2000 ];
};
Expand Down