python-semantic-release 9.18.0__py3-none-any.whl → 9.19.0__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.18.0
3
+ Version: 9.19.0
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- semantic_release/__init__.py,sha256=-F25Nu3RzbeFLRgFP4ms_VHphEUTK1SdYz0y3LLOJB8,1229
1
+ semantic_release/__init__.py,sha256=GB2rbgAWEPV8Ke_LT5SweTJGMfuCbPkhjXovRKWl0AQ,1229
2
2
  semantic_release/__main__.py,sha256=KOIBOvLruqfi5ArXcWK3ucIZ7NB55kfCbycJaxx6aQg,1485
3
3
  semantic_release/const.py,sha256=wInJR7vcOgT1ysm5VuJQ6lD_ZGYnCwRVKz7Uz3htQc4,861
4
4
  semantic_release/enums.py,sha256=vrEw1UNRcNrFjPqOFnuUzfeoqKj0ChixVVlyk5fqbng,1744
@@ -14,7 +14,7 @@ semantic_release/changelog/template.py,sha256=R3V5m-7kv9ES23e_g37fe17tk-ESgvwV0C
14
14
  semantic_release/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  semantic_release/cli/changelog_writer.py,sha256=92DntVFFGdzFc5eBUgrRXbSOSV9KVvV769NyhLOTirg,9281
16
16
  semantic_release/cli/cli_context.py,sha256=Nop71LdVCJOeSUHgTXunMyK3xAu_QKQC2cRp1QBVkX0,4134
17
- semantic_release/cli/config.py,sha256=rLva6QIB5DJIYtWCnC1GHiHMWbnEkWg_YxIVVhznjnk,33138
17
+ semantic_release/cli/config.py,sha256=S57MXS2feHW6p9xWOl7waMKyivFoAfH6RLmsh0b2msk,33830
18
18
  semantic_release/cli/const.py,sha256=h7XE2D0D__TAZSrUUtVszwvzpkHTMOiQCf97XQNbEvA,163
19
19
  semantic_release/cli/github_actions_output.py,sha256=6oNwjnQBg9XF5QgGc4TgbwX_-W0aj65VwGSL4ALvqVg,2296
20
20
  semantic_release/cli/masking_filter.py,sha256=ric34rnXfN5RiAVVaKnhiMJOxTnEl26kI06jQqZPZoQ,3072
@@ -25,9 +25,10 @@ semantic_release/cli/commands/generate_config.py,sha256=2xZOu3NpyhBp0pWr7d8ugKl_
25
25
  semantic_release/cli/commands/main.py,sha256=237rn_Od4LOWfjUjiUKI_jSV820MfcCtRpwPjxjLbyU,4312
26
26
  semantic_release/cli/commands/publish.py,sha256=y_LalPti_kZeQJzl2CR2pTZUK8DCMvNSTe4NaMC5TJA,2875
27
27
  semantic_release/cli/commands/version.py,sha256=BMAOXToqOC_U0nh3d-QszAOS7xhN86aGhFiaePSdfws,25287
28
- semantic_release/commit_parser/__init__.py,sha256=cv5HFBdw7OJd4Laj4Ex8ZZ5Tml8GwXgQcXW6Pasr2Ao,615
28
+ semantic_release/commit_parser/__init__.py,sha256=6euiDgj9bwOx1rP96vUjq090usviXkbo7OVOnRBGfcw,742
29
29
  semantic_release/commit_parser/_base.py,sha256=oDifeTmFDpS238cp_DDrGzfidaKeAD5olCB5IM4Q6z8,3058
30
30
  semantic_release/commit_parser/angular.py,sha256=UM88ethWT34__kDgsBXXb26d0V8FN1ZFjcU7psuOhgY,19259
31
+ semantic_release/commit_parser/conventional.py,sha256=ECDQD_O4n93gS72hzDAdS7ZEpkRzLIZs7br4ivVMGsw,902
31
32
  semantic_release/commit_parser/emoji.py,sha256=T3kw8jyq1zYME3f6JJ6O3hVJ2IpRk3DD5LB0VOlcbMM,18194
32
33
  semantic_release/commit_parser/scipy.py,sha256=0rYZglJ7uib-1Deu4J30wHh7AZS8KfO0eND82bPtDQ8,4526
