2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
poetry-core,
|
|
|
|
pytest-snapshot,
|
|
|
|
pytestCheckHook,
|
2021-01-15 22:18:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "awesomeversion";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "24.2.0";
|
|
|
|
pyproject = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ludeeus";
|
2024-02-29 20:09:43 +00:00
|
|
|
repo = "awesomeversion";
|
2023-08-22 20:05:09 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-bpLtHhpWc1VweVl5G8mM473Js3bXT11N3Zc0jiVqq5c=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
2022-02-21 08:47:16 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Upstream doesn't set a version
|
|
|
|
substituteInPlace pyproject.toml \
|
2024-02-29 20:09:43 +00:00
|
|
|
--replace-fail 'version = "0"' 'version = "${version}"'
|
2022-02-21 08:47:16 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "awesomeversion" ];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytest-snapshot
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python module to deal with versions";
|
|
|
|
homepage = "https://github.com/ludeeus/awesomeversion";
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/ludeeus/awesomeversion/releases/tag/${version}";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|