commitizen 4.4.1__tar.gz → 4.6.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.
Files changed (70) hide show
  1. {commitizen-4.4.1 → commitizen-4.6.0}/PKG-INFO +23 -2
  2. commitizen-4.6.0/commitizen/__version__.py +1 -0
  3. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/changelog.py +1 -0
  4. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/init.py +11 -0
  5. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/git.py +13 -3
  6. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/tags.py +14 -10
  7. {commitizen-4.4.1 → commitizen-4.6.0}/pyproject.toml +4 -3
  8. commitizen-4.4.1/commitizen/__version__.py +0 -1
  9. {commitizen-4.4.1 → commitizen-4.6.0}/LICENSE +0 -0
  10. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/__init__.py +0 -0
  11. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/__main__.py +0 -0
  12. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/bump.py +0 -0
  13. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/changelog_formats/__init__.py +0 -0
  14. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/changelog_formats/asciidoc.py +0 -0
  15. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/changelog_formats/base.py +0 -0
  16. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/changelog_formats/markdown.py +0 -0
  17. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/changelog_formats/restructuredtext.py +0 -0
  18. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/changelog_formats/textile.py +0 -0
  19. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cli.py +0 -0
  20. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cmd.py +0 -0
  21. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/__init__.py +0 -0
  22. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/bump.py +0 -0
  23. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/changelog.py +0 -0
  24. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/check.py +0 -0
  25. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/commit.py +0 -0
  26. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/example.py +0 -0
  27. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/info.py +0 -0
  28. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/list_cz.py +0 -0
  29. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/schema.py +0 -0
  30. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/commands/version.py +0 -0
  31. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/config/__init__.py +0 -0
  32. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/config/base_config.py +0 -0
  33. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/config/json_config.py +0 -0
  34. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/config/toml_config.py +0 -0
  35. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/config/yaml_config.py +0 -0
  36. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/__init__.py +0 -0
  37. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/base.py +0 -0
  38. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/conventional_commits/__init__.py +0 -0
  39. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/conventional_commits/conventional_commits.py +0 -0
  40. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/conventional_commits/conventional_commits_info.txt +0 -0
  41. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/customize/__init__.py +0 -0
  42. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/customize/customize.py +0 -0
  43. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/customize/customize_info.txt +0 -0
  44. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/exceptions.py +0 -0
  45. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/jira/__init__.py +0 -0
  46. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/jira/jira.py +0 -0
  47. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/jira/jira_info.txt +0 -0
  48. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/cz/utils.py +0 -0
  49. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/defaults.py +0 -0
  50. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/exceptions.py +0 -0
  51. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/factory.py +0 -0
  52. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/hooks.py +0 -0
  53. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/out.py +0 -0
  54. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/__init__.py +0 -0
  55. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/base_provider.py +0 -0
  56. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/cargo_provider.py +0 -0
  57. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/commitizen_provider.py +0 -0
  58. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/composer_provider.py +0 -0
  59. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/npm_provider.py +0 -0
  60. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/pep621_provider.py +0 -0
  61. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/poetry_provider.py +0 -0
  62. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/scm_provider.py +0 -0
  63. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/providers/uv_provider.py +0 -0
  64. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/py.typed +0 -0
  65. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/templates/CHANGELOG.adoc.j2 +0 -0
  66. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/templates/CHANGELOG.md.j2 +0 -0
  67. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/templates/CHANGELOG.rst.j2 +0 -0
  68. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/templates/CHANGELOG.textile.j2 +0 -0
  69. {commitizen-4.4.1 → commitizen-4.6.0}/commitizen/version_schemes.py +0 -0
  70. {commitizen-4.4.1 → commitizen-4.6.0}/docs/README.md +0 -0
@@ -1,8 +1,28 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: commitizen
3
- Version: 4.4.1
3
+ Version: 4.6.0
4
4
  Summary: Python commitizen client tool
5
- License: LICENSE
5
+ License: MIT License
6
+
7
+ Copyright (c) 2017 Santiago
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
6
26
  Keywords: commitizen,conventional,commits,git
7
27
  Author: Santiago Fraire
8
28
  Author-email: santiwilly@gmail.com
@@ -22,6 +42,7 @@ Classifier: Programming Language :: Python :: 3.11
22
42
  Classifier: Programming Language :: Python :: 3.12