33
34
  semantic_release/commit_parser/tag.py,sha256=oGB3lgyp2Eu3Tg3jjxqNzN86N6bokSaFu6f4Ir6IS_k,3546
@@ -66,10 +67,10 @@ semantic_release/version/algorithm.py,sha256=s5lso4Py-PiVzuPhgeJOz6IDzIdqc6EeoUi
66
67
  semantic_release/version/declaration.py,sha256=f6Ld7hIhrqvDrRBapJHr-KDimuyo-4IG8009Zu9BIgU,7357
67
68
  semantic_release/version/translator.py,sha256=P1noIsVBn8u6zNOFjG0xKYOWapxqf_PHSMvMeLJ9kXg,3050
68
69
  semantic_release/version/version.py,sha256=6PCtSbLP88U1daoxnCwHc--YguZo4waGNLqJ5JfeczE,14175
69
- python_semantic_release-9.18.0.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
70
- python_semantic_release-9.18.0.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
71
- python_semantic_release-9.18.0.dist-info/METADATA,sha256=G6MEURvvUmQP39A6ksc-bSvIS4XeKxbP3iFNDF9gytE,3812
72
- python_semantic_release-9.18.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
73
- python_semantic_release-9.18.0.dist-info/entry_points.txt,sha256=r2Jql3GTQyugQnvf34l2eXk1O_Qx6llR_xixG1ZWgD0,105
74
- python_semantic_release-9.18.0.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
75
- python_semantic_release-9.18.0.dist-info/RECORD,,
70
+ python_semantic_release-9.19.0.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
71
+ python_semantic_release-9.19.0.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
72
+ python_semantic_release-9.19.0.dist-info/METADATA,sha256=fpNQ4-lx5yz8INyq7I4wZr0m6hTN76h9kctnkHWAiRc,3812
73
+ python_semantic_release-9.19.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
74
+ python_semantic_release-9.19.0.dist-info/entry_points.txt,sha256=r2Jql3GTQyugQnvf34l2eXk1O_Qx6llR_xixG1ZWgD0,105
75
+ python_semantic_release-9.19.0.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
76
+ python_semantic_release-9.19.0.dist-info/RECORD,,
@@ -24,7 +24,7 @@ from semantic_release.version import (
24
24
  tags_and_versions,
25
25
  )
26
26
 
27
- __version__ = "9.18.0"
27
+ __version__ = "9.19.0"
28
28
 
