From fb83ee7d26bee200b2bd6b69df390c57dee4b6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 10 Dec 2022 11:54:39 -0800 Subject: [PATCH] python310Packages.calver: adopt and run tests --- .../python-modules/calver/default.nix | 38 ++++++++++++++----- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/calver/default.nix b/pkgs/development/python-modules/calver/default.nix index 13377419c174..dcc692ce7b5f 100644 --- a/pkgs/development/python-modules/calver/default.nix +++ b/pkgs/development/python-modules/calver/default.nix @@ -1,24 +1,42 @@ { lib , buildPythonPackage -, fetchPypi +, pythonOlder +, fetchFromGitHub +, pretend +, pytestCheckHook }: -let + +buildPythonPackage rec { pname = "calver"; - version = "2022.6.26"; + version = "2022.06.26"; -in -buildPythonPackage { - inherit pname version; + disabled = pythonOlder "3.5"; - src = fetchPypi { - inherit pname version; - hash = "sha256-4FSTo7F1F+8XSPvmENoR8QSF+qfEFrnTP9SlLXSJT4s="; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "di"; + repo = "calver"; + rev = version; + hash = "sha256-YaXTkeUazwzghCX96Wfx39hGvukWKtHMLLeyF9OeiZI="; }; + postPatch = '' + substituteInPlace setup.py \ + --replace "version=calver_version(True)" 'version="${version}"' + ''; + + checkInputs = [ + pretend + pytestCheckHook + ]; + + pythonImportsCheck = [ "calver" ]; + meta = { description = "Setuptools extension for CalVer package versions"; homepage = "https://github.com/di/calver"; license = lib.licenses.asl20; - maintainers = [ ]; + maintainers = with lib.maintainers; [ dotlambda ]; }; }