2022-03-18 21:50:59 +00:00
|
|
|
{ lib
|
|
|
|
, poetry-core
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, importlib-metadata
|
|
|
|
, packaging
|
|
|
|
, pytestCheckHook
|
2022-09-16 17:21:48 +00:00
|
|
|
, setuptools
|
2022-12-30 19:13:08 +00:00
|
|
|
, git
|
2022-03-18 21:50:59 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dunamai";
|
2023-02-21 10:57:15 +00:00
|
|
|
version = "1.16.0";
|
2022-03-18 21:50:59 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mtkennerly";
|
|
|
|
repo = "dunamai";
|
2022-05-07 12:58:03 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-02-21 12:28:41 +00:00
|
|
|
hash = "sha256-pPUn+1rv76N/7WVDyWJLPVMweJ1Qbx6/P4zIKU06hSs=";
|
2022-03-18 21:50:59 +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
|
2022-12-30 19:13:08 +00:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
|
|
|
|
git config --global user.email "nobody@example.com"
|
|
|
|
git config --global user.name "Nobody"
|
2022-03-18 21:50:59 +00:00
|
|
|
'';
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-30 19:13:08 +00:00
|
|
|
git
|
2022-03-18 21:50:59 +00:00
|
|
|
pytestCheckHook
|
2022-09-16 17:21:48 +00:00
|
|
|
setuptools
|
2022-03-18 21:50:59 +00:00
|
|
|
];
|
|
|
|
|
2023-02-21 12:28:41 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"dunamai"
|
|
|
|
];
|
2022-03-18 21:50:59 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Dynamic version generation";
|
|
|
|
homepage = "https://github.com/mtkennerly/dunamai";
|
2023-02-21 12:28:41 +00:00
|
|
|
changelog = "https://github.com/mtkennerly/dunamai/blob/v${version}/CHANGELOG.md";
|
2022-03-18 21:50:59 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jmgilman ];
|
|
|
|
};
|
|
|
|
}
|