python-semantic-release 9.11.0__py3-none-any.whl → 9.12.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.11.0
3
+ Version: 9.12.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=LEC1ip68ktnt2B2_mfEccE2nj03qrqGgPstNujJ3cBo,1229
1
+ semantic_release/__init__.py,sha256=fxw583b6ABCDlk6pC_P4cyeIArzuHA6rwYTigF1nq-U,1229
2
2
  semantic_release/__main__.py,sha256=blPn7CMpuSe4Z-GBIDv0QA0OEDTMGU-7edsLRkkhPR4,120
3
3
  semantic_release/const.py,sha256=Z1o2QNh60wSLeF-_1TemMBjU3ZXbV0XghnUFsbTVfOs,831
4
4
  semantic_release/enums.py,sha256=D5B_reQGGKQQT22HO5PUtvn2Bok3fkht6TfJtXkmAUg,1020
@@ -6,13 +6,13 @@ semantic_release/errors.py,sha256=rco5-lwz_0JbJrDsQWmTvT_l3bA3HFkeTmBiZfvCx-Q,27
6
6
  semantic_release/gitproject.py,sha256=izWc4NLdUzAwxGG_fJeqqHW9ivSrPcWBzSaOijQx4f8,8564
7
7
  semantic_release/helpers.py,sha256=d1jOX0SNyqPc_3wr14xR25FfpqhMd4Ev7MNBOWlScc0,5581
8
8
  semantic_release/changelog/__init__.py,sha256=Bg6Xe5Vt32rWoMscW-hd4sUwiZqzWmsg4CD1EhMesMY,262
9
- semantic_release/changelog/context.py,sha256=aRlYnAvwg4Jchz6EYkbWyTcuwqJeCZd-lNA0Hh5Zv5Q,3268
10
- semantic_release/changelog/release_history.py,sha256=9gJxqOKPF9HjmOdXW-k-dWbe2YGWxqZEOWSSef-qwoE,7050
11
- semantic_release/changelog/template.py,sha256=FfA5-6sWh3bYQ5sEK4fR414_WNxm3TPUXghqak_9eyk,5989
9
+ semantic_release/changelog/context.py,sha256=iZPm49yWiU4sezckZFuBRTrTn9MlkLQBJKNQ87NjZTs,5031
10
+ semantic_release/changelog/release_history.py,sha256=8RU6A4FMgWwwjndOO4WKjbSzPWgVsYbdcZol1xUPnfo,7815
11
+ semantic_release/changelog/template.py,sha256=J1YJDI_SnXtBbTxoahN0NaVVHN7grOFghLwE9wDjxik,5685
12
12
  semantic_release/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- semantic_release/cli/changelog_writer.py,sha256=tvUtUFfxP4mKHLfWiC2yGrdCNMtUHQrpFxfdNpGTam4,8630
13
+ semantic_release/cli/changelog_writer.py,sha256=oCqsAZPIjv4vXxnm5p49dUUx1mlnE93cg9ma8aR40NY,8673
14
14
  semantic_release/cli/cli_context.py,sha256=23eyV6KWIpUckUSWILEd7t9dixp-QCY5-kGZnyucEYY,4114
15
- semantic_release/cli/config.py,sha256=-u6zXCEPMxUjI3CTukSzOvrHyWlZwrOyDRj4bJx8oeQ,30070
15
+ semantic_release/cli/config.py,sha256=0btSbu5KKFZ3HFqR_-WDyToWXljfv1EOuBjBqwwFJcc,30654
16
16
  semantic_release/cli/const.py,sha256=haTpNlJifrtbwICwF1u0MNyB0kDsqGUsfM2zwuDu4RM,162
17
17
  semantic_release/cli/github_actions_output.py,sha256=VYIOb5x5h8eEJdSlXM_mkhT9xXtYi-RgxvnoM7iUn8s,2288
18
18
  semantic_release/cli/masking_filter.py,sha256=DxqjiJyABlzwwwZ1r8JGQpb6QrF00StJFm0-2-s5Fv0,3071
@@ -20,15 +20,15 @@ semantic_release/cli/util.py,sha256=FyXaBkeL7nXKjy3X9rQLEwvn7p46xPekp2V8Z-5MVrk,
20
20
  semantic_release/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
21
  semantic_release/cli/commands/changelog.py,sha256=kVHcGdfud74-M6hjWf1PS6l95gD4yUlu3CZGBkCt7aY,3765
