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