1{
2 lib,
3 buildPythonPackage,
4 cacert,
5 entrypoints,
6 fetchFromGitHub,
7 freezegun,
8 funcy,
9 gitMinimal,
10 pydantic,
11 pydantic-settings,
12 pytest-cov-stub,
13 pytest-mock,
14 pytest-test-utils,
15 pytestCheckHook,
16 pythonOlder,
17 rich,
18 ruamel-yaml,
19 scmrepo,
20 semver,
21 setuptools-scm,
22 setuptools,
23 tabulate,
24 typer,
25}:
26
27buildPythonPackage rec {
28 pname = "gto";
29 version = "1.9.0";
30 pyproject = true;
31
32 disabled = pythonOlder "3.9";
33
34 src = fetchFromGitHub {
35 owner = "iterative";
36 repo = "gto";
37 tag = version;
38 hash = "sha256-LXYpOnk9W/ellG70qZLihmvk4kvVcwZfE5buPNU2qzQ=";
39 };
40
41 build-system = [
42 setuptools
43 setuptools-scm
44 ];
45
46 dependencies = [
47 entrypoints
48 funcy
49 pydantic
50 pydantic-settings
51 rich
52 ruamel-yaml
53 scmrepo
54 semver
55 tabulate
56 typer
57 ];
58
59 nativeCheckInputs = [
60 freezegun
61 gitMinimal
62 pytest-cov-stub
63 pytest-mock
64 pytest-test-utils
65 pytestCheckHook
66 ];
67
68 preCheck = ''
69 export HOME=$(mktemp -d)
70
71 git config --global user.email "nobody@example.com"
72 git config --global user.name "Nobody"
73
74 # _pygit2.GitError: OpenSSL error: failed to load certificates: error:00000000:lib(0)::reason(0)
75 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
76 '';
77
78 disabledTests = [
79 # Tests want to with a remote repo
80 "remote_repo"
81 "remote_git_repo"
82 "test_action_doesnt_push_even_if_repo_has_remotes_set"
83 # ValueError: stderr not separately captured
84 "test_register"
85 "test_assign"
86 "test_stderr_gto_exception"
87 "test_stderr_exception"
88 ];
89
90 pythonImportsCheck = [ "gto" ];
91
92 meta = with lib; {
93 description = "Module for Git Tag Operations";
94 homepage = "https://github.com/iterative/gto";
95 changelog = "https://github.com/iterative/gto/releases/tag/${src.tag}";
96 license = licenses.asl20;
97 maintainers = with maintainers; [ fab ];
98 mainProgram = "gto";
99 };
100}