From 052f5aea580dd5a10d179fe682f521f28c3bb5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Tue, 18 Jul 2023 22:57:06 +0200 Subject: [PATCH] python310Packages.calver: move tests to passthru.tests to avoid infinite recursion with hatchling update --- .../python-modules/calver/default.nix | 66 ++++++++++--------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/pkgs/development/python-modules/calver/default.nix b/pkgs/development/python-modules/calver/default.nix index 398e07b39df8..4b400f218739 100644 --- a/pkgs/development/python-modules/calver/default.nix +++ b/pkgs/development/python-modules/calver/default.nix @@ -6,37 +6,43 @@ , pytestCheckHook }: -buildPythonPackage rec { - pname = "calver"; - version = "2022.06.26"; +let + self = buildPythonPackage rec { + pname = "calver"; + version = "2022.06.26"; + format = "setuptools"; - disabled = pythonOlder "3.5"; + disabled = pythonOlder "3.5"; - format = "setuptools"; + src = fetchFromGitHub { + owner = "di"; + repo = "calver"; + rev = version; + hash = "sha256-YaXTkeUazwzghCX96Wfx39hGvukWKtHMLLeyF9OeiZI="; + }; - src = fetchFromGitHub { - owner = "di"; - repo = "calver"; - rev = version; - hash = "sha256-YaXTkeUazwzghCX96Wfx39hGvukWKtHMLLeyF9OeiZI="; + postPatch = '' + substituteInPlace setup.py \ + --replace "version=calver_version(True)" 'version="${version}"' + ''; + + doCheck = false; # avoid infinite recursion with hatchling + + nativeCheckInputs = [ + pretend + pytestCheckHook + ]; + + pythonImportsCheck = [ "calver" ]; + + passthru.tests.calver = self.overridePythonAttrs { doCheck = true; }; + + meta = { + description = "Setuptools extension for CalVer package versions"; + homepage = "https://github.com/di/calver"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ dotlambda ]; + }; }; - - postPatch = '' - substituteInPlace setup.py \ - --replace "version=calver_version(True)" 'version="${version}"' - ''; - - nativeCheckInputs = [ - pretend - pytestCheckHook - ]; - - pythonImportsCheck = [ "calver" ]; - - meta = { - description = "Setuptools extension for CalVer package versions"; - homepage = "https://github.com/di/calver"; - license = lib.licenses.asl20; - maintainers = with lib.maintainers; [ dotlambda ]; - }; -} +in + self