Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / awesomeversion / default.nix
blobf728bbb562097d8f3e67326f0592bdec3ead6ff3
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pythonOlder
5 , poetry-core
6 , pytest-snapshot
7 , pytestCheckHook
8 }:
10 buildPythonPackage rec {
11   pname = "awesomeversion";
12   version = "24.2.0";
13   pyproject = true;
15   disabled = pythonOlder "3.8";
17   src = fetchFromGitHub {
18     owner = "ludeeus";
19     repo = "awesomeversion";
20     rev = "refs/tags/${version}";
21     hash = "sha256-bpLtHhpWc1VweVl5G8mM473Js3bXT11N3Zc0jiVqq5c=";
22   };
24   postPatch = ''
25     # Upstream doesn't set a version
26     substituteInPlace pyproject.toml \
27       --replace-fail 'version = "0"' 'version = "${version}"'
28   '';
30   nativeBuildInputs = [
31     poetry-core
32   ];
34   pythonImportsCheck = [
35     "awesomeversion"
36   ];
38   nativeCheckInputs = [
39     pytest-snapshot
40     pytestCheckHook
41   ];
43   meta = with lib; {
44     description = "Python module to deal with versions";
45     homepage = "https://github.com/ludeeus/awesomeversion";
46     changelog = "https://github.com/ludeeus/awesomeversion/releases/tag/${version}";
47     license = with licenses; [ mit ];
48     maintainers = with maintainers; [ fab ];
49   };