2022-01-03 19:48:50 +00:00
|
|
|
{ buildPythonApplication
|
2023-03-13 10:20:16 +00:00
|
|
|
, charset-normalizer
|
2022-01-03 19:48:50 +00:00
|
|
|
, colorama
|
2023-01-14 21:20:04 +00:00
|
|
|
, commitizen
|
2022-01-03 19:48:50 +00:00
|
|
|
, decli
|
2022-02-22 19:27:30 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
2022-01-03 19:48:50 +00:00
|
|
|
, jinja2
|
2022-02-22 19:27:30 +00:00
|
|
|
, lib
|
2022-01-26 07:25:23 +00:00
|
|
|
, packaging
|
2022-11-29 05:18:28 +00:00
|
|
|
, poetry-core
|
2023-01-03 05:23:22 +00:00
|
|
|
, py
|
2023-01-14 21:20:04 +00:00
|
|
|
, pytest-freezer
|
2022-01-26 07:25:38 +00:00
|
|
|
, pytest-mock
|
|
|
|
, pytest-regressions
|
2022-02-22 19:27:30 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pyyaml
|
|
|
|
, questionary
|
|
|
|
, termcolor
|
2023-01-14 21:20:04 +00:00
|
|
|
, testers
|
2022-02-22 19:27:30 +00:00
|
|
|
, tomlkit
|
|
|
|
, typing-extensions
|
2022-09-30 22:14:21 +00:00
|
|
|
, argcomplete
|
2022-10-28 20:20:06 +00:00
|
|
|
, nix-update-script
|
2022-12-16 22:17:11 +00:00
|
|
|
, pre-commit
|
2022-01-03 19:48:50 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "commitizen";
|
2023-02-27 05:16:58 +00:00
|
|
|
version = "2.42.1";
|
2022-01-03 19:48:50 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "commitizen-tools";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-27 05:16:58 +00:00
|
|
|
hash = "sha256-lrZfMqmslwx3B2WkvFosm3EmCHgpZEA/fOzR6UYf6f8=";
|
2022-01-03 19:48:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
format = "pyproject";
|
|
|
|
|
2022-11-29 05:18:28 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
2022-01-03 19:48:50 +00:00
|
|
|
|
2023-01-03 05:23:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
2023-03-13 10:20:16 +00:00
|
|
|
--replace 'charset-normalizer = "^2.1.0"' 'charset-normalizer = "*"' \
|
|
|
|
--replace 'argcomplete = ">=1.12.1,<2.1"' 'argcomplete = ">=1.12.1"'
|
2023-01-03 05:23:22 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-03 19:48:50 +00:00
|
|
|
propagatedBuildInputs = [
|
2023-03-13 10:20:16 +00:00
|
|
|
charset-normalizer
|
2022-01-03 19:48:50 +00:00
|
|
|
termcolor
|
|
|
|
questionary
|
|
|
|
colorama
|
|
|
|
decli
|
|
|
|
tomlkit
|
|
|
|
jinja2
|
|
|
|
pyyaml
|
2022-09-30 22:14:21 +00:00
|
|
|
argcomplete
|
2022-01-03 19:48:50 +00:00
|
|
|
typing-extensions
|
2022-01-26 07:25:23 +00:00
|
|
|
packaging
|
2022-01-03 19:48:50 +00:00
|
|
|
];
|
|
|
|
|
2022-01-26 07:25:38 +00:00
|
|
|
doCheck = true;
|
2022-09-30 22:14:21 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2022-12-16 22:17:11 +00:00
|
|
|
pre-commit
|
2023-01-03 05:23:22 +00:00
|
|
|
py
|
2022-01-26 07:25:38 +00:00
|
|
|
pytestCheckHook
|
2023-01-14 21:20:04 +00:00
|
|
|
pytest-freezer
|
2022-01-26 07:25:38 +00:00
|
|
|
pytest-mock
|
|
|
|
pytest-regressions
|
2022-09-30 22:14:21 +00:00
|
|
|
argcomplete
|
2022-01-26 07:25:38 +00:00
|
|
|
git
|
|
|
|
];
|
|
|
|
|
2022-09-30 22:14:21 +00:00
|
|
|
# the tests require a functional git installation
|
|
|
|
# which requires a valid HOME directory.
|
|
|
|
preCheck = ''
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
|
|
|
|
git config --global user.name "Nix Builder"
|
|
|
|
git config --global user.email "nix-builder@nixos.org"
|
|
|
|
git init .
|
|
|
|
'';
|
|
|
|
|
|
|
|
# NB: These tests require complex GnuPG setup
|
2022-01-26 07:25:38 +00:00
|
|
|
disabledTests = [
|
2022-09-30 22:14:21 +00:00
|
|
|
"test_bump_minor_increment_signed"
|
|
|
|
"test_bump_minor_increment_signed_config_file"
|
2022-01-26 07:25:38 +00:00
|
|
|
"test_bump_on_git_with_hooks_no_verify_enabled"
|
2022-09-30 22:14:21 +00:00
|
|
|
"test_bump_on_git_with_hooks_no_verify_disabled"
|
2022-07-29 17:55:47 +00:00
|
|
|
"test_bump_pre_commit_changelog"
|
|
|
|
"test_bump_pre_commit_changelog_fails_always"
|
2022-01-26 07:25:38 +00:00
|
|
|
"test_get_commits_with_signature"
|
2023-01-03 05:23:22 +00:00
|
|
|
# fatal: not a git repository (or any of the parent directories): .git
|
|
|
|
"test_commitizen_debug_excepthook"
|
2022-01-26 07:25:38 +00:00
|
|
|
];
|
|
|
|
|
2023-01-14 21:20:04 +00:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = commitizen;
|
|
|
|
command = "cz version";
|
|
|
|
};
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
2022-10-28 20:20:06 +00:00
|
|
|
|
2022-01-03 19:48:50 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Tool to create committing rules for projects, auto bump versions, and generate changelogs";
|
|
|
|
homepage = "https://github.com/commitizen-tools/commitizen";
|
2022-10-28 20:18:37 +00:00
|
|
|
changelog = "https://github.com/commitizen-tools/commitizen/blob/v${version}/CHANGELOG.md";
|
2022-01-03 19:48:50 +00:00
|
|
|
license = licenses.mit;
|
2022-09-30 22:14:06 +00:00
|
|
|
maintainers = with maintainers; [ lovesegfault anthonyroussel ];
|
2022-01-03 19:48:50 +00:00
|
|
|
};
|
|
|
|
}
|