12 python3.pkgs.buildPythonApplication rec {
17 disabled = python3.pythonOlder "3.8";
19 src = fetchFromGitHub {
20 owner = "commitizen-tools";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-Gzx2DdCX8GyxYEi8OH2a21V6JkA50qA+39IInEjLReI=";
30 nativeBuildInputs = with python3.pkgs; [
36 propagatedBuildInputs = with python3.pkgs; [
50 nativeCheckInputs = with python3.pkgs; [
63 # The tests require a functional git installation
64 # which requires a valid HOME directory.
66 export HOME="$(mktemp -d)"
68 git config --global user.name "Nix Builder"
69 git config --global user.email "nix-builder@nixos.org"
73 # NB: These tests require complex GnuPG setup
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 # fatal: not a git repository (or any of the parent directories): .git
83 "test_commitizen_debug_excepthook"
88 argcomplete = lib.getExe' python3.pkgs.argcomplete "register-python-argcomplete";
90 lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform)
92 installShellCompletion --cmd cz \
93 --bash <(${argcomplete} --shell bash $out/bin/cz) \
94 --zsh <(${argcomplete} --shell zsh $out/bin/cz) \
95 --fish <(${argcomplete} --shell fish $out/bin/cz)
99 updateScript = nix-update-script { };
100 tests.version = testers.testVersion {
101 package = commitizen;
102 command = "cz version";
107 description = "Tool to create committing rules for projects, auto bump versions, and generate changelogs";
108 homepage = "https://github.com/commitizen-tools/commitizen";
109 changelog = "https://github.com/commitizen-tools/commitizen/blob/v${version}/CHANGELOG.md";
110 license = licenses.mit;
112 maintainers = with maintainers; [ lovesegfault anthonyroussel ];