commitizen 4.8.3__tar.gz → 4.8.4__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.
Files changed (72) hide show
  1. {commitizen-4.8.3 → commitizen-4.8.4}/PKG-INFO +5 -4
  2. commitizen-4.8.4/commitizen/__version__.py +1 -0
  3. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/defaults.py +5 -3
  4. commitizen-4.8.4/commitizen/providers/cargo_provider.py +94 -0
  5. {commitizen-4.8.3 → commitizen-4.8.4}/docs/README.md +2 -1
  6. {commitizen-4.8.3 → commitizen-4.8.4}/pyproject.toml +4 -4
  7. commitizen-4.8.3/commitizen/__version__.py +0 -1
  8. commitizen-4.8.3/commitizen/providers/cargo_provider.py +0 -57
  9. {commitizen-4.8.3 → commitizen-4.8.4}/LICENSE +0 -0
  10. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/__init__.py +0 -0
  11. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/__main__.py +0 -0
  12. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/bump.py +0 -0
  13. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/changelog.py +0 -0
  14. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/changelog_formats/__init__.py +0 -0
  15. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/changelog_formats/asciidoc.py +0 -0
  16. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/changelog_formats/base.py +0 -0
  17. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/changelog_formats/markdown.py +0 -0
  18. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/changelog_formats/restructuredtext.py +0 -0
  19. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/changelog_formats/textile.py +0 -0
  20. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cli.py +0 -0
  21. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cmd.py +0 -0
  22. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/__init__.py +0 -0
  23. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/bump.py +0 -0
  24. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/changelog.py +0 -0
  25. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/check.py +0 -0
  26. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/commit.py +0 -0
  27. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/example.py +0 -0
  28. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/info.py +0 -0
  29. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/init.py +0 -0
  30. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/list_cz.py +0 -0
  31. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/schema.py +0 -0
  32. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/commands/version.py +0 -0
  33. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/config/__init__.py +0 -0
  34. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/config/base_config.py +0 -0
  35. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/config/json_config.py +0 -0
  36. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/config/toml_config.py +0 -0
  37. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/config/yaml_config.py +0 -0
  38. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/__init__.py +0 -0
  39. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/base.py +0 -0
  40. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/conventional_commits/__init__.py +0 -0
  41. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/conventional_commits/conventional_commits.py +0 -0
  42. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/conventional_commits/conventional_commits_info.txt +0 -0
  43. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/customize/__init__.py +0 -0
  44. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/customize/customize.py +0 -0
  45. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/customize/customize_info.txt +0 -0
  46. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/exceptions.py +0 -0
  47. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/jira/__init__.py +0 -0
  48. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/jira/jira.py +0 -0
  49. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/jira/jira_info.txt +0 -0
  50. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/cz/utils.py +0 -0
  51. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/exceptions.py +0 -0
  52. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/factory.py +0 -0
  53. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/git.py +0 -0
  54. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/hooks.py +0 -0
  55. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/out.py +0 -0
  56. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/__init__.py +0 -0
  57. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/base_provider.py +0 -0
  58. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/commitizen_provider.py +0 -0
  59. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/composer_provider.py +0 -0
  60. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/npm_provider.py +0 -0
  61. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/pep621_provider.py +0 -0
  62. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/poetry_provider.py +0 -0
  63. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/scm_provider.py +0 -0
  64. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/providers/uv_provider.py +0 -0
  65. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/py.typed +0 -0
  66. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/question.py +0 -0
  67. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/tags.py +0 -0
  68. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/templates/CHANGELOG.adoc.j2 +0 -0
  69. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/templates/CHANGELOG.md.j2 +0 -0
  70. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/templates/CHANGELOG.rst.j2 +0 -0
  71. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/templates/CHANGELOG.textile.j2 +0 -0
  72. {commitizen-4.8.3 → commitizen-4.8.4}/commitizen/version_schemes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: commitizen
3
- Version: 4.8.3
3
+ Version: 4.8.4
4
4
  Summary: Python commitizen client tool
5
5
  License: MIT License
6
6
 