23
43
  Classifier: Programming Language :: Python :: 3.13
24
44
  Classifier: Programming Language :: Python :: Implementation :: CPython
45
+ Classifier: License :: OSI Approved :: MIT License
25
46
  Requires-Dist: argcomplete (>=1.12.1,<3.6)
26
47
  Requires-Dist: charset-normalizer (>=2.1.0,<4)
27
48
  Requires-Dist: colorama (>=0.4.1,<1.0)
@@ -0,0 +1 @@
1
+ __version__ = "4.6.0"
@@ -172,6 +172,7 @@ def process_commit_message(
172
172
  ):
173
173
  message: dict = {
174
174
  "sha1": commit.rev,
175
+ "parents": commit.parents,
175
176
  "author": commit.author,
176
177
  "author_email": commit.author_email,
177
178
  **parsed.groupdict(),
@@ -24,6 +24,10 @@ class ProjectInfo:
24
24
  def has_pyproject(self) -> bool:
25
25
  return os.path.isfile("pyproject.toml")
26
26
 
27
+ @property
28
+ def has_uv_lock(self) -> bool:
29
+ return os.path.isfile("uv.lock")
30
+
27
31
  @property
28
32
  def has_setup(self) -> bool:
29
33
  return os.path.isfile("setup.py")
@@ -32,6 +36,10 @@ class ProjectInfo:
32
36
  def has_pre_commit_config(self) -> bool:
33
37
  return os.path.isfile(".pre-commit-config.yaml")
34
38
 
39
+ @property
40
+ def is_python_uv(self) -> bool:
41
+ return self.has_pyproject and self.has_uv_lock
42
+
35
43
  @property
36
44
  def is_python_poetry(self) -> bool:
37
45
  if not self.has_pyproject:
@@ -228,6 +236,7 @@ class Init:
228
236
  "npm": "npm: Get and set version from package.json:project.version field",
229
237
  "pep621": "pep621: Get and set version from pyproject.toml:project.version field",
230
238
  "poetry": "poetry: Get and set version from pyproject.toml:tool.poetry.version field",
239
+ "uv": "uv: Get and Get and set version from pyproject.toml and uv.lock",
231
240
  "scm": "scm: Fetch the version from git and does not need to set it back",
232
241
  }
233
242
 
@@ -235,6 +244,8 @@ class Init:
235
244
  if self.project_info.is_python:
236
245
  if self.project_info.is_python_poetry:
237
246
  default_val = "poetry"
247
+ elif self.project_info.is_python_uv:
248
+ default_val = "uv"
238
249
  else:
239
250
  default_val = "pep621"
240
251
  elif self.project_info.is_rust_cargo:
@@ -44,13 +44,20 @@ class GitObject:
44
44
 
45
45
  class GitCommit(GitObject):
46
46
  def __init__(
47
- self, rev, title, body: str = "", author: str = "", author_email: str = ""
47
+ self,
48
+ rev,
49
+ title,
50
+ body: str = "",
51
+ author: str = "",
52
+ author_email: str = "",
53
+ parents: list[str] | None = None,
48
54
  ):
49
55
  self.rev = rev.strip()
50
56
  self.title = title.strip()
51
57
  self.body = body.strip()
52
58
  self.author = author.strip()
53
59
  self.author_email = author_email.strip()
60
+ self.parents = parents or []
54
61
 
55
62
  @property
56
63
  def message(self):
