1{
2 lib,
3 buildPythonPackage,
4 entrypoints,
5 fastentrypoints,
6 fetchFromGitHub,
7 freezegun,
8 funcy,
9 git,
10 pydantic,
11 pytest-mock,
12 pytest-test-utils,
13 pytestCheckHook,
14 pythonOlder,
15 rich,
16 ruamel-yaml,
17 scmrepo,
18 semver,
19 setuptools,
20 setuptools-scm,
21 tabulate,
22 typer,
23}:
24
25buildPythonPackage rec {
26 pname = "gto";
27 version = "1.7.1";
28 pyproject = true;
29
30 disabled = pythonOlder "3.8";
31
32 src = fetchFromGitHub {
33 owner = "iterative";
34 repo = "gto";
35 rev = "refs/tags/${version}";
36 hash = "sha256-fUi+/PW05EvgTnoEv1Im1BjZ07VzpZhyW0EjhLUqJGI=";
37 };
38
39 postPatch = ''
40 substituteInPlace pyproject.toml \
41 --replace-fail ', "setuptools_scm_git_archive==1.4.1"' ""
42 substituteInPlace setup.cfg \
43 --replace-fail " --cov=gto --cov-report=term-missing --cov-report=xml" ""
44 '';
45
46 nativeBuildInputs = [
47 fastentrypoints
48 setuptools
49 setuptools-scm
50 ];
51
52 propagatedBuildInputs = [
53 entrypoints
54 funcy
55 pydantic
56 rich
57 ruamel-yaml
58 scmrepo
59 semver
60 tabulate
61 typer
62 ];
63
64 nativeCheckInputs = [
65 freezegun
66 git
67 pytest-mock
68 pytest-test-utils
69 pytestCheckHook
70 ];
71
72 preCheck = ''
73 export HOME=$(mktemp -d)
74
75 git config --global user.email "nobody@example.com"
76 git config --global user.name "Nobody"
77 '';
78
79 disabledTests = [
80 # Tests want to with a remote repo
81 "remote_repo"
82 "remote_git_repo"
83 "test_action_doesnt_push_even_if_repo_has_remotes_set"
84 ];
85
86 pythonImportsCheck = [ "gto" ];
87
88 meta = with lib; {
89 description = "Module for Git Tag Operations";
90 homepage = "https://github.com/iterative/gto";
91 changelog = "https://github.com/iterative/gto/releases/tag/${version}";
92 license = licenses.asl20;
93 maintainers = with maintainers; [ fab ];
94 mainProgram = "gto";
95 };
96}