1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pytestCheckHook,
6 pythonOlder,
7 git,
8 hatchling,
9 setuptools-scm,
10}:
11
12buildPythonPackage rec {
13 pname = "hatch-vcs";
14 version = "0.4.0";
15 format = "pyproject";
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchPypi {
20 pname = "hatch_vcs";
21 inherit version;
22 hash = "sha256-CTgQdI/gHbDUUfq88sGsJojK79Iy1O3pZwkLHBsH2fc=";
23 };
24
25 nativeBuildInputs = [ hatchling ];
26
27 propagatedBuildInputs = [
28 hatchling
29 setuptools-scm
30 ];
31
32 nativeCheckInputs = [
33 git
34 pytestCheckHook
35 ];
36
37 disabledTests =
38 [
39 # incompatible with setuptools-scm>=7
40 # https://github.com/ofek/hatch-vcs/issues/8
41 "test_write"
42 ]
43 ++ lib.optionals (pythonOlder "3.11") [
44 # https://github.com/pypa/setuptools_scm/issues/1038, fixed in setuptools_scm@8.1.0
45 "test_basic"
46 "test_root"
47 "test_metadata"
48 ];
49
50 pythonImportsCheck = [ "hatch_vcs" ];
51
52 meta = with lib; {
53 changelog = "https://github.com/ofek/hatch-vcs/releases/tag/v${version}";
54 description = "Plugin for Hatch that uses your preferred version control system (like Git) to determine project versions";
55 homepage = "https://github.com/ofek/hatch-vcs";
56 license = licenses.mit;
57 maintainers = with maintainers; [ cpcloud ];
58 };
59}