22
22
  semantic_release/cli/commands/generate_config.py,sha256=2xZOu3NpyhBp0pWr7d8ugKl_kjqQgpSsSMHq5wHTfrE,1699
23
- semantic_release/cli/commands/main.py,sha256=kqO8bZw9Nv6T5QkIl53zzmH2rd4LuLoA8agweH0VYPY,4022
23
+ semantic_release/cli/commands/main.py,sha256=OhcVrdRVKpDhvZxEfzPMmApZspPDFFFFZ02liFJ6tiA,3998
24
24
  semantic_release/cli/commands/publish.py,sha256=SZQlIewvqyIC14dkIIVVFetE0tPsKbO1cUyxnZsicrw,2845
25
25
  semantic_release/cli/commands/version.py,sha256=4ZfF2zbwnSNlVewfyXI1UrlvxJJFSI3A3xGo6Vg8CC0,24270
26
26
  semantic_release/commit_parser/__init__.py,sha256=cv5HFBdw7OJd4Laj4Ex8ZZ5Tml8GwXgQcXW6Pasr2Ao,615
27
27
  semantic_release/commit_parser/_base.py,sha256=t-Z9ALgAe7aZpYXz1mk3Fe-uAvipgKdNrq4Okg_WW9c,3026
28
- semantic_release/commit_parser/angular.py,sha256=AbclYVP_aX_WKpwBCN7SCyJ3-aYf-SVOT4O5TOBLVwI,4857
29
- semantic_release/commit_parser/emoji.py,sha256=M6zgqsXqegLK5FxZGyfsOPM3vOsJkPKVAjnGATOhwa4,3452
30
- semantic_release/commit_parser/scipy.py,sha256=AH_GeMZ9hWiNQTL78bovpQy7mBeobGpUk5Shzyxxm6c,5951
31
- semantic_release/commit_parser/tag.py,sha256=SAop9INQvKOwktNmVypKFngd6xHmY_XZrLUWChUjz84,3353
28
+ semantic_release/commit_parser/angular.py,sha256=qB05SVI6bHapPArNeZ1rUrEmnhGRv463iN8rHL4kWZ0,4904
29
+ semantic_release/commit_parser/emoji.py,sha256=foN7wVDW1Lv7A_cR4mq4X2aas17IEwTgQ8xjUXduN8k,3830
30
+ semantic_release/commit_parser/scipy.py,sha256=p7Ox0GJGtJ3jKroDDW55Iu1Ma2089VegESRcagwDwJw,6028
31
+ semantic_release/commit_parser/tag.py,sha256=4uwIKBqUM2SE6UTGIw-a7B6Jg1OONXmGwXsTyL3yZBA,3490
32
32
  semantic_release/commit_parser/token.py,sha256=BB4ZCyt753CCaBFF95cQ4sFm6Au96wpO0YyTAWdcOvE,1609
33
33
  semantic_release/commit_parser/util.py,sha256=vLcVDErZrExM55jMffos0hyMbNVQoJ-PeeVDG1Ej51I,730
34
34
  semantic_release/data/templates/angular/release_notes.md.j2,sha256=ftg0pFkmGYlb9UH2waSLc6neC8rPMMCqblJaQeq4vTg,46
@@ -61,10 +61,10 @@ semantic_release/version/algorithm.py,sha256=ofx_bIWq6ptJVr-ekI11IzxzDEctDKFiVwa
61
61
  semantic_release/version/declaration.py,sha256=f6Ld7hIhrqvDrRBapJHr-KDimuyo-4IG8009Zu9BIgU,7357
62
62
  semantic_release/version/translator.py,sha256=P1noIsVBn8u6zNOFjG0xKYOWapxqf_PHSMvMeLJ9kXg,3050
63
63
  semantic_release/version/version.py,sha256=6PCtSbLP88U1daoxnCwHc--YguZo4waGNLqJ5JfeczE,14175