@@ -47,10 +47,10 @@ Requires-Dist: argcomplete (>=1.12.1,<3.7)
47
47
  Requires-Dist: charset-normalizer (>=2.1.0,<4)
48
48
  Requires-Dist: colorama (>=0.4.1,<1.0)
49
49
  Requires-Dist: decli (>=0.6.0,<1.0)
50
- Requires-Dist: importlib-metadata (>=8.0.0,!=8.7.0,<9.0.0) ; python_version == "3.9"
51
- Requires-Dist: importlib-metadata (>=8.0.0,<9.0.0) ; python_version != "3.9"
50
+ Requires-Dist: importlib-metadata (>=8.0.0,<8.7.0) ; python_version < "3.10"
52
51
  Requires-Dist: jinja2 (>=2.10.3)
53
52
  Requires-Dist: packaging (>=19)
53
+ Requires-Dist: prompt_toolkit (!=3.0.52)
54
54
  Requires-Dist: pyyaml (>=3.08)
55
55
  Requires-Dist: questionary (>=2.0,<3.0)
56
56
  Requires-Dist: termcolor (>=1.1.0,<4.0.0)
@@ -128,6 +128,7 @@ Before installing Commitizen, ensure you have:
128
128
  #### Global Installation (Recommended)
129
129
 
