From cf8b55260ff708060dbca1a8b0d6b20c8f6895bb Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Sun, 12 Oct 2025 16:06:44 +0800 Subject: [PATCH 1/2] python3Packages.cryptography{,.vectors}: 46.0.1 -> 46.0.2 --- .../python-modules/cryptography/default.nix | 13 ++++++------- .../python-modules/cryptography/vectors.nix | 9 ++------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index 11f6406d4238..d9b3a68715ae 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { pname = "cryptography"; - version = "46.0.1"; # Also update the hash in vectors.nix + version = "46.0.2"; pyproject = true; disabled = pythonOlder "3.7"; @@ -31,7 +31,7 @@ buildPythonPackage rec { owner = "pyca"; repo = "cryptography"; tag = version; - hash = "sha256-saTHFKSJa9gjtEp6uGAHsvzFE3yPeck1WGdIE1+9kgs="; + hash = "sha256-gsEHKEYiMw2eliEpxwzFGDetOp77PivlMoBD3HBbbFA="; }; cargoDeps = rustPlatform.fetchCargoVendor { @@ -83,7 +83,7 @@ buildPythonPackage rec { vectors = cryptography-vectors; }; - meta = with lib; { + meta = { description = "Package which provides cryptographic recipes and primitives"; longDescription = '' Cryptography includes both high level recipes and low level interfaces to @@ -91,13 +91,12 @@ buildPythonPackage rec { digests, and key derivation functions. ''; homepage = "https://github.com/pyca/cryptography"; - changelog = - "https://cryptography.io/en/latest/changelog/#v" + replaceStrings [ "." ] [ "-" ] version; - license = with licenses; [ + changelog = "https://cryptography.io/en/latest/changelog/#v" + lib.replaceString "." "-" version; + license = with lib.licenses; [ asl20 bsd3 psfl ]; - maintainers = with maintainers; [ mdaniels5757 ]; + maintainers = with lib.maintainers; [ mdaniels5757 ]; }; } diff --git a/pkgs/development/python-modules/cryptography/vectors.nix b/pkgs/development/python-modules/cryptography/vectors.nix index 0a9a1a5d5894..0b518419f8a0 100644 --- a/pkgs/development/python-modules/cryptography/vectors.nix +++ b/pkgs/development/python-modules/cryptography/vectors.nix @@ -1,7 +1,6 @@ { lib, buildPythonPackage, - fetchPypi, cryptography, uv-build, }: @@ -9,14 +8,10 @@ buildPythonPackage rec { pname = "cryptography-vectors"; # The test vectors must have the same version as the cryptography package - inherit (cryptography) version; + inherit (cryptography) version src; pyproject = true; - src = fetchPypi { - pname = "cryptography_vectors"; - inherit version; - hash = "sha256-B40Sh84rRdJGtCxs+545Dh96+hdsGZsL1t6p1s6Jou4="; - }; + sourceRoot = "${src.name}/vectors"; build-system = [ uv-build ]; From 793760ff9576f1942ad54540a5d23b9f752f9e74 Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Sun, 12 Oct 2025 17:46:09 +0800 Subject: [PATCH 2/2] python3Packages.cryptography.vectors: fix build with uv_build 0.9.2 --- .../python-modules/cryptography/vectors.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/python-modules/cryptography/vectors.nix b/pkgs/development/python-modules/cryptography/vectors.nix index 0b518419f8a0..f8614e08a240 100644 --- a/pkgs/development/python-modules/cryptography/vectors.nix +++ b/pkgs/development/python-modules/cryptography/vectors.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, cryptography, + fetchpatch2, uv-build, }: @@ -13,6 +14,17 @@ buildPythonPackage rec { sourceRoot = "${src.name}/vectors"; + patches = [ + # https://github.com/NixOS/nixpkgs/pull/449568 + (fetchpatch2 { + name = "uv-build.patch"; + url = "https://github.com/pyca/cryptography/commit/5f311c1cbe09ddea6136b0bb737fb7df6df1b923.patch?full_index=1"; + stripLen = 1; + includes = [ "pyproject.toml" ]; + hash = "sha256-OdHK0OGrvOi3mS0q+v8keDLvKxtgQkDkHQSYnmC/vd4="; + }) + ]; + build-system = [ uv-build ]; # No tests included