64
- python_semantic_release-9.11.0.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
65
- python_semantic_release-9.11.0.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
66
- python_semantic_release-9.11.0.dist-info/METADATA,sha256=gFIbSJMZJhDR8gHc42q-KBJ-rPBRIi7PTv3D-vfBc58,3521
67
- python_semantic_release-9.11.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
68
- python_semantic_release-9.11.0.dist-info/entry_points.txt,sha256=6bS6euSagjerp7onDtfI9_ZpczWreZF3gjHfGAegkbo,123
69
- python_semantic_release-9.11.0.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
70
- python_semantic_release-9.11.0.dist-info/RECORD,,
64
+ python_semantic_release-9.12.0.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
65
+ python_semantic_release-9.12.0.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
66
+ python_semantic_release-9.12.0.dist-info/METADATA,sha256=khksbjRrUdoB-zz8b6j6RoLqbNjtgPbRTCpzm8bOULs,3521
67
+ python_semantic_release-9.12.0.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
68
+ python_semantic_release-9.12.0.dist-info/entry_points.txt,sha256=6bS6euSagjerp7onDtfI9_ZpczWreZF3gjHfGAegkbo,123
69
+ python_semantic_release-9.12.0.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
70
+ python_semantic_release-9.12.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.11.0"
27
+ __version__ = "9.12.0"
28
28
 
29
29
  __all__ = [
30
30
  "CommitParser",
@@ -82,14 +82,19 @@ def make_changelog_context(
82
82
  *hvcs_client.get_changelog_context_filters(),
83
83
  read_file,
84
84
  convert_md_to_rst,
85
+ autofit_text_width,
85
86
  ),
86
87
  )
87
88
 
88
89
 
89
90
  def read_file(filepath: str) -> str:
90
91
  try:
92
+ if not filepath:
93
+ raise FileNotFoundError("No file path provided") # noqa: TRY301
94
+
91
95
  with Path(filepath).open(newline=os.linesep) as rfd:
92
96
  return rfd.read()
97
+
93
98
  except FileNotFoundError as err:
94
99
  logging.warning(err)
95
100
  return ""
@@ -112,3 +117,51 @@ def convert_md_to_rst(md_content: str) -> str:
112
117
  rst_content = pattern.sub(replacement, rst_content)
113
118
 
114
119
  return rst_content
120
+
121
+
122
+ def autofit_text_width(text: str, maxwidth: int = 100, indent_size: int = 0) -> str:
123
+ """Format the description text to fit within a specified width"""
124
+ input_text = text.strip()
125
+
126
+ if len(input_text) <= maxwidth:
127
+ # If the text is already within the maxwidth, return immediately
128
+ return input_text
129
+
130
+ indent = " " * indent_size
131
+ formatted_description = []
132
+
133
+ # Re-format text to fit within the maxwidth
134
+ for paragraph in input_text.split("\n\n"):
135
+ formatted_paragraph = []
136
+
137
+ # Split the paragraph into words with no empty strings
138
+ words = list(
139
+ filter(
140
+ None, paragraph.replace("\r", "").replace("\n", " ").strip().split(" ")
141
+ )
142
+ )
143
+
144
+ # Initialize the line for each paragraph
145
+ line = words[0]
146
+ next_line = ""
147
+
148
+ for word in words[1:]:
149
+ # Check if the current line + the next word (and a space) will fit within the maxwidth
150
+ # If it does, then update the current line
151
+ next_line = f"{line} {word}"
152
+ if len(next_line) <= maxwidth:
153
+ line = next_line
154
+ continue
155
+
156
+ # Add the current line to the paragraph and start a new line
157
+ formatted_paragraph.append(line)
158
+ line = f"{indent}{word}"
159
+
160
+ # Store the last line in the paragraph since it hasn't reached the maxwidth yet
161
+ formatted_paragraph.append(line)
162
+
163
+ #
164
+ formatted_description.append(str.join("\n", formatted_paragraph))
165
+
166
+ # Print the formatted description
167
+ return str.join("\n\n", formatted_description).strip()
@@ -8,6 +8,7 @@ from typing import TYPE_CHECKING, TypedDict
8
8
  from git.objects.tag import TagObject
9
9
 
10
10
  from semantic_release.commit_parser import ParseError
11
+ from semantic_release.enums import LevelBump
11
12
  from semantic_release.version.algorithm import tags_and_versions
12
13
 
13
14
  if TYPE_CHECKING:
@@ -58,20 +59,11 @@ class ReleaseHistory:
58
59
  # we place the key-value mapping type_ to ParseResult as before.
59
60
  # We do this until we encounter a commit which another tag matches.
60
61
 
61
- is_commit_released = False
62
62
  the_version: Version | None = None
63
63
 
64
64
  for commit in repo.iter_commits("HEAD", topo_order=True):
