From 207bc85685123df3f6981be9c906ff4a3783ac16 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 29 Jan 2024 19:48:23 +0100 Subject: [PATCH] python311Packages.cryptodatahub: refactor --- .../python-modules/cryptodatahub/default.nix | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/cryptodatahub/default.nix b/pkgs/development/python-modules/cryptodatahub/default.nix index 734569297796..be62c67babd3 100644 --- a/pkgs/development/python-modules/cryptodatahub/default.nix +++ b/pkgs/development/python-modules/cryptodatahub/default.nix @@ -1,36 +1,38 @@ { lib -, buildPythonPackage -, fetchFromGitLab - -# build-system -, setuptools - -# dependencies , asn1crypto , attrs -, pathlib2 -, python-dateutil -, six -, urllib3 - -# tests , beautifulsoup4 +, buildPythonPackage +, fetchFromGitLab +, pathlib2 , pyfakefs +, python-dateutil +, pythonOlder +, setuptools +, six , unittestCheckHook +, urllib3 }: buildPythonPackage rec { pname = "cryptodatahub"; version = "0.10.1"; - format = "pyproject"; + pyproject = true; + + disabled = pythonOlder "3.7"; src = fetchFromGitLab { owner = "coroner"; repo = "cryptodatahub"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; hash = "sha256-eLdK5gFrLnbIBB1NTeQzpdCLPdATVjzPn5LhhUsDuwo="; }; + postPatch = '' + substituteInPlace requirements.txt \ + --replace-warn "attrs>=20.3.0,<22.0.1" "attrs>=20.3.0" + ''; + nativeBuildInputs = [ setuptools ]; @@ -44,14 +46,17 @@ buildPythonPackage rec { urllib3 ]; - pythonImportsCheck = [ "cryptodatahub" ]; - nativeCheckInputs = [ beautifulsoup4 pyfakefs unittestCheckHook ]; + pythonImportsCheck = [ + "cryptodatahub" + ]; + + preCheck = '' # failing tests rm test/updaters/test_common.py @@ -60,7 +65,7 @@ buildPythonPackage rec { meta = with lib; { description = "Repository of cryptography-related data"; homepage = "https://gitlab.com/coroner/cryptodatahub"; - changelog = "https://gitlab.com/coroner/cryptodatahub/-/blob/${src.rev}/CHANGELOG.rst"; + changelog = "https://gitlab.com/coroner/cryptodatahub/-/blob/${version}/CHANGELOG.rst"; license = licenses.mpl20; maintainers = with maintainers; [ ]; };