python-semantic-release 8.4.0__tar.gz → 8.5.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.
- {python-semantic-release-8.4.0/python_semantic_release.egg-info → python-semantic-release-8.5.1}/PKG-INFO +1 -1
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/pyproject.toml +1 -1
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1/python_semantic_release.egg-info}/PKG-INFO +1 -1
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/__init__.py +1 -1
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/changelog/template.py +14 -8
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/commands/version.py +25 -10
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/config.py +11 -1
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/AUTHORS.rst +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/LICENSE +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/MANIFEST.in +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/README.rst +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/python_semantic_release.egg-info/SOURCES.txt +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/python_semantic_release.egg-info/dependency_links.txt +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/python_semantic_release.egg-info/entry_points.txt +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/python_semantic_release.egg-info/requires.txt +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/python_semantic_release.egg-info/top_level.txt +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/__main__.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/changelog/__init__.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/changelog/context.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/changelog/release_history.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/__init__.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/commands/__init__.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/commands/changelog.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/commands/generate_config.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/commands/main.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/commands/publish.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/common.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/const.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/github_actions_output.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/masking_filter.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/util.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/commit_parser/__init__.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/commit_parser/_base.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/commit_parser/angular.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/commit_parser/emoji.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/commit_parser/scipy.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/commit_parser/tag.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/commit_parser/token.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/commit_parser/util.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/const.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/data/templates/CHANGELOG.md.j2 +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/data/templates/release_notes.md.j2 +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/enums.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/errors.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/helpers.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/__init__.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/_base.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/gitea.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/github.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/gitlab.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/token_auth.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/util.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/version/__init__.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/version/algorithm.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/version/declaration.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/version/translator.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/version/version.py +0 -0
- {python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/setup.cfg +0 -0
|
@@ -81,22 +81,28 @@ def recursive_render(
|
|
|
81
81
|
) -> list[str]:
|
|
82
82
|
rendered_paths: list[str] = []
|
|
83
83
|
for root, file in (
|
|
84
|
-
(root, file)
|
|
84
|
+
(Path(root), file)
|
|
85
85
|
for root, _, files in os.walk(template_dir)
|
|
86
86
|
for file in files
|
|
87
|
-
|
|
87
|
+
# we slice relpath.parts[1:] to allow the top-level
|
|
88
|
+
# template folder to have a dot prefix.
|
|
89
|
+
# e.g. to permit ".github/psr-templates" to contain the templates,
|
|
90
|
+
# rather than enforcing a top-level, non-hidden directory
|
|
91
|
+
if not any(
|
|
92
|
+
elem.startswith(".")
|
|
93
|
+
for elem in Path(root).relative_to(template_dir).parts[1:]
|
|
94
|
+
)
|
|
88
95
|
and not file.startswith(".")
|
|
89
96
|
):
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
os.makedirs(str(output_path), exist_ok=True)
|
|
97
|
+
output_path = (_root_dir / root.relative_to(template_dir)).resolve()
|
|
98
|
+
log.info("Rendering templates from %s to %s", root, output_path)
|
|
99
|
+
output_path.mkdir(parents=True, exist_ok=True)
|
|
94
100
|
if file.endswith(".j2"):
|
|
95
101
|
# We know the file ends with .j2 by the filter in the for-loop
|
|
96
102
|
output_filename = file[:-3]
|
|
97
103
|
# Strip off the template directory from the front of the root path -
|
|
98
104
|
# that's the output location relative to the repo root
|
|
99
|
-
src_file_path = str((
|
|
105
|
+
src_file_path = str((root / file).relative_to(template_dir))
|
|
100
106
|
output_file_path = str((output_path / output_filename).resolve())
|
|
101
107
|
|
|
102
108
|
log.debug("rendering %s to %s", src_file_path, output_file_path)
|
|
@@ -107,7 +113,7 @@ def recursive_render(
|
|
|
107
113
|
|
|
108
114
|
rendered_paths.append(output_file_path)
|
|
109
115
|
else:
|
|
110
|
-
src_file = str((
|
|
116
|
+
src_file = str((root / file).resolve())
|
|
111
117
|
target_file = str((output_path / file).resolve())
|
|
112
118
|
log.debug(
|
|
113
119
|
"source file %s is not a template, copying to %s", src_file, target_file
|
|
@@ -9,6 +9,7 @@ from typing import TYPE_CHECKING, ContextManager, Iterable
|
|
|
9
9
|
|
|
10
10
|
import click
|
|
11
11
|
import shellingham # type: ignore[import]
|
|
12
|
+
from git.exc import GitCommandError
|
|
12
13
|
|
|
13
14
|
from semantic_release.changelog import ReleaseHistory, environment, recursive_render
|
|
14
15
|
from semantic_release.changelog.context import make_changelog_context
|
|
@@ -243,15 +244,13 @@ def version( # noqa: C901
|
|
|
243
244
|
translator.prerelease_token = prerelease_token
|
|
244
245
|
|
|
245
246
|
# Only push if we're committing changes
|
|
246
|
-
if push_changes and not commit_changes:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
push_changes &= commit_changes
|
|
247
|
+
if push_changes and not commit_changes and not create_tag:
|
|
248
|
+
log.info("changes will not be pushed because --no-commit disables pushing")
|
|
249
|
+
push_changes &= commit_changes
|
|
250
250
|
# Only push if we're creating a tag
|
|
251
|
-
if push_changes and not create_tag:
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
push_changes &= create_tag
|
|
251
|
+
if push_changes and not create_tag and not commit_changes:
|
|
252
|
+
log.info("new tag will not be pushed because --no-tag disables pushing")
|
|
253
|
+
push_changes &= create_tag
|
|
255
254
|
# Only make a release if we're pushing the changes
|
|
256
255
|
if make_vcs_release and not push_changes:
|
|
257
256
|
log.info("No vcs release will be created because pushing changes is disabled")
|
|
@@ -371,7 +370,15 @@ def version( # noqa: C901
|
|
|
371
370
|
)
|
|
372
371
|
|
|
373
372
|
elif commit_changes:
|
|
374
|
-
|
|
373
|
+
# TODO: in future this loop should be 1 line:
|
|
374
|
+
# repo.index.add(all_paths_to_add, force=False)
|
|
375
|
+
# but since 'force' is deliberally ineffective (as in docstring) in gitpython 3.1.18
|
|
376
|
+
# we have to do manually add each filepath, and catch the exception if it is an ignored file
|
|
377
|
+
for updated_path in all_paths_to_add:
|
|
378
|
+
try:
|
|
379
|
+
repo.git.add(updated_path)
|
|
380
|
+
except GitCommandError:
|
|
381
|
+
log.warning("Failed to add path (%s) to index", updated_path)
|
|
375
382
|
|
|
376
383
|
rh = ReleaseHistory.from_git_history(
|
|
377
384
|
repo=repo,
|
|
@@ -437,7 +444,15 @@ def version( # noqa: C901
|
|
|
437
444
|
)
|
|
438
445
|
elif commit_changes:
|
|
439
446
|
# Anything changed here should be staged.
|
|
440
|
-
|
|
447
|
+
# TODO: in future this loop should be 1 line:
|
|
448
|
+
# repo.index.add(updated_paths, force=False)
|
|
449
|
+
# but since 'force' is deliberally ineffective (as in docstring) in gitpython 3.1.18
|
|
450
|
+
# we have to do manually add each filepath, and catch the exception if it is an ignored file
|
|
451
|
+
for updated_path in updated_paths:
|
|
452
|
+
try:
|
|
453
|
+
repo.git.add(updated_path)
|
|
454
|
+
except GitCommandError:
|
|
455
|
+
log.warning("Failed to add path (%s) to index", updated_path)
|
|
441
456
|
|
|
442
457
|
def custom_git_environment() -> ContextManager[None]:
|
|
443
458
|
"""
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/config.py
RENAMED
|
@@ -257,8 +257,18 @@ class RuntimeContext:
|
|
|
257
257
|
##
|
|
258
258
|
# credentials masking for logging
|
|
259
259
|
masker = MaskingFilter(_use_named_masks=raw.logging_use_named_masks)
|
|
260
|
+
|
|
261
|
+
try:
|
|
262
|
+
active_branch = repo.active_branch.name
|
|
263
|
+
except TypeError as err:
|
|
264
|
+
raise NotAReleaseBranch(
|
|
265
|
+
"Detached HEAD state cannot match any release groups; "
|
|
266
|
+
"no release will be made"
|
|
267
|
+
) from err
|
|
268
|
+
|
|
260
269
|
# branch-specific configuration
|
|
261
|
-
branch_config = cls.select_branch_options(raw.branches,
|
|
270
|
+
branch_config = cls.select_branch_options(raw.branches, active_branch)
|
|
271
|
+
|
|
262
272
|
# commit_parser
|
|
263
273
|
commit_parser_cls = (
|
|
264
274
|
_known_commit_parsers[raw.commit_parser]
|
|
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
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/common.py
RENAMED
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/const.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/cli/util.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
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/__init__.py
RENAMED
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/_base.py
RENAMED
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/gitea.py
RENAMED
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/github.py
RENAMED
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/gitlab.py
RENAMED
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/token_auth.py
RENAMED
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/hvcs/util.py
RENAMED
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/version/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-semantic-release-8.4.0 → python-semantic-release-8.5.1}/semantic_release/version/version.py
RENAMED
|
File without changes
|
|
File without changes
|