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