1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, poetry-core
5, pytestCheckHook
6, pythonOlder
7}:
8
9buildPythonPackage rec {
10 pname = "awesomeversion";
11 version = "22.9.0";
12 format = "pyproject";
13
14 disabled = pythonOlder "3.8";
15
16 src = fetchFromGitHub {
17 owner = "ludeeus";
18 repo = pname;
19 rev = version;
20 sha256 = "sha256-OQArggd7210OyFpZKm3kr3fFbakIDG7U3WBNImAAobw=";
21 };
22
23 nativeBuildInputs = [
24 poetry-core
25 ];
26
27 checkInputs = [
28 pytestCheckHook
29 ];
30
31 postPatch = ''
32 # Upstream doesn't set a version
33 substituteInPlace pyproject.toml \
34 --replace 'version = "0"' 'version = "${version}"'
35 '';
36
37 pythonImportsCheck = [
38 "awesomeversion"
39 ];
40
41 meta = with lib; {
42 description = "Python module to deal with versions";
43 homepage = "https://github.com/ludeeus/awesomeversion";
44 license = with licenses; [ mit ];
45 maintainers = with maintainers; [ fab ];
46 };
47}