1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8
9 # dependencies
10 dunamai,
11 jinja2,
12 tomlkit,
13
14 # tests
15 gitpython,
16 pytestCheckHook,
17 writableTmpDirAsHomeHook,
18}:
19
20buildPythonPackage rec {
21 pname = "uv-dynamic-versioning";
22 version = "0.11.2";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "ninoseki";
27 repo = "uv-dynamic-versioning";
28 tag = "v${version}";
29 # Tests perform mock operations on the local repo
30 leaveDotGit = true;
31 hash = "sha256-KB5EhXXQfaxAWM3DpkRxpBbelJc25btTtTppSn38b3o=";
32 };
33
34 build-system = [
35 hatchling
36 ];
37
38 dependencies = [
39 dunamai
40 hatchling
41 jinja2
42 tomlkit
43 ];
44
45 pythonImportsCheck = [
46 "uv_dynamic_versioning"
47 ];
48
49 preCheck = ''
50 git config --global user.email "nobody@example.com"
51 git config --global user.name "Nobody"
52 '';
53
54 nativeCheckInputs = [
55 gitpython
56 pytestCheckHook
57 writableTmpDirAsHomeHook
58 ];
59
60 setupHook = ./setup-hook.sh;
61
62 meta = {
63 description = "Dynamic versioning based on VCS tags for uv/hatch project";
64 homepage = "https://github.com/ninoseki/uv-dynamic-versioning";
65 changelog = "https://github.com/ninoseki/uv-dynamic-versioning/releases/tag/v${version}";
66 license = lib.licenses.mit;
67 maintainers = with lib.maintainers; [ GaetanLepage ];
68 };
69}