Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ buildPythonApplication
2, colorama
3, decli
4, fetchFromGitHub
5, git
6, jinja2
7, lib
8, packaging
9, poetry-core
10, pytest-freezegun
11, pytest-mock
12, pytest-regressions
13, pytestCheckHook
14, pyyaml
15, questionary
16, termcolor
17, tomlkit
18, typing-extensions
19, argcomplete
20, nix-update-script
21}:
22
23buildPythonApplication rec {
24 pname = "commitizen";
25 version = "2.37.0";
26
27 src = fetchFromGitHub {
28 owner = "commitizen-tools";
29 repo = pname;
30 rev = "v${version}";
31 hash = "sha256-wo1I6QDWLxByHISmkPdass+BcKh0oxR5hD31UN/5+WQ=";
32 deepClone = true;
33 };
34
35 format = "pyproject";
36
37 nativeBuildInputs = [ poetry-core ];
38
39 propagatedBuildInputs = [
40 termcolor
41 questionary
42 colorama
43 decli
44 tomlkit
45 jinja2
46 pyyaml
47 argcomplete
48 typing-extensions
49 packaging
50 ];
51
52 doCheck = true;
53
54 checkInputs = [
55 pytestCheckHook
56 pytest-freezegun
57 pytest-mock
58 pytest-regressions
59 argcomplete
60 git
61 ];
62
63 # the tests require a functional git installation
64 # which requires a valid HOME directory.
65 preCheck = ''
66 export HOME="$(mktemp -d)"
67
68 git config --global user.name "Nix Builder"
69 git config --global user.email "nix-builder@nixos.org"
70 git init .
71 '';
72
73 # NB: These tests require complex GnuPG setup
74 disabledTests = [
75 "test_bump_minor_increment_signed"
76 "test_bump_minor_increment_signed_config_file"
77 "test_bump_on_git_with_hooks_no_verify_enabled"
78 "test_bump_on_git_with_hooks_no_verify_disabled"
79 "test_bump_pre_commit_changelog"
80 "test_bump_pre_commit_changelog_fails_always"
81 "test_get_commits_with_signature"
82 ];
83
84 passthru.updateScript = nix-update-script { };
85
86 meta = with lib; {
87 description = "Tool to create committing rules for projects, auto bump versions, and generate changelogs";
88 homepage = "https://github.com/commitizen-tools/commitizen";
89 changelog = "https://github.com/commitizen-tools/commitizen/blob/v${version}/CHANGELOG.md";
90 license = licenses.mit;
91 maintainers = with maintainers; [ lovesegfault anthonyroussel ];
92 };
93}