From 4585ca9dc7bca37136026979f891e5f3c351ad4d Mon Sep 17 00:00:00 2001 From: Sizhe Zhao Date: Thu, 1 Jan 2026 11:34:10 +0800 Subject: [PATCH] python3Packages.cryptoparser: 1.0.0 -> 1.0.2 --- .../python-modules/cryptoparser/default.nix | 38 +++++++++++-------- .../cryptoparser/fix-dirs-exclude.patch | 27 ------------- 2 files changed, 23 insertions(+), 42 deletions(-) delete mode 100644 pkgs/development/python-modules/cryptoparser/fix-dirs-exclude.patch diff --git a/pkgs/development/python-modules/cryptoparser/default.nix b/pkgs/development/python-modules/cryptoparser/default.nix index df67fc5f5a9b..f8992bfb8a3b 100644 --- a/pkgs/development/python-modules/cryptoparser/default.nix +++ b/pkgs/development/python-modules/cryptoparser/default.nix @@ -4,29 +4,35 @@ attrs, buildPythonPackage, cryptodatahub, - fetchPypi, - python-dateutil, + fetchFromGitLab, + fetchpatch2, + pyfakefs, pythonOlder, setuptools, setuptools-scm, + unittestCheckHook, urllib3, }: buildPythonPackage rec { pname = "cryptoparser"; - version = "1.0.0"; + version = "1.0.2"; pyproject = true; disabled = pythonOlder "3.9"; - src = fetchPypi { - inherit pname version; - hash = "sha256-bEvhMVcm9sXlfhxUD2K4N10nusgxpGYFJQLtJE1/qok="; + src = fetchFromGitLab { + owner = "coroner"; + repo = "cryptoparser"; + tag = "v${version}"; + hash = "sha256-CsG4hfA3pfE7FwxNfaUTLMS8RV0tv1czoHdIlolUX34="; }; patches = [ - # https://gitlab.com/coroner/cryptoparser/-/merge_requests/2 - ./fix-dirs-exclude.patch + (fetchpatch2 { + url = "https://gitlab.com/coroner/cryptoparser/-/merge_requests/2.diff"; + hash = "sha256-T8dK6OMR41XUMrZ6B7ZybEtljZJOR2QbCiZl04dT3wA="; + }) ]; build-system = [ @@ -38,16 +44,18 @@ buildPythonPackage rec { asn1crypto attrs cryptodatahub - python-dateutil urllib3 ]; - postInstall = '' - find $out -name "__pycache__" -type d | xargs rm -rv + env.PYTHONDONTWRITEBYTECODE = 1; - # Prevent creating more binary byte code later (e.g. during - # pythonImportsCheck) - export PYTHONDONTWRITEBYTECODE=1 + nativeCheckInputs = [ + pyfakefs + unittestCheckHook + ]; + + postInstall = '' + find $out -name __pycache__ -type d | xargs rm -rv ''; pythonImportsCheck = [ "cryptoparser" ]; @@ -55,7 +63,7 @@ buildPythonPackage rec { meta = { description = "Security protocol parser and generator"; homepage = "https://gitlab.com/coroner/cryptoparser"; - changelog = "https://gitlab.com/coroner/cryptoparser/-/blob/v${version}/CHANGELOG.md"; + changelog = "https://gitlab.com/coroner/cryptoparser/-/blob/${src.tag}/CHANGELOG.md"; license = lib.licenses.mpl20; maintainers = with lib.maintainers; [ kranzes ]; }; diff --git a/pkgs/development/python-modules/cryptoparser/fix-dirs-exclude.patch b/pkgs/development/python-modules/cryptoparser/fix-dirs-exclude.patch deleted file mode 100644 index c667b3b1a8e5..000000000000 --- a/pkgs/development/python-modules/cryptoparser/fix-dirs-exclude.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 512b5d6e30784594db46bcd0071d63da7065e478 Mon Sep 17 00:00:00 2001 -From: Ivan Mincik -Date: Wed, 17 Sep 2025 14:09:31 +0200 -Subject: [PATCH] Fix directories exclude from package - -* correctly exclude submodules directory -* also exclude docs directory ---- - pyproject.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index 73897d6..74d43e4 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -75,7 +75,7 @@ technical_name = 'cryptoparser' - license-files = ['LICENSE.txt'] - - [tool.setuptools.packages.find] --exclude = ['submodules'] -+exclude = ['submodules*', 'docs'] - - [tool.tox] - envlist = [ --- -GitLab -