@@ -137,7 +144,9 @@ def get_commits(
137
144
  for rev_and_commit in git_log_entries:
138
145
  if not rev_and_commit:
139
146
  continue
140
- rev, title, author, author_email, *body_list = rev_and_commit.split("\n")
147
+ rev, parents, title, author, author_email, *body_list = rev_and_commit.split(
148
+ "\n"
149
+ )
141
150
  if rev_and_commit:
142
151
  git_commit = GitCommit(
143
152
  rev=rev.strip(),
@@ -145,6 +154,7 @@ def get_commits(
145
154
  body="\n".join(body_list).strip(),
146
155
  author=author,
147
156
  author_email=author_email,
157
+ parents=[p for p in parents.strip().split(" ") if p],
148
158
  )
149
159
  git_commits.append(git_commit)
150
160
  return git_commits
@@ -286,7 +296,7 @@ def smart_open(*args, **kargs):
286
296
  def _get_log_as_str_list(start: str | None, end: str, args: str) -> list[str]:
287
297
  """Get string representation of each log entry"""
288
298
  delimiter = "----------commit-delimiter----------"
289
- log_format: str = "%H%n%s%n%an%n%ae%n%b"
299
+ log_format: str = "%H%n%P%n%s%n%an%n%ae%n%b"
290
300
  git_log_cmd = (
291
301
  f"git -c log.showSignature=False log --pretty={log_format}{delimiter} {args}"
292
302
  )
@@ -55,28 +55,30 @@ class TagRules:
55
55
 
56
56
  Example:
57
57
 
58
- ```py
58
+ ```python
59
59
  settings = DEFAULT_SETTINGS.clone()
60
- settings.update({
61
- "tag_format": "v{version}"
62
- "legacy_tag_formats": ["version{version}", "ver{version}"],
63
- "ignored_tag_formats": ["ignored{version}"],
64
- })
60
+ settings.update(
61
+ {
62
+ "tag_format": "v{version}",
63
+ "legacy_tag_formats": ["version{version}", "ver{version}"],
64
+ "ignored_tag_formats": ["ignored{version}"],
65
+ }
66
+ )
65
67
 
66
68
  rules = TagRules.from_settings(settings)
67
69
 
68
70
  assert rules.is_version_tag("v1.0.0")
69
71
  assert rules.is_version_tag("version1.0.0")
70
72
  assert rules.is_version_tag("ver1.0.0")
71
- assert not rules.is_version_tag("ignored1.0.0", warn=True) # Does not warn
72
- assert not rules.is_version_tag("warn1.0.0", warn=True) # Does warn
73
+ assert not rules.is_version_tag("ignored1.0.0", warn=True) # Does not warn
74
+ assert not rules.is_version_tag("warn1.0.0", warn=True) # Does warn
73
75
 
74
76
  assert rules.search_version("# My v1.0.0 version").version == "1.0.0"
75
77
  assert rules.extract_version("v1.0.0") == Version("1.0.0")
76
78
  try:
77
79
  assert rules.extract_version("not-a-v1.0.0")
78
80
  except InvalidVersion:
79
- print "Does not match a tag format"
81
+ print("Does not match a tag format")
80
82
  ```
81
83
  """
82
84
 
@@ -144,7 +146,9 @@ class TagRules:
144
146
  m for regex in self.version_regexes if (m := regex.fullmatch(tag.name))
145
147
  )
146
148
  if not (m := next(candidates, None)):
147
- raise InvalidVersion()
149
+ raise InvalidVersion(
150
+ f"Invalid version tag: '{tag.name}' does not match any configured tag format"
151
+ )
148
152
  if "version" in m.groupdict():
149
153
  return self.scheme(m.group("version"))
150
154
 
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "commitizen"
3
- version = "4.4.1"
3
+ version = "4.6.0"
4
4
  description = "Python commitizen client tool"
5
5
  authors = [{ name = "Santiago Fraire", email = "santiwilly@gmail.com" }]
6
6
  maintainers = [
7
7
  { name = "Wei Lee", email = "weilee.rx@gmail.com" },
8
8
  { name = "Axel H.", email = "noirbizarre@gmail.com" },
9
9
  ]
10
- license = { text = "LICENSE" }
10
+ license = { file = "LICENSE" }
11
11
  readme = "docs/README.md"
12
12
  requires-python = ">=3.9,<4.0"
13
13
  dependencies = [
@@ -42,6 +42,7 @@ classifiers = [
42
42
  "Programming Language :: Python :: 3.12",
43
43
  "Programming Language :: Python :: 3.13",
44
44
  "Programming Language :: Python :: Implementation :: CPython",
45
+ "License :: OSI Approved :: MIT License",
45
46
  ]
46
47
 
47
48
  [project.urls]
@@ -87,7 +88,7 @@ build-backend = "poetry.core.masonry.api"
87
88
 
88
89
 
89
90
  [tool.commitizen]
90
- version = "4.4.1"
91
+ version = "4.6.0"
91
92
  tag_format = "v$version"
92
93
  version_files = [
93
94
  "pyproject.toml:version",
@@ -1 +0,0 @@
1
- __version__ = "4.4.1"
File without changes
File without changes
File without changes
File without changes
File without changes