Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / calver / default.nix
blob4b400f218739f9d7f666b65a28c23d8c6a03c4bd
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
5 , pretend
6 , pytestCheckHook
7 }:
9 let
10   self = buildPythonPackage rec {
11     pname = "calver";
12     version = "2022.06.26";
13     format = "setuptools";
15     disabled = pythonOlder "3.5";
17     src = fetchFromGitHub {
18       owner = "di";
19       repo = "calver";
20       rev = version;
21       hash = "sha256-YaXTkeUazwzghCX96Wfx39hGvukWKtHMLLeyF9OeiZI=";
22     };
24     postPatch = ''
25       substituteInPlace setup.py \
26         --replace "version=calver_version(True)" 'version="${version}"'
27     '';
29     doCheck = false; # avoid infinite recursion with hatchling
31     nativeCheckInputs = [
32       pretend
33       pytestCheckHook
34     ];
36     pythonImportsCheck = [ "calver" ];
38     passthru.tests.calver = self.overridePythonAttrs { doCheck = true; };
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     };
46   };
48   self