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