2021-01-15 22:18:51 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2024-01-13 08:15:51 +00:00
|
|
|
, pythonOlder
|
2022-02-21 08:47:16 +00:00
|
|
|
, poetry-core
|
2024-01-13 08:15:51 +00:00
|
|
|
, pytest-snapshot
|
2021-01-15 22:18:51 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
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-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +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 ];
|
|
|
|
};
|
|
|
|
}
|