130
130
  The recommended way to install Commitizen is using [`pipx`](https://pipx.pypa.io/) or [`uv`](https://docs.astral.sh/uv/), which ensures a clean, isolated installation:
131
+
131
132
  **Using pipx:**
132
133
  ```bash
133
134
  # Install Commitizen
@@ -176,7 +177,7 @@ poetry add commitizen --dev
176
177
 
177
178
  **Using uv:**
178
179
  ```bash
179
- uv add commitizen
180
+ uv add --dev commitizen
180
181
  ```
181
182
 
182
183
  **Using pdm:**
@@ -0,0 +1 @@
1
+ __version__ = "4.8.4"
@@ -8,9 +8,6 @@ from typing import Any, TypedDict
8
8
 
9
9
  from commitizen.question import CzQuestion
10
10
 
11
- # Type
12
- Questions = Iterable[MutableMapping[str, Any]] # TODO: deprecate this?
13
-
14
11
 
15
12
  class CzSettings(TypedDict, total=False):
16
13
  bump_pattern: str
@@ -161,6 +158,10 @@ def get_tag_regexes(
161
158
  }
162
159
 
163
160
 
161
+ # Type
162
+ Questions = Iterable[MutableMapping[str, Any]] # TODO: remove this in v5
163
+
164
+
164
165
  def __getattr__(name: str) -> Any:
165
166
  # PEP-562: deprecate module-level variable
166
167
 
@@ -176,6 +177,7 @@ def __getattr__(name: str) -> Any:
176
177
  "change_type_order": (CHANGE_TYPE_ORDER, "CHANGE_TYPE_ORDER"),
177
178
  "encoding": (ENCODING, "ENCODING"),
178
179
  "name": (DEFAULT_SETTINGS["name"], "DEFAULT_SETTINGS['name']"),
180
+ "Questions": (Questions, "Iterable[CzQuestion]"),
179
181
  }
180
182
  if name in deprecated_vars:
181
183
  value, replacement = deprecated_vars[name]
@@ -0,0 +1,94 @@
1
+ from __future__ import annotations
2
+
3
+ import fnmatch
4
+ import glob
5
+ from pathlib import Path
6
+
7
+ import tomlkit
8
+
9
+ from commitizen.providers.base_provider import TomlProvider
10
+
11
+
12
+ def matches_exclude(path: str, exclude_patterns: list[str]) -> bool:
13
+ for pattern in exclude_patterns:
14
+ if fnmatch.fnmatch(path, pattern):
15
+ return True
16
+ return False
17
+
18
+
19
+ class CargoProvider(TomlProvider):
20
+ """
21
+ Cargo version management
22
+
23
+ With support for `workspaces`
24
+ """
25
+
26
+ filename = "Cargo.toml"
27
+ lock_filename = "Cargo.lock"
28
+
29
+ @property
30
+ def lock_file(self) -> Path:
31
+ return Path() / self.lock_filename
32
+
33
+ def get(self, document: tomlkit.TOMLDocument) -> str:
34
+ # If there is a root package, change its version (but not the workspace version)
35
+ try:
36
+ return document["package"]["version"] # type: ignore[index,return-value]
37
+ # Else, bump the workspace version
38
+ except tomlkit.exceptions.NonExistentKey:
39
+ ...
40
+ return document["workspace"]["package"]["version"] # type: ignore[index,return-value]
41
+
42
+ def set(self, document: tomlkit.TOMLDocument, version: str) -> None:
43
+ try:
44
+ document["workspace"]["package"]["version"] = version # type: ignore[index]
45
+ return
46
+ except tomlkit.exceptions.NonExistentKey:
47
+ ...
48
+ document["package"]["version"] = version # type: ignore[index]
49
+
50
+ def set_version(self, version: str) -> None:
51
+ super().set_version(version)
52
+ if self.lock_file.exists():
53
+ self.set_lock_version(version)
54
+
55
+ def set_lock_version(self, version: str) -> None:
56
+ cargo_toml_content = tomlkit.parse(self.file.read_text())
57
+ cargo_lock_content = tomlkit.parse(self.lock_file.read_text())
58
+ packages: tomlkit.items.AoT = cargo_lock_content["package"] # type: ignore[assignment]
59
+ try:
60
+ package_name = cargo_toml_content["package"]["name"] # type: ignore[index]
61
+ for i, package in enumerate(packages):
62
+ if package["name"] == package_name:
63
+ cargo_lock_content["package"][i]["version"] = version # type: ignore[index]
64
+ break
65
+ except tomlkit.exceptions.NonExistentKey:
66
+ workspace_members = cargo_toml_content.get("workspace", {}).get(
67
+ "members", []
68
+ )
69
+ excluded_workspace_members = cargo_toml_content.get("workspace", {}).get(
70
+ "exclude", []
71
+ )
72
+ members_inheriting = []
73
+
74
+ for member in workspace_members:
75
+ for path in glob.glob(member, recursive=True):
76
+ if matches_exclude(path, excluded_workspace_members):
77
+ continue
78
+ cargo_file = Path(path) / "Cargo.toml"
79
+ cargo_toml_content = tomlkit.parse(cargo_file.read_text())
80
+ try:
81
+ version_workspace = cargo_toml_content["package"]["version"][ # type: ignore[index]
82
+ "workspace"
83
+ ]
84
+ if version_workspace is True:
85
+ package_name = cargo_toml_content["package"]["name"] # type: ignore[index]
86
+ members_inheriting.append(package_name)
87
+ except tomlkit.exceptions.NonExistentKey:
88
+ continue
89
+
90
+ for i, package in enumerate(packages):
91
+ if package["name"] in members_inheriting:
92
+ cargo_lock_content["package"][i]["version"] = version # type: ignore[index]
93
+
94
+ self.lock_file.write_text(tomlkit.dumps(cargo_lock_content))
@@ -63,6 +63,7 @@ Before installing Commitizen, ensure you have:
63
63
  #### Global Installation (Recommended)
64
64
 
65
65
  The recommended way to install Commitizen is using [`pipx`](https://pipx.pypa.io/) or [`uv`](https://docs.astral.sh/uv/), which ensures a clean, isolated installation:
66
+
66
67
  **Using pipx:**
67
68
  ```bash
68
69
  # Install Commitizen
@@ -111,7 +112,7 @@ poetry add commitizen --dev
111
112
 
112
113
  **Using uv:**
113
114
  ```bash
114
- uv add commitizen
115
+ uv add --dev commitizen
115
116
  ```
116
117
 
117
118
  **Using pdm:**
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "commitizen"
3
- version = "4.8.3"
3
+ version = "4.8.4"
4
4
  description = "Python commitizen client tool"
5
5
  authors = [{ name = "Santiago Fraire", email = "santiwilly@gmail.com" }]
6
6
  maintainers = [
@@ -12,6 +12,7 @@ readme = "docs/README.md"
12
12
  requires-python = ">=3.9,<4.0"
13
13
  dependencies = [
14
14
  "questionary (>=2.0,<3.0)",
15
+ "prompt_toolkit!=3.0.52", # Exclude transitive dependency due to known issue in questionary: https://github.com/tmbo/questionary/issues/454
15
16
  "decli (>=0.6.0,<1.0)",
16
17
  "colorama (>=0.4.1,<1.0)",
17
18
  "termcolor (>=1.1.0,<4.0.0)",
@@ -23,8 +24,7 @@ dependencies = [
23
24
  "typing-extensions (>=4.0.1,<5.0.0) ; python_version < '3.11'",
24
25
  "charset-normalizer (>=2.1.0,<4)",
25
26
  # Use the Python 3.11 and 3.12 compatible API: https://github.com/python/importlib_metadata#compatibility
26
- "importlib-metadata >=8.0.0,!=8.7.0,<9.0.0 ; python_version == '3.9'", # importlib-metadata@8.7.0 + python3.9 breaks our unit test
27
- "importlib-metadata >=8.0.0,<9.0.0 ; python_version != '3.9'",
27
+ "importlib-metadata >=8.0.0,<8.7.0 ; python_version < '3.10'",
28
28
  ]
29
29
  keywords = ["commitizen", "conventional", "commits", "git"]
30
30
  # See also: https://pypi.org/classifiers/
@@ -88,7 +88,7 @@ build-backend = "poetry.core.masonry.api"
88
88
 
89
89
 
90
90
  [tool.commitizen]
91
- version = "4.8.3"
91
+ version = "4.8.4"
92
92
  tag_format = "v$version"
93
93
  version_files = [
94
94
  "pyproject.toml:version",
@@ -1 +0,0 @@
1
- __version__ = "4.8.3"
@@ -1,57 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from pathlib import Path
4
-
5
- import tomlkit
6
-
7
- from commitizen.providers.base_provider import TomlProvider
8
-
9
-
10
- class CargoProvider(TomlProvider):
11
- """
12
- Cargo version management
13
-
14
- With support for `workspaces`
15
- """
16
-
17
- filename = "Cargo.toml"
18
- lock_filename = "Cargo.lock"
19
-
20
- @property
21
- def lock_file(self) -> Path:
22
- return Path() / self.lock_filename
23
-
24
- def get(self, document: tomlkit.TOMLDocument) -> str:
25
- try:
26
- return document["package"]["version"] # type: ignore[index,return-value]
27
- except tomlkit.exceptions.NonExistentKey:
28
- ...
29
- return document["workspace"]["package"]["version"] # type: ignore[index,return-value]
30
-
31
- def set(self, document: tomlkit.TOMLDocument, version: str) -> None:
32
- try:
33
- document["workspace"]["package"]["version"] = version # type: ignore[index]
34
- return
35
- except tomlkit.exceptions.NonExistentKey:
36
- ...
37
- document["package"]["version"] = version # type: ignore[index]
38
-
39
- def set_version(self, version: str) -> None:
40
- super().set_version(version)
41
- if self.lock_file.exists():
42
- self.set_lock_version(version)
43
-
44
- def set_lock_version(self, version: str) -> None:
45
- cargo_toml_content = tomlkit.parse(self.file.read_text())
46
- try:
47
- package_name = cargo_toml_content["package"]["name"] # type: ignore[index]
48
- except tomlkit.exceptions.NonExistentKey:
49
- package_name = cargo_toml_content["workspace"]["package"]["name"] # type: ignore[index]
50
-
51
- cargo_lock_content = tomlkit.parse(self.lock_file.read_text())
52
- packages: tomlkit.items.AoT = cargo_lock_content["package"] # type: ignore[assignment]
53
- for i, package in enumerate(packages):
54
- if package["name"] == package_name:
55
- cargo_lock_content["package"][i]["version"] = version # type: ignore[index]
56
- break
57
- self.lock_file.write_text(tomlkit.dumps(cargo_lock_content))
File without changes
File without changes
File without changes
File without changes
File without changes