nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

python310Packages.calver: move tests to passthru.tests

to avoid infinite recursion with hatchling update

authored by

Sandro Jäckel and committed by
Martin Weinelt
052f5aea a5e4dd0a

+36 -30
+36 -30
pkgs/development/python-modules/calver/default.nix
··· 6 6 , pytestCheckHook 7 7 }: 8 8 9 - buildPythonPackage rec { 10 - pname = "calver"; 11 - version = "2022.06.26"; 9 + let 10 + self = buildPythonPackage rec { 11 + pname = "calver"; 12 + version = "2022.06.26"; 13 + format = "setuptools"; 12 14 13 - disabled = pythonOlder "3.5"; 15 + disabled = pythonOlder "3.5"; 14 16 15 - format = "setuptools"; 17 + src = fetchFromGitHub { 18 + owner = "di"; 19 + repo = "calver"; 20 + rev = version; 21 + hash = "sha256-YaXTkeUazwzghCX96Wfx39hGvukWKtHMLLeyF9OeiZI="; 22 + }; 16 23 17 - src = fetchFromGitHub { 18 - owner = "di"; 19 - repo = "calver"; 20 - rev = version; 21 - hash = "sha256-YaXTkeUazwzghCX96Wfx39hGvukWKtHMLLeyF9OeiZI="; 24 + postPatch = '' 25 + substituteInPlace setup.py \ 26 + --replace "version=calver_version(True)" 'version="${version}"' 27 + ''; 28 + 29 + doCheck = false; # avoid infinite recursion with hatchling 30 + 31 + nativeCheckInputs = [ 32 + pretend 33 + pytestCheckHook 34 + ]; 35 + 36 + pythonImportsCheck = [ "calver" ]; 37 + 38 + passthru.tests.calver = self.overridePythonAttrs { doCheck = true; }; 39 + 40 + meta = { 41 + description = "Setuptools extension for CalVer package versions"; 42 + homepage = "https://github.com/di/calver"; 43 + license = lib.licenses.asl20; 44 + maintainers = with lib.maintainers; [ dotlambda ]; 45 + }; 22 46 }; 23 - 24 - postPatch = '' 25 - substituteInPlace setup.py \ 26 - --replace "version=calver_version(True)" 'version="${version}"' 27 - ''; 28 - 29 - nativeCheckInputs = [ 30 - pretend 31 - pytestCheckHook 32 - ]; 33 - 34 - pythonImportsCheck = [ "calver" ]; 35 - 36 - meta = { 37 - description = "Setuptools extension for CalVer package versions"; 38 - homepage = "https://github.com/di/calver"; 39 - license = lib.licenses.asl20; 40 - maintainers = with lib.maintainers; [ dotlambda ]; 41 - }; 42 - } 47 + in 48 + self