commitizen 4.15.1__tar.gz → 4.16.1__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-4.15.1 → commitizen-4.16.1}/PKG-INFO +1 -1
- commitizen-4.16.1/commitizen/__version__.py +1 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cmd.py +40 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/customize/customize.py +29 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/hooks.py +2 -7
- {commitizen-4.15.1 → commitizen-4.16.1}/pyproject.toml +2 -2
- commitizen-4.15.1/commitizen/__version__.py +0 -1
- {commitizen-4.15.1 → commitizen-4.16.1}/LICENSE +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/__main__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/bump.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/changelog.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/changelog_formats/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/changelog_formats/asciidoc.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/changelog_formats/base.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/changelog_formats/markdown.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/changelog_formats/restructuredtext.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/changelog_formats/textile.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cli.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/bump.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/changelog.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/check.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/commit.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/example.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/info.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/init.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/list_cz.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/schema.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/commands/version.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/config/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/config/base_config.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/config/factory.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/config/json_config.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/config/toml_config.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/config/yaml_config.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/base.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/conventional_commits/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/conventional_commits/conventional_commits.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/conventional_commits/conventional_commits_info.txt +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/customize/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/customize/customize_info.txt +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/exceptions.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/jira/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/jira/jira.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/jira/jira_info.txt +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/cz/utils.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/defaults.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/exceptions.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/factory.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/git.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/out.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/project_info.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/__init__.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/base_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/cargo_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/commitizen_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/composer_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/npm_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/pep621_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/poetry_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/scm_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/providers/uv_provider.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/py.typed +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/question.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/tags.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/templates/CHANGELOG.adoc.j2 +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/templates/CHANGELOG.md.j2 +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/templates/CHANGELOG.rst.j2 +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/templates/CHANGELOG.textile.j2 +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/version_increment.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/commitizen/version_schemes.py +0 -0
- {commitizen-4.15.1 → commitizen-4.16.1}/docs/README.md +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "4.16.1"
|
|
@@ -103,3 +103,43 @@ def run_shell(cmd: str, env: Mapping[str, str] | None = None) -> Command:
|
|
|
103
103
|
https://github.com/commitizen-tools/commitizen/issues/1918
|
|
104
104
|
"""
|
|
105
105
|
return _popen(cmd, shell=True, env=env)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def run_interactive(
|
|
109
|
+
cmd: str | Sequence[str], env: Mapping[str, str] | None = None
|
|
110
|
+
) -> int:
|
|
111
|
+
"""Run a command safely without shell interpretation and without redirecting stdin, stdout, or stderr
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
cmd: The command to run
|
|
115
|
+
env: Extra environment variables to define in the subprocess. Defaults to None.
|
|
116
|
+
|
|
117
|
+
Returns:
|
|
118
|
+
subprocess returncode
|
|
119
|
+
"""
|
|
120
|
+
if env is not None:
|
|
121
|
+
env = {**os.environ, **env}
|
|
122
|
+
if isinstance(cmd, str):
|
|
123
|
+
warnings.warn(
|
|
124
|
+
"Passing a string to cmd.run_interactive() is deprecated and will be removed in v5. "
|
|
125
|
+
"Use a list of arguments instead, or use cmd.run_interactive_shell() explicitly.",
|
|
126
|
+
DeprecationWarning,
|
|
127
|
+
stacklevel=2,
|
|
128
|
+
)
|
|
129
|
+
return subprocess.run(cmd, shell=True, env=env).returncode
|
|
130
|
+
return subprocess.run(cmd, shell=False, env=env).returncode
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def run_interactive_shell(cmd: str, env: Mapping[str, str] | None = None) -> int:
|
|
134
|
+
"""Run a command without redirecting stdin, stdout, or stderr
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
cmd: The command to run
|
|
138
|
+
env: Extra environment variables to define in the subprocess. Defaults to None.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
subprocess returncode
|
|
142
|
+
"""
|
|
143
|
+
if env is not None:
|
|
144
|
+
env = {**os.environ, **env}
|
|
145
|
+
return subprocess.run(cmd, shell=True, env=env).returncode
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from collections import OrderedDict
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
from typing import TYPE_CHECKING, Any
|
|
5
6
|
|
|
@@ -19,11 +20,29 @@ else:
|
|
|
19
20
|
|
|
20
21
|
from commitizen import defaults
|
|
21
22
|
from commitizen.cz.base import BaseCommitizen
|
|
23
|
+
from commitizen.defaults import MAJOR, MINOR
|
|
22
24
|
from commitizen.exceptions import MissingCzCustomizeConfigError
|
|
23
25
|
|
|
24
26
|
__all__ = ["CustomizeCommitsCz"]
|
|
25
27
|
|
|
26
28
|
|
|
29
|
+
def _derive_major_version_zero(
|
|
30
|
+
bump_map: Mapping[str, str],
|
|
31
|
+
) -> OrderedDict[str, str]:
|
|
32
|
+
"""Derive a ``bump_map_major_version_zero`` from a user-supplied
|
|
33
|
+
``bump_map`` by demoting any ``MAJOR`` rule to ``MINOR``.
|
|
34
|
+
|
|
35
|
+
See #1728: when a ``cz_customize`` user supplies ``bump_map`` but not
|
|
36
|
+
``bump_map_major_version_zero``, the latter previously fell through to
|
|
37
|
+
``defaults.BUMP_MAP_MAJOR_VERSION_ZERO``, silently overriding the
|
|
38
|
+
user's intent during ``major_version_zero = true`` bumps.
|
|
39
|
+
"""
|
|
40
|
+
return OrderedDict(
|
|
41
|
+
(pattern, MINOR if increment == MAJOR else increment)
|
|
42
|
+
for pattern, increment in bump_map.items()
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
27
46
|
class CustomizeCommitsCz(BaseCommitizen):
|
|
28
47
|
bump_pattern = defaults.BUMP_PATTERN
|
|
29
48
|
bump_map = defaults.BUMP_MAP
|
|
@@ -49,6 +68,16 @@ class CustomizeCommitsCz(BaseCommitizen):
|
|
|
49
68
|
if value := self.custom_settings.get(attr_name):
|
|
50
69
|
setattr(self, attr_name, value)
|
|
51
70
|
|
|
71
|
+
# When the user supplies a custom ``bump_map`` but no matching
|
|
72
|
+
# ``bump_map_major_version_zero``, derive the latter so that bumps
|
|
73
|
+
# under ``major_version_zero = true`` use the user's mapping rather
|
|
74
|
+
# than the (totally unrelated) ``defaults.BUMP_MAP_MAJOR_VERSION_ZERO``
|
|
75
|
+
# fallback. See #1728.
|
|
76
|
+
if self.custom_settings.get("bump_map") and not self.custom_settings.get(
|
|
77
|
+
"bump_map_major_version_zero"
|
|
78
|
+
):
|
|
79
|
+
self.bump_map_major_version_zero = _derive_major_version_zero(self.bump_map)
|
|
80
|
+
|
|
52
81
|
def questions(self) -> list[CzQuestion]:
|
|
53
82
|
return self.custom_settings.get("questions", [{}]) # type: ignore[return-value]
|
|
54
83
|
|
|
@@ -17,14 +17,9 @@ def run(hooks: str | list[str], _env_prefix: str = "CZ_", **env: object) -> None
|
|
|
17
17
|
for hook in hooks:
|
|
18
18
|
out.info(f"Running hook '{hook}'")
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
return_code = cmd.run_interactive(hook, env=_format_env(_env_prefix, env))
|
|
21
21
|
|
|
22
|
-
if
|
|
23
|
-
out.write(c.out)
|
|
24
|
-
if c.err:
|
|
25
|
-
out.error(c.err)
|
|
26
|
-
|
|
27
|
-
if c.return_code != 0:
|
|
22
|
+
if return_code != 0:
|
|
28
23
|
raise RunHookError(f"Running hook '{hook}' failed")
|
|
29
24
|
|
|
30
25
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "commitizen"
|
|
3
|
-
version = "4.
|
|
3
|
+
version = "4.16.1"
|
|
4
4
|
description = "Python commitizen client tool"
|
|
5
5
|
authors = [{ name = "Santiago Fraire", email = "santiwilly@gmail.com" }]
|
|
6
6
|
maintainers = [
|
|
@@ -97,7 +97,7 @@ dev = [
|
|
|
97
97
|
"tox-uv",
|
|
98
98
|
]
|
|
99
99
|
|
|
100
|
-
base = ["poethepoet>=0.34.0"]
|
|
100
|
+
base = ["mkdocs-llmstxt>=0.5.0", "poethepoet>=0.34.0"]
|
|
101
101
|
|
|
102
102
|
test = [
|
|
103
103
|
"pytest>=9",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "4.15.1"
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{commitizen-4.15.1 → commitizen-4.16.1}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|