65
- # mypy will be happy if we make this an explicit string
66
- commit_message = str(commit.message)
67
-
68
- parse_result = commit_parser.parse(commit)
69
- commit_type = (
70
- "unknown" if isinstance(parse_result, ParseError) else parse_result.type
71
- )
72
- log.debug("commit has type %s", commit_type)
73
-
74
- log.debug("checking if commit %s matches any tags", commit.hexsha)
65
+ # Determine if we have found another release
66
+ log.debug("checking if commit %s matches any tags", commit.hexsha[:7])
75
67
  t_v = tag_sha_2_version_lookup.get(commit.hexsha, None)
76
68
 
77
69
  if t_v is None:
@@ -82,7 +74,6 @@ class ReleaseHistory:
82
74
  # we have found the latest commit introduced by this tag
83
75
  # so we create a new Release entry
84
76
  log.debug("found commit %s for tag %s", commit.hexsha, tag.name)
85
- is_commit_released = True
86
77
 
87
78
  # tag.object is a Commit if the tag is lightweight, otherwise
88
79
  # it is a TagObject with additional metadata about the tag
@@ -110,27 +101,55 @@ class ReleaseHistory:
110
101
 
111
102
  released.setdefault(the_version, release)
112
103
 
113
- if any(pat.match(commit_message) for pat in exclude_commit_patterns):
114
- log.debug(
115
- "Skipping excluded commit %s (%s)",
116
- commit.hexsha,
117
- commit_message.replace("\n", " ")[:20],
104
+ # mypy will be happy if we make this an explicit string
105
+ commit_message = str(commit.message)
106
+
107
+ log.info(
108
+ "parsing commit [%s] %s",
109
+ commit.hexsha[:8],
110
+ commit_message.replace("\n", " ")[:54],
111
+ )
112
+ parse_result = commit_parser.parse(commit)
113
+ commit_type = (
114
+ "unknown" if isinstance(parse_result, ParseError) else parse_result.type
115
+ )
116
+
117
+ has_exclusion_match = any(
118
+ pattern.match(commit_message) for pattern in exclude_commit_patterns
119
+ )
120
+
121
+ commit_level_bump = (
122
+ LevelBump.NO_RELEASE
123
+ if isinstance(parse_result, ParseError)
124
+ else parse_result.bump
125
+ )
126
+
127
+ # Skip excluded commits except for any commit causing a version bump
128
+ # Reasoning: if a commit causes a version bump, and no other commits
129
+ # are included, then the changelog will be empty. Even if ther was other
130
+ # commits included, the true reason for a version bump would be missing.
131
+ if has_exclusion_match and commit_level_bump == LevelBump.NO_RELEASE:
132
+ log.info(
133
+ "Excluding commit [%s] %s",
134
+ commit.hexsha[:8],
135
+ commit_message.replace("\n", " ")[:50],
118
136
  )
119
137
  continue
120
138
 
121
- if not is_commit_released:
122
- log.debug("adding commit %s to unreleased commits", commit.hexsha)
139
+ if the_version is None:
140
+ log.info(
141
+ "[Unreleased] adding '%s' commit(%s) to list",
142
+ commit.hexsha[:8],
143
+ commit_type,
144
+ )
123
145
  unreleased[commit_type].append(parse_result)
124
146
  continue
125
147
 
126
- if the_version is None:
127
- raise RuntimeError("expected a version to be found")
128
-
129
- log.debug(
130
- "adding commit %s with type %s to release section for %s",
131
- commit.hexsha,
132
- commit_type,
148
+ log.info(
149
+ "[%s] adding '%s' commit(%s) to release",
133
150
  the_version,
151
+ commit_type,
152
+ commit.hexsha[:8],
134
153
  )
135
154
 
136
155
  released[the_version]["elements"][commit_type].append(parse_result)
@@ -92,7 +92,6 @@ class ComplexDirectorySandboxedEnvironment(SandboxedEnvironment):
92
92
  return str(PurePosixPath(parent).parent / template)
93
93
 
94
94
 
95
- # pylint: disable=redefined-outer-name
96
95
  def recursive_render(
97
96
  template_dir: Path,
98
97
  environment: Environment,
@@ -103,13 +102,8 @@ def recursive_render(
103
102
  (Path(root), file)
104
103
  for root, _, files in os.walk(template_dir)
105
104
  for file in files
106
- # we slice relpath.parts[1:] to allow the top-level
107
- # template folder to have a dot prefix.
108
- # e.g. to permit ".github/psr-templates" to contain the templates,
109
- # rather than enforcing a top-level, non-hidden directory
110
105
  if not any(
111
- elem.startswith(".")
112
- for elem in Path(root).relative_to(template_dir).parts[1:]
106
+ elem.startswith(".") for elem in Path(root).relative_to(template_dir).parts
113
107
  )
114
108
  and not file.startswith(".")
115
109
  ):
@@ -12,6 +12,7 @@ from importlib_resources import files
12
12
  import semantic_release
13
13
  from semantic_release.changelog.context import (
14
14
  ReleaseNotesContext,
15
+ autofit_text_width,
15
16
  make_changelog_context,
16
17
  )
17
18
  from semantic_release.changelog.template import environment, recursive_render
@@ -245,7 +246,7 @@ def generate_release_notes(
245
246
  hvcs_type=hvcs_client.__class__.__name__.lower(),
246
247
  version=release["version"],
247
248
  release=release,
248
- filters=(*hvcs_client.get_changelog_context_filters(),),
249
+ filters=(*hvcs_client.get_changelog_context_filters(), autofit_text_width),
249
250
  ).bind_to_environment(
250
251
  # Use a new, non-configurable environment for release notes -
251
252
  # not user-configurable at the moment
@@ -19,7 +19,7 @@ from semantic_release.cli.util import rprint
19
19
  # pass
20
20
 
21
21
 
22
- FORMAT = "[%(name)s] %(levelname)s %(module)s.%(funcName)s: %(message)s"
22
+ FORMAT = "[%(module)s.%(funcName)s] %(message)s"
23
23
 
24
24
 
25
25
  class Cli(click.MultiCommand):
@@ -370,6 +370,22 @@ class RawConfig(BaseModel):
370
370
  )
371
371
  return found_path
372
372
 
373
+ @field_validator("commit_parser", mode="after")
374
+ @classmethod
375
+ def tag_commit_parser_deprecation_warning(cls, val: str) -> str:
376
+ if val == "tag":
377
+ log.warning(
378
+ str.join(
379
+ " ",
380
+ [
381
+ "The legacy 'tag' parser is deprecated and will be removed in v11.",
382
+ "Recommend swapping to our emoji parser (higher-compatibility)",
383
+ "or switch to another supported parser.",
384
+ ],
385
+ )
386
+ )
387
+ return val
388
+
373
389
  @field_validator("build_command_env", mode="after")
374
390
  @classmethod
375
391
  def remove_whitespace(cls, val: list[str]) -> list[str]:
@@ -19,11 +19,11 @@ from semantic_release.enums import LevelBump
19
19
  if TYPE_CHECKING:
20
20
  from git.objects.commit import Commit
21
21
 
22
- log = logging.getLogger(__name__)
22
+ logger = logging.getLogger(__name__)
23
23
 
24
24
 
25
25
  def _logged_parse_error(commit: Commit, error: str) -> ParseError:
26
- log.debug(error)
26
+ logger.debug(error)
27
27
  return ParseError(commit, error=error)
28
28
 
29
29
 
@@ -35,7 +35,7 @@ LONG_TYPE_NAMES = {
35
35
  "chore": "chores",
36
36
  "docs": "documentation",
37
37
  "feat": "features",
38
- "fix": "fixes",
38
+ "fix": "bug fixes",
39
39
  "perf": "performance improvements",
40
40
  "refactor": "refactoring",
41
41
  "style": "code style",
@@ -131,12 +131,15 @@ class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
131
131
  level_bump = LevelBump.PATCH
132
132
  else:
133
133
  level_bump = self.options.default_bump_level
134
- log.debug(
134
+ logger.debug(
135
135
  "commit %s introduces a level bump of %s due to the default_bump_level",
136
- commit.hexsha,
136
+ commit.hexsha[:8],
137
137
  level_bump,
138
138
  )
139
- log.debug("commit %s introduces a %s level_bump", commit.hexsha, level_bump)
139
+
140
+ logger.debug(
141
+ "commit %s introduces a %s level_bump", commit.hexsha[:8], level_bump
142
+ )
140
143
 
141
144
  return ParsedCommit(
142
145
  bump=level_bump,
@@ -89,6 +89,17 @@ class EmojiCommitParser(CommitParser[ParseResult, EmojiParserOptions]):
89
89
  level_bump = LevelBump.MINOR
90
90
  elif primary_emoji in self.options.patch_tags:
91
91
  level_bump = LevelBump.PATCH
92
+ else:
93
+ level_bump = self.options.default_bump_level
94
+ logger.debug(
95
+ "commit %s introduces a level bump of %s due to the default_bump_level",
96
+ commit.hexsha[:8],
97
+ level_bump,
98
+ )
99
+
100
+ logger.debug(
101
+ "commit %s introduces a %s level_bump", commit.hexsha[:8], level_bump
102
+ )
92
103
 
93
104
  # All emojis will remain part of the returned description
94
105
  descriptions = parse_paragraphs(message)
@@ -59,11 +59,11 @@ from semantic_release.enums import LevelBump
59
59
  if TYPE_CHECKING:
60
60
  from git.objects.commit import Commit
61
61
 
62
- log = logging.getLogger(__name__)
62
+ logger = logging.getLogger(__name__)
63
63
 
64
64
 
65
65
  def _logged_parse_error(commit: Commit, error: str) -> ParseError:
66
- log.debug(error)
66
+ logger.debug(error)
67
67
  return ParseError(commit, error=error)
68
68
 
69
69
 
@@ -165,17 +165,19 @@ class ScipyCommitParser(CommitParser[ParseResult, ScipyParserOptions]):
165
165
  level_bump = self.options.tag_to_level.get(
166
166
  tag, self.options.default_level_bump
167
167
  )
168
- log.debug(
169
- "commit %s introduces a %s level_bump", commit.hexsha, level_bump
168
+ logger.debug(
169
+ "commit %s introduces a %s level_bump",
170
+ commit.hexsha[:8],
171
+ level_bump,
170
172
  )
171
173
  break
172
174
  else:
173
175
  # some commits may not have a tag, e.g. if they belong to a PR that
174
176
  # wasn't squashed (for maintainability) ignore them
175
177
  section, level_bump = "None", self.options.default_level_bump
176
- log.debug(
177
- "commit %s introduces a level bump of %s due to the default_bump_level",
178
- commit.hexsha,
178
+ logger.debug(
179
+ "commit %s introduces a level bump of %s due to the default bump level",
180
+ commit.hexsha[:8],
179
181
  level_bump,
180
182
  )
181
183
 
@@ -185,9 +187,9 @@ class ScipyCommitParser(CommitParser[ParseResult, ScipyParserOptions]):
185
187
  ]
186
188
  if migration_instructions:
187
189
  level_bump = LevelBump.MAJOR
188
- log.debug(
189
- "commit %s upgraded to a %s level_bump due to migration_instructions",
190
- commit.hexsha,
190
+ logger.debug(
191
+ "commit %s upgraded to a %s level bump due to included migration instructions",
192
+ commit.hexsha[:8],
191
193
  level_bump,
192
194
  )
193
195
 
@@ -11,7 +11,7 @@ from semantic_release.commit_parser.token import ParsedCommit, ParseError, Parse
11
11
  from semantic_release.commit_parser.util import breaking_re, parse_paragraphs
12
12
  from semantic_release.enums import LevelBump
13
13
 
14
- log = logging.getLogger(__name__)
14
+ logger = logging.getLogger(__name__)
15
15
 
16
16
  re_parser = re.compile(r"(?P<subject>[^\n]+)" + r"(:?\n\n(?P<text>.+))?", re.DOTALL)
17
17
 
@@ -23,7 +23,7 @@ class TagParserOptions(ParserOptions):
23
23
 
24
24
 
25
25
  def _logged_parse_error(commit: Commit, error: str) -> ParseError:
26
- log.debug(error)
26
+ logger.debug(error)
27
27
  return ParseError(commit, error=error)
28
28
 
29
29
 
@@ -87,12 +87,16 @@ class TagCommitParser(CommitParser[ParseResult, TagParserOptions]):
87
87
  if breaking_descriptions:
88
88
  level = "breaking"
89
89
  level_bump = LevelBump.MAJOR
90
- log.debug(
91
- "commit %s upgraded to a %s level_bump due to breaking_descriptions",
92
- commit.hexsha,
90
+ logger.debug(
91
+ "commit %s upgraded to a %s level_bump due to included breaking descriptions",
92
+ commit.hexsha[:8],
93
93
  level_bump,
94
94
  )
95
95
 
96
+ logger.debug(
97
+ "commit %s introduces a %s level_bump", commit.hexsha[:8], level_bump
98
+ )
99
+
96
100
  return ParsedCommit(
97
101
  bump=level_bump,
98
102
  type=level,