29
29
  __all__ = [
30
30
  "CommitParser",
@@ -39,6 +39,7 @@ from semantic_release.cli.masking_filter import MaskingFilter
39
39
  from semantic_release.commit_parser import (
40
40
  AngularCommitParser,
41
41
  CommitParser,
42
+ ConventionalCommitParser,
42
43
  EmojiCommitParser,
43
44
  ParseResult,
44
45
  ParserOptions,
@@ -54,7 +55,6 @@ from semantic_release.errors import (
54
55
  ParserLoadError,
55
56
  )
56
57
  from semantic_release.helpers import dynamic_import
57
- from semantic_release.hvcs.remote_hvcs_base import RemoteHvcsBase
58
58
  from semantic_release.version.declaration import (
59
59
  PatternVersionDeclaration,
60
60
  TomlVersionDeclaration,
@@ -74,6 +74,7 @@ class HvcsClient(str, Enum):
74
74
 
75
75
 
76
76
  _known_commit_parsers: Dict[str, type[CommitParser]] = {
77
+ "conventional": ConventionalCommitParser,
77
78
  "angular": AngularCommitParser,
78
79
  "emoji": EmojiCommitParser,
79
80
  "scipy": ScipyCommitParser,
@@ -287,15 +288,18 @@ class RemoteConfig(BaseModel):
287
288
 
288
289
  def _get_default_token(self) -> str | None:
289
290
  hvcs_client_class = _known_hvcs[self.type]
290
- default_hvcs_instance = hvcs_client_class("git@example.com:owner/project.git")
291
- if not isinstance(default_hvcs_instance, RemoteHvcsBase):
292
- return None
293
291
 
294
- default_token_name = default_hvcs_instance.DEFAULT_ENV_TOKEN_NAME
295
- if not default_token_name:
296
- return None
292
+ default_token_name = (
293
+ getattr(hvcs_client_class, "DEFAULT_ENV_TOKEN_NAME") # noqa: B009
294
+ if hasattr(hvcs_client_class, "DEFAULT_ENV_TOKEN_NAME")
295
+ else ""
296
+ )
297
297
 
298
- return EnvConfigVar(env=default_token_name).getvalue()
298
+ return (
299
+ EnvConfigVar(env=default_token_name).getvalue()
300
+ if default_token_name
301
+ else None
302
+ )
299
303
 
300
304
  @model_validator(mode="after")
301
305
  def check_url_scheme(self) -> Self:
@@ -353,7 +357,7 @@ class RawConfig(BaseModel):
353
357
  env="GIT_COMMIT_AUTHOR", default=DEFAULT_COMMIT_AUTHOR
354
358
  )
355
359
  commit_message: str = COMMIT_MESSAGE
356
- commit_parser: NonEmptyString = "angular"
360
+ commit_parser: NonEmptyString = "conventional"
357
361
  # It's up to the parser_options() method to validate these
358
362
  commit_parser_options: Dict[str, Any] = {}
359
363
  logging_use_named_masks: bool = False
@@ -412,6 +416,22 @@ class RawConfig(BaseModel):
412
416
  )
413
417
  return val
414
418
 
419
+ @field_validator("commit_parser", mode="after")
420
+ @classmethod
421
+ def angular_commit_parser_deprecation_warning(cls, val: str) -> str:
422
+ if val == "angular":
423
+ log.warning(
424
+ str.join(
425
+ " ",
426
+ [
427
+ "The 'angular' parser is deprecated and will be removed in v11.",
428
+ "The Angular parser is being renamed to the conventional commit parser,",
429
+ "which is selected by switching the 'commit_parser' value to 'conventional'.",
430
+ ],
431
+ )
432
+ )
433
+ return val
434
+
415
435
  @field_validator("build_command_env", mode="after")
416
436
  @classmethod
417
437
  def remove_whitespace(cls, val: list[str]) -> list[str]:
@@ -861,6 +881,7 @@ class RuntimeContext:
861
881
  changelog_excluded_commit_patterns=changelog_excluded_commit_patterns,
862
882
  # TODO: change when we have other styles per parser
863
883
  # changelog_style=changelog_style,
884
+ # TODO: Breaking Change v10, change to conventional
864
885
  changelog_style="angular",
865
886
  changelog_output_format=raw.changelog.default_templates.output_format,
866
887
  prerelease=branch_config.prerelease,
@@ -6,6 +6,10 @@ from semantic_release.commit_parser.angular import (
6
6
  AngularCommitParser,
7
7
  AngularParserOptions,
8
8
  )
9
+ from semantic_release.commit_parser.conventional import (
10
+ ConventionalCommitParser,
11
+ ConventionalCommitParserOptions,
12
+ )
9
13
  from semantic_release.commit_parser.emoji import (
10
14
  EmojiCommitParser,
11
15
  EmojiParserOptions,
@@ -0,0 +1,31 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic.dataclasses import dataclass
4
+
5
+ from semantic_release.commit_parser.angular import (
6
+ AngularCommitParser,
7
+ AngularParserOptions,
8
+ )
9
+
10
+
11
+ @dataclass
12
+ class ConventionalCommitParserOptions(AngularParserOptions):
13
+ """Options dataclass for the ConventionalCommitParser."""
14
+
15
+
16
+ class ConventionalCommitParser(AngularCommitParser):
17
+ """
18
+ A commit parser for projects conforming to the conventional commits specification.
19
+
20
+ See https://www.conventionalcommits.org/en/v1.0.0/
21
+ """
22
+
23
+ # TODO: Deprecate in lieu of get_default_options()
24
+ parser_options = ConventionalCommitParserOptions
25
+
26
+ def __init__(self, options: ConventionalCommitParserOptions | None = None) -> None:
27
+ super().__init__(options)
28
+
29
+ @staticmethod
30
+ def get_default_options() -> ConventionalCommitParserOptions:
31
+ return ConventionalCommitParserOptions()