commitizen 3.19.0__tar.gz → 3.21.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {commitizen-3.19.0 → commitizen-3.21.0}/PKG-INFO +1 -1
- commitizen-3.21.0/commitizen/__version__.py +1 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/changelog.py +6 -1
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cli.py +6 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/commit.py +16 -8
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/utils.py +15 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/defaults.py +2 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/pyproject.toml +3 -3
- {commitizen-3.19.0 → commitizen-3.21.0}/setup.py +1 -1
- commitizen-3.19.0/commitizen/__version__.py +0 -1
- {commitizen-3.19.0 → commitizen-3.21.0}/LICENSE +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/__main__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/bump.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/changelog_formats/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/changelog_formats/asciidoc.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/changelog_formats/base.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/changelog_formats/markdown.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/changelog_formats/restructuredtext.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/changelog_formats/textile.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cmd.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/bump.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/changelog.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/check.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/example.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/info.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/init.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/list_cz.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/schema.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/commands/version.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/config/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/config/base_config.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/config/json_config.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/config/toml_config.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/config/yaml_config.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/base.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/conventional_commits/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/conventional_commits/conventional_commits.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/conventional_commits/conventional_commits_info.txt +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/customize/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/customize/customize.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/customize/customize_info.txt +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/exceptions.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/jira/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/jira/jira.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/jira/jira_info.txt +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/exceptions.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/factory.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/git.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/hooks.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/out.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/__init__.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/base_provider.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/cargo_provider.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/commitizen_provider.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/composer_provider.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/npm_provider.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/pep621_provider.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/poetry_provider.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/providers/scm_provider.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/templates/CHANGELOG.adoc.j2 +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/templates/CHANGELOG.md.j2 +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/templates/CHANGELOG.rst.j2 +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/templates/CHANGELOG.textile.j2 +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/commitizen/version_schemes.py +0 -0
- {commitizen-3.19.0 → commitizen-3.21.0}/docs/README.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "3.21.0"
|
|
@@ -200,7 +200,12 @@ def process_commit_message(
|
|
|
200
200
|
changes: dict[str | None, list],
|
|
201
201
|
change_type_map: dict[str, str] | None = None,
|
|
202
202
|
):
|
|
203
|
-
message: dict =
|
|
203
|
+
message: dict = {
|
|
204
|
+
"sha1": commit.rev,
|
|
205
|
+
"author": commit.author,
|
|
206
|
+
"author_email": commit.author_email,
|
|
207
|
+
**parsed.groupdict(),
|
|
208
|
+
}
|
|
204
209
|
|
|
205
210
|
if processed := hook(message, commit) if hook else message:
|
|
206
211
|
messages = [processed] if isinstance(processed, dict) else processed
|
|
@@ -123,6 +123,12 @@ data = {
|
|
|
123
123
|
"action": "store_true",
|
|
124
124
|
"help": "retry last commit",
|
|
125
125
|
},
|
|
126
|
+
{
|
|
127
|
+
"name": ["--no-retry"],
|
|
128
|
+
"action": "store_true",
|
|
129
|
+
"default": False,
|
|
130
|
+
"help": "skip retry if retry_after_failure is set to true",
|
|
131
|
+
},
|
|
126
132
|
{
|
|
127
133
|
"name": "--dry-run",
|
|
128
134
|
"action": "store_true",
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import contextlib
|
|
2
4
|
import os
|
|
3
|
-
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
import questionary
|
|
6
8
|
|
|
7
9
|
from commitizen import factory, git, out
|
|
8
10
|
from commitizen.config import BaseConfig
|
|
9
11
|
from commitizen.cz.exceptions import CzException
|
|
12
|
+
from commitizen.cz.utils import get_backup_file_path
|
|
10
13
|
from commitizen.exceptions import (
|
|
11
14
|
CommitError,
|
|
12
15
|
CustomError,
|
|
@@ -31,15 +34,12 @@ class Commit:
|
|
|
31
34
|
self.encoding = config.settings["encoding"]
|
|
32
35
|
self.cz = factory.commiter_factory(self.config)
|
|
33
36
|
self.arguments = arguments
|
|
34
|
-
self.temp_file: str =
|
|
35
|
-
tempfile.gettempdir(),
|
|
36
|
-
"cz.commit{user}.backup".format(user=os.environ.get("USER", "")),
|
|
37
|
-
)
|
|
37
|
+
self.temp_file: str = get_backup_file_path()
|
|
38
38
|
|
|
39
|
-
def read_backup_message(self) -> str:
|
|
39
|
+
def read_backup_message(self) -> str | None:
|
|
40
40
|
# Check the commit backup file exists
|
|
41
41
|
if not os.path.isfile(self.temp_file):
|
|
42
|
-
|
|
42
|
+
return None
|
|
43
43
|
|
|
44
44
|
# Read commit message from backup
|
|
45
45
|
with open(self.temp_file, encoding=self.encoding) as f:
|
|
@@ -65,7 +65,7 @@ class Commit:
|
|
|
65
65
|
|
|
66
66
|
def __call__(self):
|
|
67
67
|
dry_run: bool = self.arguments.get("dry_run")
|
|
68
|
-
write_message_to_file = self.arguments.get("write_message_to_file")
|
|
68
|
+
write_message_to_file: bool = self.arguments.get("write_message_to_file")
|
|
69
69
|
|
|
70
70
|
is_all: bool = self.arguments.get("all")
|
|
71
71
|
if is_all:
|
|
@@ -78,9 +78,17 @@ class Commit:
|
|
|
78
78
|
raise NotAllowed(f"{write_message_to_file} is a directory")
|
|
79
79
|
|
|
80
80
|
retry: bool = self.arguments.get("retry")
|
|
81
|
+
no_retry: bool = self.arguments.get("no_retry")
|
|
82
|
+
retry_after_failure: bool = self.config.settings.get("retry_after_failure")
|
|
81
83
|
|
|
82
84
|
if retry:
|
|
83
85
|
m = self.read_backup_message()
|
|
86
|
+
if m is None:
|
|
87
|
+
raise NoCommitBackupError()
|
|
88
|
+
elif retry_after_failure and not no_retry:
|
|
89
|
+
m = self.read_backup_message()
|
|
90
|
+
if m is None:
|
|
91
|
+
m = self.prompt_commit_questions()
|
|
84
92
|
else:
|
|
85
93
|
m = self.prompt_commit_questions()
|
|
86
94
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import re
|
|
2
|
+
import os
|
|
3
|
+
import tempfile
|
|
2
4
|
|
|
3
5
|
from commitizen.cz import exceptions
|
|
6
|
+
from commitizen import git
|
|
4
7
|
|
|
5
8
|
|
|
6
9
|
def required_validator(answer, msg=None):
|
|
@@ -15,3 +18,15 @@ def multiple_line_breaker(answer, sep="|"):
|
|
|
15
18
|
|
|
16
19
|
def strip_local_version(version: str) -> str:
|
|
17
20
|
return re.sub(r"\+.+", "", version)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def get_backup_file_path() -> str:
|
|
24
|
+
project_root = git.find_git_project_root()
|
|
25
|
+
|
|
26
|
+
if project_root is None:
|
|
27
|
+
project = ""
|
|
28
|
+
else:
|
|
29
|
+
project = project_root.as_posix().replace("/", "%")
|
|
30
|
+
|
|
31
|
+
user = os.environ.get("USER", "")
|
|
32
|
+
return os.path.join(tempfile.gettempdir(), f"cz.commit%{user}%{project}.backup")
|
|
@@ -37,6 +37,7 @@ class Settings(TypedDict, total=False):
|
|
|
37
37
|
version_type: str | None
|
|
38
38
|
tag_format: str
|
|
39
39
|
bump_message: str | None
|
|
40
|
+
retry_after_failure: bool
|
|
40
41
|
allow_abort: bool
|
|
41
42
|
allowed_prefixes: list[str]
|
|
42
43
|
changelog_file: str
|
|
@@ -77,6 +78,7 @@ DEFAULT_SETTINGS: Settings = {
|
|
|
77
78
|
"version_scheme": None,
|
|
78
79
|
"tag_format": "$version", # example v$version
|
|
79
80
|
"bump_message": None, # bumped v$current_version to $new_version
|
|
81
|
+
"retry_after_failure": False,
|
|
80
82
|
"allow_abort": False,
|
|
81
83
|
"allowed_prefixes": [
|
|
82
84
|
"Merge",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[tool.commitizen]
|
|
2
|
-
version = "3.
|
|
2
|
+
version = "3.21.0"
|
|
3
3
|
tag_format = "v$version"
|
|
4
4
|
version_files = [
|
|
5
5
|
"pyproject.toml:version",
|
|
@@ -9,7 +9,7 @@ version_files = [
|
|
|
9
9
|
|
|
10
10
|
[tool.poetry]
|
|
11
11
|
name = "commitizen"
|
|
12
|
-
version = "3.
|
|
12
|
+
version = "3.21.0"
|
|
13
13
|
description = "Python commitizen client tool"
|
|
14
14
|
authors = ["Santiago Fraire <santiwilly@gmail.com>"]
|
|
15
15
|
license = "MIT"
|
|
@@ -54,7 +54,7 @@ importlib_metadata = { version = ">=4.13,<8"}
|
|
|
54
54
|
ipython = "^8.0"
|
|
55
55
|
# test
|
|
56
56
|
pytest = ">=7.2,<9.0"
|
|
57
|
-
pytest-cov = "
|
|
57
|
+
pytest-cov = ">=4,<6"
|
|
58
58
|
pytest-mock = "^3.10"
|
|
59
59
|
pytest-regressions = "^2.4.0"
|
|
60
60
|
pytest-freezer = "^0.4.6"
|
|
@@ -59,7 +59,7 @@ entry_points = \
|
|
|
59
59
|
|
|
60
60
|
setup_kwargs = {
|
|
61
61
|
'name': 'commitizen',
|
|
62
|
-
'version': '3.
|
|
62
|
+
'version': '3.21.0',
|
|
63
63
|
'description': 'Python commitizen client tool',
|
|
64
64
|
'long_description': '[](https://github.com/commitizen-tools/commitizen/actions)\n[](https://conventionalcommits.org)\n[](https://pypi.org/project/commitizen/)\n[](https://pypi.org/project/commitizen/)\n[](https://pypi.org/project/commitizen/)\n[](https://formulae.brew.sh/formula/commitizen)\n[](https://codecov.io/gh/commitizen-tools/commitizen)\n[](https://github.com/pre-commit/pre-commit)\n\n\n\n---\n\n**Documentation:** [https://commitizen-tools.github.io/commitizen/](https://commitizen-tools.github.io/commitizen/)\n\n---\n\n## About\n\nCommitizen is release management tool designed for teams.\n\nCommitizen assumes your team uses a standard way of committing rules\nand from that foundation, it can bump your project\'s version, create\nthe changelog, and update files.\n\nBy default, commitizen uses [conventional commits][conventional_commits], but you\ncan build your own set of rules, and publish them.\n\nUsing a standardized set of rules to write commits, makes commits easier to read, and enforces writing\ndescriptive commits.\n\n### Features\n\n- Command-line utility to create commits with your rules. Defaults: [Conventional commits][conventional_commits]\n- Bump version automatically using [semantic versioning][semver] based on the commits. [Read More](./bump.md)\n- Generate a changelog using [Keep a changelog][keepchangelog]\n- Update your project\'s version files automatically\n- Display information about your commit rules (commands: schema, example, info)\n- Create your own set of rules and publish them to pip. Read more on [Customization](./customization.md)\n\n## Requirements\n\n[Python](https://www.python.org/downloads/) `3.8+`\n\n[Git][gitscm] `1.8.5.2+`\n\n## Installation\n\nTo make commitizen available in your system\n\n```bash\npip install --user -U Commitizen\n```\n\n### Python project\n\nYou can add it to your local project using one of these:\n\n```bash\npip install -U commitizen\n```\n\nfor Poetry >= 1.2.0:\n\n```bash\npoetry add commitizen --group dev\n```\n\nfor Poetry < 1.2.0:\n\n```bash\npoetry add commitizen --dev\n```\n\n### macOS\n\nvia [homebrew](https://formulae.brew.sh/formula/commitizen):\n\n```bash\nbrew install commitizen\n```\n\n## Usage\n\nMost of the time this is the only command you\'ll run:\n\n```sh\ncz bump\n```\n\nOn top of that, you can use commitizen to assist you with the creation of commits:\n\n```sh\ncz commit\n```\n\nRead more in the section [Getting Started](./getting_started.md).\n\n### Help\n\n```sh\n$ cz --help\nusage: cz [-h] [--debug] [-n NAME] [-nr NO_RAISE] {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version} ...\n\nCommitizen is a cli tool to generate conventional commits.\nFor more information about the topic go to https://conventionalcommits.org/\n\noptional arguments:\n -h, --help show this help message and exit\n --debug use debug mode\n -n NAME, --name NAME use the given commitizen (default: cz_conventional_commits)\n -nr NO_RAISE, --no-raise NO_RAISE\n comma separated error codes that won\'t rise error, e.g: cz -nr 1,2,3 bump. See codes at https://commitizen-\n tools.github.io/commitizen/exit_codes/\n\ncommands:\n {init,commit,c,ls,example,info,schema,bump,changelog,ch,check,version}\n init init commitizen configuration\n commit (c) create new commit\n ls show available commitizens\n example show commit example\n info show information about the cz\n schema show commit schema\n bump bump semantic version based on the git log\n changelog (ch) generate changelog (note that it will overwrite existing file)\n check validates that a commit message matches the commitizen schema\n version get the version of the installed commitizen or the current project (default: installed commitizen)\n```\n\n## Setting up bash completion\n\nWhen using bash as your shell (limited support for zsh, fish, and tcsh is available), Commitizen can use [argcomplete](https://kislyuk.github.io/argcomplete/) for auto-completion. For this argcomplete needs to be enabled.\n\nargcomplete is installed when you install Commitizen since it\'s a dependency.\n\nIf Commitizen is installed globally, global activation can be executed:\n\n```bash\nsudo activate-global-python-argcomplete\n```\n\nFor permanent (but not global) Commitizen activation, use:\n\n```bash\nregister-python-argcomplete cz >> ~/.bashrc\n```\n\nFor one-time activation of argcomplete for Commitizen only, use:\n\n```bash\neval "$(register-python-argcomplete cz)"\n```\n\nFor further information on activation, please visit the [argcomplete website](https://kislyuk.github.io/argcomplete/).\n\n## Sponsors\n\nThese are our cool sponsors!\n\n<!-- sponsors --><!-- sponsors -->\n\n[conventional_commits]: https://www.conventionalcommits.org\n[semver]: https://semver.org/\n[keepchangelog]: https://keepachangelog.com/\n[gitscm]: https://git-scm.com/downloads\n',
|
|
65
65
|
'author': 'Santiago Fraire',
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "3.19.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{commitizen-3.19.0 → commitizen-3.21.0}/commitizen/cz/conventional_commits/conventional_commits.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|