Files
nixpkgs/pkgs/development/python-modules/cryptography/default.nix
T
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

100 lines
2.1 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
callPackage,
setuptools,
bcrypt,
certifi,
cffi,
cryptography-vectors ? (callPackage ./vectors.nix { }),
fetchFromGitHub,
isPyPy,
libiconv,
openssl,
pkg-config,
pretend,
pytest-xdist,
pytestCheckHook,
rustPlatform,
}:
buildPythonPackage rec {
pname = "cryptography";
version = "46.0.3";
pyproject = true;
src = fetchFromGitHub {
owner = "pyca";
repo = "cryptography";
tag = version;
hash = "sha256-6t7f/BaMkA24MY05B7aYa0myxnCjrCsh1qk6RgAjeQc=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
hash = "sha256-5ElDEl7MdcQfu/hy+POSBcvkNCFAMo6La5s6uRhZ/fM=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "--benchmark-disable" ""
'';
build-system = [
rustPlatform.cargoSetupHook
rustPlatform.maturinBuildHook
pkg-config
setuptools
]
++ lib.optionals (!isPyPy) [ cffi ];
buildInputs = [
openssl
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
dependencies = lib.optionals (!isPyPy) [ cffi ];
optional-dependencies.ssh = [ bcrypt ];
nativeCheckInputs = [
certifi
cryptography-vectors
pretend
pytestCheckHook
pytest-xdist
]
++ optional-dependencies.ssh;
pytestFlags = [ "--disable-pytest-warnings" ];
disabledTestPaths = [
# save compute time by not running benchmarks
"tests/bench"
];
passthru = {
vectors = cryptography-vectors;
};
meta = {
description = "Package which provides cryptographic recipes and primitives";
longDescription = ''
Cryptography includes both high level recipes and low level interfaces to
common cryptographic algorithms such as symmetric ciphers, message
digests, and key derivation functions.
'';
homepage = "https://github.com/pyca/cryptography";
changelog = "https://cryptography.io/en/latest/changelog/#v" + lib.replaceString "." "-" version;
license = with lib.licenses; [
asl20
bsd3
psfl
];
maintainers = with lib.maintainers; [ mdaniels5757 ];
};
}