32 buildPythonPackage rec {
37 disabled = pythonOlder "3.8";
39 src = fetchFromGitHub {
40 owner = "commitizen-tools";
42 rev = "refs/tags/v${version}";
43 hash = "sha256-8ULIoFKrDAGHwz0EZzYJtl/4h6UVUECLUDbvTJbdD60=";
51 build-system = [ poetry-core ];
53 nativeBuildInputs = [ installShellFiles ];
80 pythonImportsCheck = [ "commitizen" ];
82 # The tests require a functional git installation
83 # which requires a valid HOME directory.
85 export HOME="$(mktemp -d)"
87 git config --global user.name "Nix Builder"
88 git config --global user.email "nix-builder@nixos.org"
92 # NB: These tests require complex GnuPG setup
94 "test_bump_minor_increment_signed"
95 "test_bump_minor_increment_signed_config_file"
96 "test_bump_on_git_with_hooks_no_verify_enabled"
97 "test_bump_on_git_with_hooks_no_verify_disabled"
98 "test_bump_pre_commit_changelog"
99 "test_bump_pre_commit_changelog_fails_always"
100 "test_get_commits_with_signature"
101 # fatal: not a git repository (or any of the parent directories): .git
102 "test_commitizen_debug_excepthook"
107 register-python-argcomplete = lib.getExe' argcomplete "register-python-argcomplete";
109 lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
110 installShellCompletion --cmd cz \
111 --bash <(${register-python-argcomplete} --shell bash $out/bin/cz) \
112 --zsh <(${register-python-argcomplete} --shell zsh $out/bin/cz) \
113 --fish <(${register-python-argcomplete} --shell fish $out/bin/cz)
117 updateScript = nix-update-script { };
118 tests.version = testers.testVersion {
119 package = commitizen;
120 command = "cz version";
125 description = "Tool to create committing rules for projects, auto bump versions, and generate changelogs";
126 homepage = "https://github.com/commitizen-tools/commitizen";
127 changelog = "https://github.com/commitizen-tools/commitizen/blob/v${version}/CHANGELOG.md";
128 license = licenses.mit;
130 maintainers = with maintainers; [