70 lines
1.3 KiB
Nix
70 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
|
|
# build-system
|
|
hatchling,
|
|
|
|
# dependencies
|
|
dunamai,
|
|
jinja2,
|
|
tomlkit,
|
|
|
|
# tests
|
|
gitpython,
|
|
pytestCheckHook,
|
|
writableTmpDirAsHomeHook,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "uv-dynamic-versioning";
|
|
version = "0.11.2";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ninoseki";
|
|
repo = "uv-dynamic-versioning";
|
|
tag = "v${version}";
|
|
# Tests perform mock operations on the local repo
|
|
leaveDotGit = true;
|
|
hash = "sha256-KB5EhXXQfaxAWM3DpkRxpBbelJc25btTtTppSn38b3o=";
|
|
};
|
|
|
|
build-system = [
|
|
hatchling
|
|
];
|
|
|
|
dependencies = [
|
|
dunamai
|
|
hatchling
|
|
jinja2
|
|
tomlkit
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"uv_dynamic_versioning"
|
|
];
|
|
|
|
preCheck = ''
|
|
git config --global user.email "nobody@example.com"
|
|
git config --global user.name "Nobody"
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
gitpython
|
|
pytestCheckHook
|
|
writableTmpDirAsHomeHook
|
|
];
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
meta = {
|
|
description = "Dynamic versioning based on VCS tags for uv/hatch project";
|
|
homepage = "https://github.com/ninoseki/uv-dynamic-versioning";
|
|
changelog = "https://github.com/ninoseki/uv-dynamic-versioning/releases/tag/v${version}";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ GaetanLepage ];
|
|
};
|
|
}
|