2022-03-30 09:31:56 +00:00
|
|
|
{ lib
|
|
|
|
, poetry-core
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, importlib-metadata
|
|
|
|
, packaging
|
|
|
|
, pytestCheckHook
|
2023-01-20 10:41:00 +00:00
|
|
|
, git
|
2022-03-30 09:31:56 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dunamai";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.19.2";
|
2022-03-30 09:31:56 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mtkennerly";
|
|
|
|
repo = "dunamai";
|
2022-05-18 14:49:53 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-oLJlBytdp9uVdKEdYDMz/IYnPP7XVnCUcThKO3IiW10=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
packaging
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
|
|
|
|
|
|
|
# needs to be able to run dunami from PATH
|
|
|
|
preCheck = ''
|
|
|
|
export PATH=$PATH:$out/bin
|
2023-01-20 10:41:00 +00:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
|
|
|
|
git config --global user.email "nobody@example.com"
|
|
|
|
git config --global user.name "Nobody"
|
2022-03-30 09:31:56 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-20 10:41:00 +00:00
|
|
|
git
|
2022-03-30 09:31:56 +00:00
|
|
|
pytestCheckHook
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# clones from github.com
|
|
|
|
"test__version__from_git__shallow"
|
2022-03-30 09:31:56 +00:00
|
|
|
];
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"dunamai"
|
|
|
|
];
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Dynamic version generation";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "dunamai";
|
2022-03-30 09:31:56 +00:00
|
|
|
homepage = "https://github.com/mtkennerly/dunamai";
|
2023-02-22 10:55:15 +00:00
|
|
|
changelog = "https://github.com/mtkennerly/dunamai/blob/v${version}/CHANGELOG.md";
|
2022-03-30 09:31:56 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jmgilman ];
|
|
|
|
};
|
|
|
|
}
|