python-semantic-release 9.12.0__py3-none-any.whl → 9.12.2__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.
- {python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/METADATA +6 -5
- python_semantic_release-9.12.2.dist-info/RECORD +71 -0
- python_semantic_release-9.12.2.dist-info/entry_points.txt +3 -0
- semantic_release/__init__.py +1 -1
- semantic_release/__main__.py +38 -2
- semantic_release/changelog/context.py +1 -1
- semantic_release/cli/changelog_writer.py +12 -4
- semantic_release/cli/commands/main.py +4 -0
- semantic_release/cli/commands/version.py +0 -11
- semantic_release/cli/const.py +1 -1
- semantic_release/commit_parser/angular.py +62 -38
- semantic_release/data/templates/angular/md/{.changelog_init.md.j2 → .components/changelog_init.md.j2} +3 -3
- semantic_release/data/templates/angular/md/{.changelog_update.md.j2 → .components/changelog_update.md.j2} +3 -3
- semantic_release/data/templates/angular/md/{.unreleased_changes.md.j2 → .components/unreleased_changes.md.j2} +1 -1
- semantic_release/data/templates/angular/md/{.versioned_changes.md.j2 → .components/versioned_changes.md.j2} +1 -1
- semantic_release/data/templates/angular/md/.release_notes.md.j2 +1 -0
- semantic_release/data/templates/angular/md/CHANGELOG.md.j2 +2 -2
- semantic_release/data/templates/angular/rst/{.changelog_init.rst.j2 → .components/changelog_init.rst.j2} +3 -3
- semantic_release/data/templates/angular/rst/{.changelog_update.rst.j2 → .components/changelog_update.rst.j2} +3 -3
- semantic_release/data/templates/angular/rst/{.changes.rst.j2 → .components/changes.rst.j2} +1 -1
- semantic_release/data/templates/angular/rst/{.unreleased_changes.rst.j2 → .components/unreleased_changes.rst.j2} +1 -1
- semantic_release/data/templates/angular/rst/{.versioned_changes.rst.j2 → .components/versioned_changes.rst.j2} +2 -2
- semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2 +2 -2
- semantic_release/globals.py +6 -0
- semantic_release/hvcs/bitbucket.py +14 -1
- semantic_release/hvcs/gitea.py +27 -2
- semantic_release/hvcs/github.py +27 -2
- semantic_release/hvcs/gitlab.py +28 -4
- python_semantic_release-9.12.0.dist-info/RECORD +0 -70
- python_semantic_release-9.12.0.dist-info/entry_points.txt +0 -3
- semantic_release/data/templates/angular/release_notes.md.j2 +0 -1
- {python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/AUTHORS.rst +0 -0
- {python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/LICENSE +0 -0
- {python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/WHEEL +0 -0
- {python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/top_level.txt +0 -0
- /semantic_release/data/templates/angular/md/{.changelog_header.md.j2 → .components/changelog_header.md.j2} +0 -0
- /semantic_release/data/templates/angular/md/{.changes.md.j2 → .components/changes.md.j2} +0 -0
- /semantic_release/data/templates/angular/rst/{.changelog_header.rst.j2 → .components/changelog_header.rst.j2} +0 -0
- /semantic_release/data/templates/angular/rst/{.macros.rst.j2 → .components/macros.rst.j2} +0 -0
{python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-semantic-release
|
|
3
|
-
Version: 9.12.
|
|
3
|
+
Version: 9.12.2
|
|
4
4
|
Summary: Automatic Semantic Versioning for Python projects
|
|
5
5
|
Author-email: Rolf Erik Lekang <me@rolflekang.com>
|
|
6
6
|
License: MIT
|
|
@@ -50,13 +50,14 @@ Provides-Extra: test
|
|
|
50
50
|
Requires-Dist: coverage[toml]~=7.0; extra == "test"
|
|
51
51
|
Requires-Dist: pyyaml~=6.0; extra == "test"
|
|
52
52
|
Requires-Dist: pytest~=8.3; extra == "test"
|
|
53
|
+
Requires-Dist: pytest-clarity~=1.0; extra == "test"
|
|
54
|
+
Requires-Dist: pytest-cov~=5.0; extra == "test"
|
|
53
55
|
Requires-Dist: pytest-env~=1.0; extra == "test"
|
|
54
|
-
Requires-Dist: pytest-xdist~=3.0; extra == "test"
|
|
55
|
-
Requires-Dist: pytest-mock~=3.0; extra == "test"
|
|
56
56
|
Requires-Dist: pytest-lazy-fixtures~=1.1.1; extra == "test"
|
|
57
|
-
Requires-Dist: pytest-
|
|
57
|
+
Requires-Dist: pytest-mock~=3.0; extra == "test"
|
|
58
|
+
Requires-Dist: pytest-order~=1.3; extra == "test"
|
|
58
59
|
Requires-Dist: pytest-pretty~=1.2; extra == "test"
|
|
59
|
-
Requires-Dist: pytest-
|
|
60
|
+
Requires-Dist: pytest-xdist~=3.0; extra == "test"
|
|
60
61
|
Requires-Dist: responses~=0.25.0; extra == "test"
|
|
61
62
|
Requires-Dist: requests-mock~=1.10; extra == "test"
|
|
62
63
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
semantic_release/__init__.py,sha256=DhNOjxINWOV6dyjCQmaizz8XX9v6ReMVyZLlzmMRtiw,1229
|
|
2
|
+
semantic_release/__main__.py,sha256=kuotDU7aFKrCBeAJUPWrbIxgJWAmrXUMnztCqWMDMPY,1292
|
|
3
|
+
semantic_release/const.py,sha256=Z1o2QNh60wSLeF-_1TemMBjU3ZXbV0XghnUFsbTVfOs,831
|
|
4
|
+
semantic_release/enums.py,sha256=D5B_reQGGKQQT22HO5PUtvn2Bok3fkht6TfJtXkmAUg,1020
|
|
5
|
+
semantic_release/errors.py,sha256=rco5-lwz_0JbJrDsQWmTvT_l3bA3HFkeTmBiZfvCx-Q,2799
|
|
6
|
+
semantic_release/gitproject.py,sha256=izWc4NLdUzAwxGG_fJeqqHW9ivSrPcWBzSaOijQx4f8,8564
|
|
7
|
+
semantic_release/globals.py,sha256=imI9WKGa6MS2pTRAZiWZ2qIJup2eWnBz3OZmIj2YIHM,158
|
|
8
|
+
semantic_release/helpers.py,sha256=d1jOX0SNyqPc_3wr14xR25FfpqhMd4Ev7MNBOWlScc0,5581
|
|
9
|
+
semantic_release/changelog/__init__.py,sha256=Bg6Xe5Vt32rWoMscW-hd4sUwiZqzWmsg4CD1EhMesMY,262
|
|
10
|
+
semantic_release/changelog/context.py,sha256=y37y3M7UmVKwhu9UatNtlo5zNfTOJI8gGOTIzjYXVa8,5023
|
|
11
|
+
semantic_release/changelog/release_history.py,sha256=8RU6A4FMgWwwjndOO4WKjbSzPWgVsYbdcZol1xUPnfo,7815
|
|
12
|
+
semantic_release/changelog/template.py,sha256=J1YJDI_SnXtBbTxoahN0NaVVHN7grOFghLwE9wDjxik,5685
|
|
13
|
+
semantic_release/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
semantic_release/cli/changelog_writer.py,sha256=qucHQylViw61C8Rn3Lafbeyo80cjs2hxaCztd_EgIJ4,8859
|
|
15
|
+
semantic_release/cli/cli_context.py,sha256=23eyV6KWIpUckUSWILEd7t9dixp-QCY5-kGZnyucEYY,4114
|
|
16
|
+
semantic_release/cli/config.py,sha256=0btSbu5KKFZ3HFqR_-WDyToWXljfv1EOuBjBqwwFJcc,30654
|
|
17
|
+
semantic_release/cli/const.py,sha256=h7XE2D0D__TAZSrUUtVszwvzpkHTMOiQCf97XQNbEvA,163
|
|
18
|
+
semantic_release/cli/github_actions_output.py,sha256=VYIOb5x5h8eEJdSlXM_mkhT9xXtYi-RgxvnoM7iUn8s,2288
|
|
19
|
+
semantic_release/cli/masking_filter.py,sha256=DxqjiJyABlzwwwZ1r8JGQpb6QrF00StJFm0-2-s5Fv0,3071
|
|
20
|
+
semantic_release/cli/util.py,sha256=FyXaBkeL7nXKjy3X9rQLEwvn7p46xPekp2V8Z-5MVrk,3755
|
|
21
|
+
semantic_release/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
semantic_release/cli/commands/changelog.py,sha256=kVHcGdfud74-M6hjWf1PS6l95gD4yUlu3CZGBkCt7aY,3765
|
|
23
|
+
semantic_release/cli/commands/generate_config.py,sha256=2xZOu3NpyhBp0pWr7d8ugKl_kjqQgpSsSMHq5wHTfrE,1699
|
|
24
|
+
semantic_release/cli/commands/main.py,sha256=wHG51tbaAHKra21nRe3-FAfQT81-e5PGhv0KnerS15c,4100
|
|
25
|
+
semantic_release/cli/commands/publish.py,sha256=SZQlIewvqyIC14dkIIVVFetE0tPsKbO1cUyxnZsicrw,2845
|
|
26
|
+
semantic_release/cli/commands/version.py,sha256=PKNoP_b8puzcScKkQEbeB3DviJv49cQ-vjq6v25nG9Q,23931
|
|
27
|
+
semantic_release/commit_parser/__init__.py,sha256=cv5HFBdw7OJd4Laj4Ex8ZZ5Tml8GwXgQcXW6Pasr2Ao,615
|
|
28
|
+
semantic_release/commit_parser/_base.py,sha256=t-Z9ALgAe7aZpYXz1mk3Fe-uAvipgKdNrq4Okg_WW9c,3026
|
|
29
|
+
semantic_release/commit_parser/angular.py,sha256=aq8UxCqwernLX2lEGp3Y9OMYMVt_to9rJLEjcscWF34,5911
|
|
30
|
+
semantic_release/commit_parser/emoji.py,sha256=foN7wVDW1Lv7A_cR4mq4X2aas17IEwTgQ8xjUXduN8k,3830
|
|
31
|
+
semantic_release/commit_parser/scipy.py,sha256=p7Ox0GJGtJ3jKroDDW55Iu1Ma2089VegESRcagwDwJw,6028
|
|
32
|
+
semantic_release/commit_parser/tag.py,sha256=4uwIKBqUM2SE6UTGIw-a7B6Jg1OONXmGwXsTyL3yZBA,3490
|
|
33
|
+
semantic_release/commit_parser/token.py,sha256=BB4ZCyt753CCaBFF95cQ4sFm6Au96wpO0YyTAWdcOvE,1609
|
|
34
|
+
semantic_release/commit_parser/util.py,sha256=vLcVDErZrExM55jMffos0hyMbNVQoJ-PeeVDG1Ej51I,730
|
|
35
|
+
semantic_release/data/templates/angular/md/.release_notes.md.j2,sha256=bJeaCDzbva8ntefPPeAS3YD0GXkZv-j0_fIbVmnAKbQ,52
|
|
36
|
+
semantic_release/data/templates/angular/md/CHANGELOG.md.j2,sha256=tFFPsT-EsZHAuSS6xVEAN_Iofu6c-psFoqdyFn_NW2k,838
|
|
37
|
+
semantic_release/data/templates/angular/md/.components/changelog_header.md.j2,sha256=qNxTuSr59CV_yyimVU_RYp5azCnK0l6nJ03Zf0u5Ugg,166
|
|
38
|
+
semantic_release/data/templates/angular/md/.components/changelog_init.md.j2,sha256=d3tS_nCe_ttNQRGl8Jan4H42iJ8hKu03HrfdEdGAh5M,599
|
|
39
|
+
semantic_release/data/templates/angular/md/.components/changelog_update.md.j2,sha256=JhXF-vYlqd4qNI8rO2Hte3Jbemo17wdeZ7w3G2nwjus,2384
|
|
40
|
+
semantic_release/data/templates/angular/md/.components/changes.md.j2,sha256=oC2amekjxsNjgj0BkVzs6ANswxntOi3ItlQd9VtbVm8,339
|
|
41
|
+
semantic_release/data/templates/angular/md/.components/unreleased_changes.md.j2,sha256=HRLj6cyRfPZXC0s-0Av6s0Gp3jKxWg9AIEtIXBVqJuY,177
|
|
42
|
+
semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2,sha256=2Hky2mBrC4jltz3mvaiPDD0KQP0ELe5Ag75HgaLpaIE,257
|
|
43
|
+
semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2,sha256=OQPAKgqTnYGXFyDTm8hwYsMWXfi_z8I5Fsgtw09sWBQ,840
|
|
44
|
+
semantic_release/data/templates/angular/rst/.components/changelog_header.rst.j2,sha256=c9xN1SEYLFwMvPYXYKt-ZbYPn2-Ss0V7zepEtFFj3Os,200
|
|
45
|
+
semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2,sha256=dOICVsTMVLewBDC9QMHhX6Ub9rUFlBAzHOGvsFtNzYY,596
|
|
46
|
+
semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2,sha256=L44PJyCb1xge2wC2-w9cAPCLoJDFVIsm8BnZeQOzg94,2381
|
|
47
|
+
semantic_release/data/templates/angular/rst/.components/changes.rst.j2,sha256=bF9fv3ufFIsAmcCI1GN9eind5Oc3YB1QPw7BFCPtdS8,938
|
|
48
|
+
semantic_release/data/templates/angular/rst/.components/macros.rst.j2,sha256=jTrUMX5TBpUFP5oo2UZTPB-88hX7NMr-LAuddIJdmhw,551
|
|
49
|
+
semantic_release/data/templates/angular/rst/.components/unreleased_changes.rst.j2,sha256=ARBhc1ZpKwehGKDvOMqukmN59mTJiHzHsS7rOfKYCt8,202
|
|
50
|
+
semantic_release/data/templates/angular/rst/.components/versioned_changes.rst.j2,sha256=NZfn1W14QochiAJ43oNKmcrCn_vgfbkKtvOTAw1jEc8,530
|
|
51
|
+
semantic_release/hvcs/__init__.py,sha256=JwoaLOF-12L-OBo_9-tOXXhdiHKeVungA9865to2oZk,494
|
|
52
|
+
semantic_release/hvcs/_base.py,sha256=9-iTqTPSbiEevKbCBP9K2hq4c-2T4wPbeLWe-kAxBzo,2607
|
|
53
|
+
semantic_release/hvcs/bitbucket.py,sha256=DCs2mKGnHO70XGGCcsqJcHMxZawmcNlYDTwu_BSGU24,9667
|
|
54
|
+
semantic_release/hvcs/gitea.py,sha256=lHketfnqwQSwuav4hpDcwYjzfSxOpHK6v-ZwyPxYK-c,12695
|
|
55
|
+
semantic_release/hvcs/github.py,sha256=Q8XxABzcnBC1rINQsdvE-hb2cFoMohl5OY3x9rdxg7o,19917
|
|
56
|
+
semantic_release/hvcs/gitlab.py,sha256=h87bf8TMSvSLkQu-DFdbkHLMv_bG4Cz38YU4Hr-UnBw,9944
|
|
57
|
+
semantic_release/hvcs/remote_hvcs_base.py,sha256=2TaPPp1NzsQjUMOKa0NjqkjYTxJpX245qGm7-GCrnx8,6085
|
|
58
|
+
semantic_release/hvcs/token_auth.py,sha256=ZjT56-NIPB4OKIt1qwHCu1TavXnrWFIBl9ARlg56hgU,663
|
|
59
|
+
semantic_release/hvcs/util.py,sha256=Mgr1dExd6E3qOpeeF8vRX9joP52YV9e82S68z8xa4KM,2859
|
|
60
|
+
semantic_release/version/__init__.py,sha256=CLhtGQry9dLIij5XyRa9ZevxU_1p8tjMTSQ-K_GMpWM,270
|
|
61
|
+
semantic_release/version/algorithm.py,sha256=ofx_bIWq6ptJVr-ekI11IzxzDEctDKFiVwaSmmmgRlE,16870
|
|
62
|
+
semantic_release/version/declaration.py,sha256=f6Ld7hIhrqvDrRBapJHr-KDimuyo-4IG8009Zu9BIgU,7357
|
|
63
|
+
semantic_release/version/translator.py,sha256=P1noIsVBn8u6zNOFjG0xKYOWapxqf_PHSMvMeLJ9kXg,3050
|
|
64
|
+
semantic_release/version/version.py,sha256=6PCtSbLP88U1daoxnCwHc--YguZo4waGNLqJ5JfeczE,14175
|
|
65
|
+
python_semantic_release-9.12.2.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
|
|
66
|
+
python_semantic_release-9.12.2.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
|
|
67
|
+
python_semantic_release-9.12.2.dist-info/METADATA,sha256=ONiKGfUl4d-OGkLjgRYVvT-TG-6QYTxvGGmOhi-pvFY,3571
|
|
68
|
+
python_semantic_release-9.12.2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
|
69
|
+
python_semantic_release-9.12.2.dist-info/entry_points.txt,sha256=r2Jql3GTQyugQnvf34l2eXk1O_Qx6llR_xixG1ZWgD0,105
|
|
70
|
+
python_semantic_release-9.12.2.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
|
|
71
|
+
python_semantic_release-9.12.2.dist-info/RECORD,,
|
semantic_release/__init__.py
CHANGED
semantic_release/__main__.py
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
|
+
"""Entrypoint for the `semantic-release` module."""
|
|
2
|
+
# ruff: noqa: T201, print statements are fine here as this is for cli entry only
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
1
6
|
import sys
|
|
7
|
+
from traceback import format_exception
|
|
8
|
+
|
|
9
|
+
from semantic_release import globals
|
|
10
|
+
from semantic_release.cli.commands.main import main as cli_main
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def main() -> None:
|
|
14
|
+
try:
|
|
15
|
+
cli_main(args=sys.argv[1:])
|
|
16
|
+
print("semantic-release completed successfully.", file=sys.stderr)
|
|
17
|
+
except KeyboardInterrupt:
|
|
18
|
+
print("\n-- User Abort! --", file=sys.stderr)
|
|
19
|
+
sys.exit(127)
|
|
20
|
+
except Exception as err: # noqa: BLE001, graceful error handling across application
|
|
21
|
+
if globals.debug:
|
|
22
|
+
print(f"{err.__class__.__name__}: {err}\n", file=sys.stderr)
|
|
23
|
+
etype, value, traceback = sys.exc_info()
|
|
24
|
+
print(
|
|
25
|
+
str.join(
|
|
26
|
+
"",
|
|
27
|
+
format_exception(
|
|
28
|
+
etype,
|
|
29
|
+
value,
|
|
30
|
+
traceback,
|
|
31
|
+
limit=None,
|
|
32
|
+
chain=True,
|
|
33
|
+
)[:-1],
|
|
34
|
+
),
|
|
35
|
+
file=sys.stderr,
|
|
36
|
+
)
|
|
37
|
+
print(f"::ERROR:: {err}", file=sys.stderr)
|
|
38
|
+
sys.exit(1)
|
|
2
39
|
|
|
3
|
-
from semantic_release.cli.commands.main import main
|
|
4
40
|
|
|
5
41
|
if __name__ == "__main__":
|
|
6
|
-
main(
|
|
42
|
+
main()
|
|
@@ -110,7 +110,7 @@ def convert_md_to_rst(md_content: str) -> str:
|
|
|
110
110
|
# Replace markdown bullets with rst bullets
|
|
111
111
|
"bullets": (regexp(r"^(\s*)-(\s)"), r"\1*\2"),
|
|
112
112
|
# Replace markdown inline raw content with rst inline raw content
|
|
113
|
-
"raw-inline": (regexp(r"(?<=\s)(`[^`]+`)(?![`_])
|
|
113
|
+
"raw-inline": (regexp(r"(?<=\s)(`[^`]+`)(?![`_])"), r"`\1`"),
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
for pattern, replacement in replacements.values():
|
|
@@ -16,6 +16,7 @@ from semantic_release.changelog.context import (
|
|
|
16
16
|
make_changelog_context,
|
|
17
17
|
)
|
|
18
18
|
from semantic_release.changelog.template import environment, recursive_render
|
|
19
|
+
from semantic_release.cli.config import ChangelogOutputFormat
|
|
19
20
|
from semantic_release.cli.const import (
|
|
20
21
|
DEFAULT_CHANGELOG_NAME_STEM,
|
|
21
22
|
DEFAULT_RELEASE_NOTES_TPL_FILE,
|
|
@@ -29,7 +30,7 @@ if TYPE_CHECKING:
|
|
|
29
30
|
|
|
30
31
|
from semantic_release.changelog.context import ChangelogContext
|
|
31
32
|
from semantic_release.changelog.release_history import Release, ReleaseHistory
|
|
32
|
-
from semantic_release.cli.config import
|
|
33
|
+
from semantic_release.cli.config import RuntimeContext
|
|
33
34
|
from semantic_release.hvcs._base import HvcsBase
|
|
34
35
|
|
|
35
36
|
|
|
@@ -193,7 +194,7 @@ def write_changelog_files(
|
|
|
193
194
|
|
|
194
195
|
with suppress(ValueError):
|
|
195
196
|
# do not include a release notes override when considering number of changelog templates
|
|
196
|
-
user_templates.remove(template_dir /
|
|
197
|
+
user_templates.remove(template_dir / DEFAULT_RELEASE_NOTES_TPL_FILE)
|
|
197
198
|
|
|
198
199
|
# Render user templates if found
|
|
199
200
|
if len(user_templates) > 0:
|
|
@@ -226,12 +227,16 @@ def generate_release_notes(
|
|
|
226
227
|
history: ReleaseHistory,
|
|
227
228
|
style: str,
|
|
228
229
|
) -> str:
|
|
229
|
-
users_tpl_file = template_dir /
|
|
230
|
+
users_tpl_file = template_dir / DEFAULT_RELEASE_NOTES_TPL_FILE
|
|
230
231
|
|
|
231
232
|
# Determine if the user has a custom release notes template or we should use
|
|
232
233
|
# the default template directory with our default release notes template
|
|
233
234
|
tpl_dir = (
|
|
234
|
-
template_dir
|
|
235
|
+
template_dir
|
|
236
|
+
if users_tpl_file.is_file()
|
|
237
|
+
else get_default_tpl_dir(
|
|
238
|
+
style=style, sub_dir=ChangelogOutputFormat.MARKDOWN.value
|
|
239
|
+
)
|
|
235
240
|
)
|
|
236
241
|
|
|
237
242
|
release_notes_tpl_file = (
|
|
@@ -257,6 +262,9 @@ def generate_release_notes(
|
|
|
257
262
|
release_notes_env.globals["context"] = {
|
|
258
263
|
"history": history,
|
|
259
264
|
}
|
|
265
|
+
release_notes_env.globals["ctx"] = {
|
|
266
|
+
"history": history,
|
|
267
|
+
}
|
|
260
268
|
|
|
261
269
|
return render_release_notes(
|
|
262
270
|
release_notes_template_file=release_notes_tpl_file,
|
|
@@ -10,6 +10,7 @@ from rich.console import Console
|
|
|
10
10
|
from rich.logging import RichHandler
|
|
11
11
|
|
|
12
12
|
import semantic_release
|
|
13
|
+
from semantic_release import globals
|
|
13
14
|
from semantic_release.cli.cli_context import CliContextObj
|
|
14
15
|
from semantic_release.cli.config import GlobalCommandLineOptions
|
|
15
16
|
from semantic_release.cli.const import DEFAULT_CONFIG_FILE
|
|
@@ -122,6 +123,9 @@ def main(
|
|
|
122
123
|
logger = logging.getLogger(__name__)
|
|
123
124
|
logger.debug("logging level set to: %s", logging.getLevelName(log_level))
|
|
124
125
|
|
|
126
|
+
if log_level == logging.DEBUG:
|
|
127
|
+
globals.debug = True
|
|
128
|
+
|
|
125
129
|
if noop:
|
|
126
130
|
rprint(
|
|
127
131
|
":shield: [bold cyan]You are running in no-operation mode, because the "
|
|
@@ -512,17 +512,6 @@ def version( # noqa: C901
|
|
|
512
512
|
if build_metadata:
|
|
513
513
|
new_version.build_metadata = build_metadata
|
|
514
514
|
|
|
515
|
-
if as_prerelease:
|
|
516
|
-
before_conversion, new_version = (
|
|
517
|
-
new_version,
|
|
518
|
-
new_version.to_prerelease(token=translator.prerelease_token),
|
|
519
|
-
)
|
|
520
|
-
log.info(
|
|
521
|
-
"Converting %s to %s due to '--as-prerelease' command-line option",
|
|
522
|
-
before_conversion,
|
|
523
|
-
new_version,
|
|
524
|
-
)
|
|
525
|
-
|
|
526
515
|
# Update GitHub Actions output value with new version & set delayed write
|
|
527
516
|
gha_output.version = new_version
|
|
528
517
|
ctx.call_on_close(gha_output.write_if_possible)
|
semantic_release/cli/const.py
CHANGED
|
@@ -7,6 +7,8 @@ from __future__ import annotations
|
|
|
7
7
|
|
|
8
8
|
import logging
|
|
9
9
|
import re
|
|
10
|
+
from functools import reduce
|
|
11
|
+
from re import compile as regexp
|
|
10
12
|
from typing import TYPE_CHECKING, Tuple
|
|
11
13
|
|
|
12
14
|
from pydantic.dataclasses import dataclass
|
|
@@ -47,22 +49,28 @@ LONG_TYPE_NAMES = {
|
|
|
47
49
|
class AngularParserOptions(ParserOptions):
|
|
48
50
|
"""Options dataclass for AngularCommitParser"""
|
|
49
51
|
|
|
52
|
+
minor_tags: Tuple[str, ...] = ("feat",)
|
|
53
|
+
patch_tags: Tuple[str, ...] = ("fix", "perf")
|
|
50
54
|
allowed_tags: Tuple[str, ...] = (
|
|
55
|
+
*minor_tags,
|
|
56
|
+
*patch_tags,
|
|
51
57
|
"build",
|
|
52
58
|
"chore",
|
|
53
59
|
"ci",
|
|
54
60
|
"docs",
|
|
55
|
-
"feat",
|
|
56
|
-
"fix",
|
|
57
|
-
"perf",
|
|
58
61
|
"style",
|
|
59
62
|
"refactor",
|
|
60
63
|
"test",
|
|
61
64
|
)
|
|
62
|
-
minor_tags: Tuple[str, ...] = ("feat",)
|
|
63
|
-
patch_tags: Tuple[str, ...] = ("fix", "perf")
|
|
64
65
|
default_bump_level: LevelBump = LevelBump.NO_RELEASE
|
|
65
66
|
|
|
67
|
+
def __post_init__(self) -> None:
|
|
68
|
+
self.tag_to_level = {tag: self.default_bump_level for tag in self.allowed_tags}
|
|
69
|
+
for tag in self.patch_tags:
|
|
70
|
+
self.tag_to_level[tag] = LevelBump.PATCH
|
|
71
|
+
for tag in self.minor_tags:
|
|
72
|
+
self.tag_to_level[tag] = LevelBump.MINOR
|
|
73
|
+
|
|
66
74
|
|
|
67
75
|
class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
|
|
68
76
|
"""
|
|
@@ -75,21 +83,37 @@ class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
|
|
|
75
83
|
|
|
76
84
|
def __init__(self, options: AngularParserOptions | None = None) -> None:
|
|
77
85
|
super().__init__(options)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
all_possible_types = str.join("|", self.options.allowed_tags)
|
|
87
|
+
self.re_parser = regexp(
|
|
88
|
+
str.join(
|
|
89
|
+
"",
|
|
90
|
+
[
|
|
91
|
+
r"(?P<type>%s)" % all_possible_types,
|
|
92
|
+
r"(?:\((?P<scope>[^\n]+)\))?",
|
|
93
|
+
# TODO: remove ! support as it is not part of the angular commit spec (its part of conventional commits spec)
|
|
94
|
+
r"(?P<break>!)?:\s+",
|
|
95
|
+
r"(?P<subject>[^\n]+)",
|
|
96
|
+
r"(?:\n\n(?P<text>.+))?", # commit body
|
|
97
|
+
],
|
|
98
|
+
),
|
|
99
|
+
flags=re.DOTALL,
|
|
87
100
|
)
|
|
88
101
|
|
|
89
102
|
@staticmethod
|
|
90
103
|
def get_default_options() -> AngularParserOptions:
|
|
91
104
|
return AngularParserOptions()
|
|
92
105
|
|
|
106
|
+
def commit_body_components_separator(
|
|
107
|
+
self, accumulator: dict[str, list[str]], text: str
|
|
108
|
+
) -> dict[str, list[str]]:
|
|
109
|
+
if match := breaking_re.match(text):
|
|
110
|
+
accumulator["breaking_descriptions"].append(match.group(1) or "")
|
|
111
|
+
# TODO: breaking change v10, removes breaking change footers from descriptions
|
|
112
|
+
# return accumulator
|
|
113
|
+
|
|
114
|
+
accumulator["descriptions"].append(text)
|
|
115
|
+
return accumulator
|
|
116
|
+
|
|
93
117
|
# Maybe this can be cached as an optimization, similar to how
|
|
94
118
|
# mypy/pytest use their own caching directories, for very large commit
|
|
95
119
|
# histories?
|
|
@@ -111,31 +135,31 @@ class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
|
|
|
111
135
|
parsed_text = parsed.group("text")
|
|
112
136
|
parsed_type = parsed.group("type")
|
|
113
137
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
138
|
+
body_components: dict[str, list[str]] = reduce(
|
|
139
|
+
self.commit_body_components_separator,
|
|
140
|
+
[
|
|
141
|
+
# Insert the subject before the other paragraphs
|
|
142
|
+
parsed_subject,
|
|
143
|
+
*parse_paragraphs(parsed_text or ""),
|
|
144
|
+
],
|
|
145
|
+
{
|
|
146
|
+
"breaking_descriptions": [],
|
|
147
|
+
"descriptions": [],
|
|
148
|
+
},
|
|
149
|
+
)
|
|
117
150
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
151
|
+
level_bump = (
|
|
152
|
+
LevelBump.MAJOR
|
|
153
|
+
# TODO: remove parsed break support as it is not part of the angular commit spec (its part of conventional commits spec)
|
|
154
|
+
if body_components["breaking_descriptions"] or parsed_break
|
|
155
|
+
else self.options.tag_to_level.get(
|
|
156
|
+
parsed_type, self.options.default_bump_level
|
|
157
|
+
)
|
|
158
|
+
)
|
|
124
159
|
|
|
125
|
-
|
|
126
|
-
|
|
160
|
+
# TODO: remove in the future
|
|
161
|
+
if level_bump == LevelBump.MAJOR:
|
|
127
162
|
parsed_type = "breaking"
|
|
128
|
-
elif parsed_type in self.options.minor_tags:
|
|
129
|
-
level_bump = LevelBump.MINOR
|
|
130
|
-
elif parsed_type in self.options.patch_tags:
|
|
131
|
-
level_bump = LevelBump.PATCH
|
|
132
|
-
else:
|
|
133
|
-
level_bump = self.options.default_bump_level
|
|
134
|
-
logger.debug(
|
|
135
|
-
"commit %s introduces a level bump of %s due to the default_bump_level",
|
|
136
|
-
commit.hexsha[:8],
|
|
137
|
-
level_bump,
|
|
138
|
-
)
|
|
139
163
|
|
|
140
164
|
logger.debug(
|
|
141
165
|
"commit %s introduces a %s level_bump", commit.hexsha[:8], level_bump
|
|
@@ -145,7 +169,7 @@ class AngularCommitParser(CommitParser[ParseResult, AngularParserOptions]):
|
|
|
145
169
|
bump=level_bump,
|
|
146
170
|
type=LONG_TYPE_NAMES.get(parsed_type, parsed_type),
|
|
147
171
|
scope=parsed_scope,
|
|
148
|
-
descriptions=descriptions,
|
|
149
|
-
breaking_descriptions=breaking_descriptions,
|
|
172
|
+
descriptions=body_components["descriptions"],
|
|
173
|
+
breaking_descriptions=body_components["breaking_descriptions"],
|
|
150
174
|
commit=commit,
|
|
151
175
|
)
|
|
@@ -7,16 +7,16 @@ it follows the following logic:
|
|
|
7
7
|
|
|
8
8
|
#}{#
|
|
9
9
|
# Header
|
|
10
|
-
#}{% include "
|
|
10
|
+
#}{% include "changelog_header.md.j2"
|
|
11
11
|
-%}{#
|
|
12
12
|
# Any Unreleased Details (uncommon)
|
|
13
|
-
#}{% include "
|
|
13
|
+
#}{% include "unreleased_changes.md.j2"
|
|
14
14
|
-%}{#
|
|
15
15
|
# Since this is initialization, we are generating all the previous
|
|
16
16
|
# release notes per version.
|
|
17
17
|
#}{% for release in context.history.released.values()
|
|
18
18
|
%}{{ "\n"
|
|
19
|
-
}}{% include "
|
|
19
|
+
}}{% include "versioned_changes.md.j2"
|
|
20
20
|
-%}{{ "\n"
|
|
21
21
|
}}{% endfor
|
|
22
22
|
%}
|
|
@@ -20,7 +20,7 @@ This Update changelog template uses the following logic:
|
|
|
20
20
|
#}{{ changelog_parts[0]
|
|
21
21
|
}}{% else
|
|
22
22
|
%}{# # File was empty or did not exist, therefore, it will be created from scratch
|
|
23
|
-
#}{% include "
|
|
23
|
+
#}{% include "changelog_init.md.j2"
|
|
24
24
|
%}{% endif
|
|
25
25
|
%}{% else
|
|
26
26
|
%}{#
|
|
@@ -39,14 +39,14 @@ This Update changelog template uses the following logic:
|
|
|
39
39
|
}}{% endif
|
|
40
40
|
%}{#
|
|
41
41
|
# Any Unreleased Details (uncommon)
|
|
42
|
-
#}{% include "
|
|
42
|
+
#}{% include "unreleased_changes.md.j2"
|
|
43
43
|
-%}{#
|
|
44
44
|
# Latest Release Details
|
|
45
45
|
#}{% for release in new_releases
|
|
46
46
|
%}{# # Check if the release version is already in the changelog and if not, add it
|
|
47
47
|
#}{% if "# " ~ release.version.as_semver_tag() ~ " " not in changelog_parts[1]
|
|
48
48
|
%}{{ "\n"
|
|
49
|
-
}}{%- include "
|
|
49
|
+
}}{%- include "versioned_changes.md.j2"
|
|
50
50
|
-%}{{ "\n"
|
|
51
51
|
}}{% endif
|
|
52
52
|
%}{% endfor
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include ".components/versioned_changes.md.j2" %}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
%}{% set unreleased_commits = ctx.history.unreleased | dictsort
|
|
11
11
|
%}{#
|
|
12
12
|
#}{% if ctx.changelog_mode == "init"
|
|
13
|
-
%}{% include ".changelog_init.md.j2"
|
|
13
|
+
%}{% include ".components/changelog_init.md.j2"
|
|
14
14
|
%}{#
|
|
15
15
|
#}{% elif ctx.changelog_mode == "update"
|
|
16
16
|
%}{% set prev_changelog_file = ctx.prev_changelog_file
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
%}{% if ctx.history.released.values() | length > 0
|
|
19
19
|
%}{% set new_releases = [ctx.history.released.values() | first]
|
|
20
20
|
%}{% endif
|
|
21
|
-
%}{% include ".changelog_update.md.j2"
|
|
21
|
+
%}{% include ".components/changelog_update.md.j2"
|
|
22
22
|
%}{#
|
|
23
23
|
#}{% endif
|
|
24
24
|
%}
|
|
@@ -7,16 +7,16 @@ it follows the following logic:
|
|
|
7
7
|
|
|
8
8
|
#}{#
|
|
9
9
|
# Header
|
|
10
|
-
#}{% include "
|
|
10
|
+
#}{% include "changelog_header.rst.j2"
|
|
11
11
|
-%}{#
|
|
12
12
|
# Any Unreleased Details (uncommon)
|
|
13
|
-
#}{% include "
|
|
13
|
+
#}{% include "unreleased_changes.rst.j2"
|
|
14
14
|
%}{#
|
|
15
15
|
# Since this is initialization, we are generating all the previous
|
|
16
16
|
# release notes per version.
|
|
17
17
|
#}{% for release in context.history.released.values()
|
|
18
18
|
%}{{ "\n"
|
|
19
|
-
}}{% include "
|
|
19
|
+
}}{% include "versioned_changes.rst.j2"
|
|
20
20
|
-%}{{ "\n"
|
|
21
21
|
}}{% endfor
|
|
22
22
|
%}
|
|
@@ -20,7 +20,7 @@ This Update changelog template uses the following logic:
|
|
|
20
20
|
#}{{ changelog_parts[0]
|
|
21
21
|
}}{% else
|
|
22
22
|
%}{# # File was empty or did not exist, therefore, it will be created from scratch
|
|
23
|
-
#}{% include "
|
|
23
|
+
#}{% include "changelog_init.rst.j2"
|
|
24
24
|
%}{% endif
|
|
25
25
|
%}{% else
|
|
26
26
|
%}{#
|
|
@@ -39,14 +39,14 @@ This Update changelog template uses the following logic:
|
|
|
39
39
|
}}{% endif
|
|
40
40
|
%}{#
|
|
41
41
|
# Any Unreleased Details (uncommon)
|
|
42
|
-
#}{% include "
|
|
42
|
+
#}{% include "unreleased_changes.rst.j2"
|
|
43
43
|
-%}{#
|
|
44
44
|
# Latest Release Details
|
|
45
45
|
#}{% for release in new_releases
|
|
46
46
|
%}{# # Check if the release version is already in the changelog and if not, add it
|
|
47
47
|
#}{% if release.version.as_semver_tag() ~ " (" not in changelog_parts[1]
|
|
48
48
|
%}{{ "\n"
|
|
49
|
-
}}{%- include "
|
|
49
|
+
}}{%- include "versioned_changes.rst.j2"
|
|
50
50
|
-%}{{ "\n"
|
|
51
51
|
}}{% endif
|
|
52
52
|
%}{% endfor
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{% from '
|
|
1
|
+
{% from 'macros.rst.j2' import generate_heading_underline %}{#
|
|
2
2
|
|
|
3
3
|
.. _changelog-X.X.X:
|
|
4
4
|
|
|
@@ -19,5 +19,5 @@ vX.X.X (YYYY-MMM-DD)
|
|
|
19
19
|
{#
|
|
20
20
|
|
|
21
21
|
#}{% set commit_objects = release["elements"] | dictsort
|
|
22
|
-
%}{% include "
|
|
22
|
+
%}{% include "changes.rst.j2"
|
|
23
23
|
-%}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
%}{% set unreleased_commits = ctx.history.unreleased | dictsort
|
|
11
11
|
%}{#
|
|
12
12
|
#}{% if ctx.changelog_mode == "init"
|
|
13
|
-
%}{% include ".changelog_init.rst.j2"
|
|
13
|
+
%}{% include ".components/changelog_init.rst.j2"
|
|
14
14
|
%}{#
|
|
15
15
|
#}{% elif ctx.changelog_mode == "update"
|
|
16
16
|
%}{% set prev_changelog_file = ctx.prev_changelog_file
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
%}{% if ctx.history.released.values() | length > 0
|
|
19
19
|
%}{% set new_releases = [ctx.history.released.values() | first]
|
|
20
20
|
%}{% endif
|
|
21
|
-
%}{% include ".changelog_update.rst.j2"
|
|
21
|
+
%}{% include ".components/changelog_update.rst.j2"
|
|
22
22
|
%}{#
|
|
23
23
|
#}{% endif
|
|
24
24
|
%}
|
|
@@ -9,6 +9,7 @@ import logging
|
|
|
9
9
|
import os
|
|
10
10
|
from functools import lru_cache
|
|
11
11
|
from pathlib import PurePosixPath
|
|
12
|
+
from re import compile as regexp
|
|
12
13
|
from typing import TYPE_CHECKING
|
|
13
14
|
|
|
14
15
|
from urllib3.util.url import Url, parse_url
|
|
@@ -201,7 +202,19 @@ class Bitbucket(RemoteHvcsBase):
|
|
|
201
202
|
return self.create_repo_url(repo_path=f"/commits/{commit_hash}")
|
|
202
203
|
|
|
203
204
|
def pull_request_url(self, pr_number: str | int) -> str:
|
|
204
|
-
|
|
205
|
+
# Strips off any character prefix like '#' that usually exists
|
|
206
|
+
if isinstance(pr_number, str) and (
|
|
207
|
+
match := regexp(r"(\d+)$").search(pr_number)
|
|
208
|
+
):
|
|
209
|
+
try:
|
|
210
|
+
pr_number = int(match.group(1))
|
|
211
|
+
except ValueError:
|
|
212
|
+
return ""
|
|
213
|
+
|
|
214
|
+
if isinstance(pr_number, int):
|
|
215
|
+
return self.create_repo_url(repo_path=f"/pull-requests/{pr_number}")
|
|
216
|
+
|
|
217
|
+
return ""
|
|
205
218
|
|
|
206
219
|
def get_changelog_context_filters(self) -> tuple[Callable[..., Any], ...]:
|
|
207
220
|
return (
|
semantic_release/hvcs/gitea.py
CHANGED
|
@@ -6,6 +6,7 @@ import glob
|
|
|
6
6
|
import logging
|
|
7
7
|
import os
|
|
8
8
|
from pathlib import PurePosixPath
|
|
9
|
+
from re import compile as regexp
|
|
9
10
|
from typing import TYPE_CHECKING
|
|
10
11
|
|
|
11
12
|
from requests import HTTPError, JSONDecodeError
|
|
@@ -350,10 +351,34 @@ class Gitea(RemoteHvcsBase):
|
|
|
350
351
|
return self.create_repo_url(repo_path=f"/commit/{commit_hash}")
|
|
351
352
|
|
|
352
353
|
def issue_url(self, issue_num: str | int) -> str:
|
|
353
|
-
|
|
354
|
+
# Strips off any character prefix like '#' that usually exists
|
|
355
|
+
if isinstance(issue_num, str) and (
|
|
356
|
+
match := regexp(r"(\d+)$").search(issue_num)
|
|
357
|
+
):
|
|
358
|
+
try:
|
|
359
|
+
issue_num = int(match.group(1))
|
|
360
|
+
except ValueError:
|
|
361
|
+
return ""
|
|
362
|
+
|
|
363
|
+
if isinstance(issue_num, int):
|
|
364
|
+
return self.create_repo_url(repo_path=f"/issues/{issue_num}")
|
|
365
|
+
|
|
366
|
+
return ""
|
|
354
367
|
|
|
355
368
|
def pull_request_url(self, pr_number: str | int) -> str:
|
|
356
|
-
|
|
369
|
+
# Strips off any character prefix like '#' that usually exists
|
|
370
|
+
if isinstance(pr_number, str) and (
|
|
371
|
+
match := regexp(r"(\d+)$").search(pr_number)
|
|
372
|
+
):
|
|
373
|
+
try:
|
|
374
|
+
pr_number = int(match.group(1))
|
|
375
|
+
except ValueError:
|
|
376
|
+
return ""
|
|
377
|
+
|
|
378
|
+
if isinstance(pr_number, int):
|
|
379
|
+
return self.create_repo_url(repo_path=f"/pulls/{pr_number}")
|
|
380
|
+
|
|
381
|
+
return ""
|
|
357
382
|
|
|
358
383
|
def get_changelog_context_filters(self) -> tuple[Callable[..., Any], ...]:
|
|
359
384
|
return (
|
semantic_release/hvcs/github.py
CHANGED
|
@@ -8,6 +8,7 @@ import mimetypes
|
|
|
8
8
|
import os
|
|
9
9
|
from functools import lru_cache
|
|
10
10
|
from pathlib import PurePosixPath
|
|
11
|
+
from re import compile as regexp
|
|
11
12
|
from typing import TYPE_CHECKING
|
|
12
13
|
|
|
13
14
|
from requests import HTTPError, JSONDecodeError
|
|
@@ -501,10 +502,34 @@ class Github(RemoteHvcsBase):
|
|
|
501
502
|
return self.create_repo_url(repo_path=f"/commit/{commit_hash}")
|
|
502
503
|
|
|
503
504
|
def issue_url(self, issue_num: str | int) -> str:
|
|
504
|
-
|
|
505
|
+
# Strips off any character prefix like '#' that usually exists
|
|
506
|
+
if isinstance(issue_num, str) and (
|
|
507
|
+
match := regexp(r"(\d+)$").search(issue_num)
|
|
508
|
+
):
|
|
509
|
+
try:
|
|
510
|
+
issue_num = int(match.group(1))
|
|
511
|
+
except ValueError:
|
|
512
|
+
return ""
|
|
513
|
+
|
|
514
|
+
if isinstance(issue_num, int):
|
|
515
|
+
return self.create_repo_url(repo_path=f"/issues/{issue_num}")
|
|
516
|
+
|
|
517
|
+
return ""
|
|
505
518
|
|
|
506
519
|
def pull_request_url(self, pr_number: str | int) -> str:
|
|
507
|
-
|
|
520
|
+
# Strips off any character prefix like '#' that usually exists
|
|
521
|
+
if isinstance(pr_number, str) and (
|
|
522
|
+
match := regexp(r"(\d+)$").search(pr_number)
|
|
523
|
+
):
|
|
524
|
+
try:
|
|
525
|
+
pr_number = int(match.group(1))
|
|
526
|
+
except ValueError:
|
|
527
|
+
return ""
|
|
528
|
+
|
|
529
|
+
if isinstance(pr_number, int):
|
|
530
|
+
return self.create_repo_url(repo_path=f"/pull/{pr_number}")
|
|
531
|
+
|
|
532
|
+
return ""
|
|
508
533
|
|
|
509
534
|
def get_changelog_context_filters(self) -> tuple[Callable[..., Any], ...]:
|
|
510
535
|
return (
|
semantic_release/hvcs/gitlab.py
CHANGED
|
@@ -6,6 +6,7 @@ import logging
|
|
|
6
6
|
import os
|
|
7
7
|
from functools import lru_cache
|
|
8
8
|
from pathlib import PurePosixPath
|
|
9
|
+
from re import compile as regexp
|
|
9
10
|
from typing import TYPE_CHECKING
|
|
10
11
|
|
|
11
12
|
import gitlab
|
|
@@ -239,14 +240,37 @@ class Gitlab(RemoteHvcsBase):
|
|
|
239
240
|
def commit_hash_url(self, commit_hash: str) -> str:
|
|
240
241
|
return self.create_repo_url(repo_path=f"/-/commit/{commit_hash}")
|
|
241
242
|
|
|
242
|
-
def issue_url(self,
|
|
243
|
-
|
|
243
|
+
def issue_url(self, issue_num: str | int) -> str:
|
|
244
|
+
# Strips off any character prefix like '#' that usually exists
|
|
245
|
+
if isinstance(issue_num, str) and (
|
|
246
|
+
match := regexp(r"(\d+)$").search(issue_num)
|
|
247
|
+
):
|
|
248
|
+
try:
|
|
249
|
+
issue_num = int(match.group(1))
|
|
250
|
+
except ValueError:
|
|
251
|
+
return ""
|
|
252
|
+
|
|
253
|
+
if isinstance(issue_num, int):
|
|
254
|
+
return self.create_repo_url(repo_path=f"/-/issues/{issue_num}")
|
|
255
|
+
|
|
256
|
+
return ""
|
|
244
257
|
|
|
245
258
|
def merge_request_url(self, mr_number: str | int) -> str:
|
|
246
|
-
|
|
259
|
+
# Strips off any character prefix like '!' that usually exists
|
|
260
|
+
if isinstance(mr_number, str) and (
|
|
261
|
+
match := regexp(r"(\d+)$").search(mr_number)
|
|
262
|
+
):
|
|
263
|
+
try:
|
|
264
|
+
mr_number = int(match.group(1))
|
|
265
|
+
except ValueError:
|
|
266
|
+
return ""
|
|
267
|
+
|
|
268
|
+
if isinstance(mr_number, int):
|
|
269
|
+
return self.create_repo_url(repo_path=f"/-/merge_requests/{mr_number}")
|
|
270
|
+
|
|
271
|
+
return ""
|
|
247
272
|
|
|
248
273
|
def pull_request_url(self, pr_number: str | int) -> str:
|
|
249
|
-
# TODO: deprecate in v11, add warning in v10
|
|
250
274
|
return self.merge_request_url(mr_number=pr_number)
|
|
251
275
|
|
|
252
276
|
def upload_dists(self, tag: str, dist_glob: str) -> int:
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
semantic_release/__init__.py,sha256=fxw583b6ABCDlk6pC_P4cyeIArzuHA6rwYTigF1nq-U,1229
|
|
2
|
-
semantic_release/__main__.py,sha256=blPn7CMpuSe4Z-GBIDv0QA0OEDTMGU-7edsLRkkhPR4,120
|
|
3
|
-
semantic_release/const.py,sha256=Z1o2QNh60wSLeF-_1TemMBjU3ZXbV0XghnUFsbTVfOs,831
|
|
4
|
-
semantic_release/enums.py,sha256=D5B_reQGGKQQT22HO5PUtvn2Bok3fkht6TfJtXkmAUg,1020
|
|
5
|
-
semantic_release/errors.py,sha256=rco5-lwz_0JbJrDsQWmTvT_l3bA3HFkeTmBiZfvCx-Q,2799
|
|
6
|
-
semantic_release/gitproject.py,sha256=izWc4NLdUzAwxGG_fJeqqHW9ivSrPcWBzSaOijQx4f8,8564
|
|
7
|
-
semantic_release/helpers.py,sha256=d1jOX0SNyqPc_3wr14xR25FfpqhMd4Ev7MNBOWlScc0,5581
|
|
8
|
-
semantic_release/changelog/__init__.py,sha256=Bg6Xe5Vt32rWoMscW-hd4sUwiZqzWmsg4CD1EhMesMY,262
|
|
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
|
-
semantic_release/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
semantic_release/cli/changelog_writer.py,sha256=oCqsAZPIjv4vXxnm5p49dUUx1mlnE93cg9ma8aR40NY,8673
|
|
14
|
-
semantic_release/cli/cli_context.py,sha256=23eyV6KWIpUckUSWILEd7t9dixp-QCY5-kGZnyucEYY,4114
|
|
15
|
-
semantic_release/cli/config.py,sha256=0btSbu5KKFZ3HFqR_-WDyToWXljfv1EOuBjBqwwFJcc,30654
|
|
16
|
-
semantic_release/cli/const.py,sha256=haTpNlJifrtbwICwF1u0MNyB0kDsqGUsfM2zwuDu4RM,162
|
|
17
|
-
semantic_release/cli/github_actions_output.py,sha256=VYIOb5x5h8eEJdSlXM_mkhT9xXtYi-RgxvnoM7iUn8s,2288
|
|
18
|
-
semantic_release/cli/masking_filter.py,sha256=DxqjiJyABlzwwwZ1r8JGQpb6QrF00StJFm0-2-s5Fv0,3071
|
|
19
|
-
semantic_release/cli/util.py,sha256=FyXaBkeL7nXKjy3X9rQLEwvn7p46xPekp2V8Z-5MVrk,3755
|
|
20
|
-
semantic_release/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
-
semantic_release/cli/commands/changelog.py,sha256=kVHcGdfud74-M6hjWf1PS6l95gD4yUlu3CZGBkCt7aY,3765
|
|
22
|
-
semantic_release/cli/commands/generate_config.py,sha256=2xZOu3NpyhBp0pWr7d8ugKl_kjqQgpSsSMHq5wHTfrE,1699
|
|
23
|
-
semantic_release/cli/commands/main.py,sha256=OhcVrdRVKpDhvZxEfzPMmApZspPDFFFFZ02liFJ6tiA,3998
|
|
24
|
-
semantic_release/cli/commands/publish.py,sha256=SZQlIewvqyIC14dkIIVVFetE0tPsKbO1cUyxnZsicrw,2845
|
|
25
|
-
semantic_release/cli/commands/version.py,sha256=4ZfF2zbwnSNlVewfyXI1UrlvxJJFSI3A3xGo6Vg8CC0,24270
|
|
26
|
-
semantic_release/commit_parser/__init__.py,sha256=cv5HFBdw7OJd4Laj4Ex8ZZ5Tml8GwXgQcXW6Pasr2Ao,615
|
|
27
|
-
semantic_release/commit_parser/_base.py,sha256=t-Z9ALgAe7aZpYXz1mk3Fe-uAvipgKdNrq4Okg_WW9c,3026
|
|
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
|
-
semantic_release/commit_parser/token.py,sha256=BB4ZCyt753CCaBFF95cQ4sFm6Au96wpO0YyTAWdcOvE,1609
|
|
33
|
-
semantic_release/commit_parser/util.py,sha256=vLcVDErZrExM55jMffos0hyMbNVQoJ-PeeVDG1Ej51I,730
|
|
34
|
-
semantic_release/data/templates/angular/release_notes.md.j2,sha256=ftg0pFkmGYlb9UH2waSLc6neC8rPMMCqblJaQeq4vTg,46
|
|
35
|
-
semantic_release/data/templates/angular/md/.changelog_header.md.j2,sha256=qNxTuSr59CV_yyimVU_RYp5azCnK0l6nJ03Zf0u5Ugg,166
|
|
36
|
-
semantic_release/data/templates/angular/md/.changelog_init.md.j2,sha256=mIV6AuZmB6BGl_hBDGM9ea_CG5BV7HqI3Ko9jsn7zMs,602
|
|
37
|
-
semantic_release/data/templates/angular/md/.changelog_update.md.j2,sha256=zLYWNQclZ7j13ay04myQW3FtlwobgwDrj9y3EzNJRAw,2387
|
|
38
|
-
semantic_release/data/templates/angular/md/.changes.md.j2,sha256=oC2amekjxsNjgj0BkVzs6ANswxntOi3ItlQd9VtbVm8,339
|
|
39
|
-
semantic_release/data/templates/angular/md/.unreleased_changes.md.j2,sha256=8CGiPvJEzrjNyqdDFjRGNlLpjIFGiMccPKPmi-vdGTI,178
|
|
40
|
-
semantic_release/data/templates/angular/md/.versioned_changes.md.j2,sha256=K2J5GHTBUffPxZ-FSoewHkwNJtuPidZA83hEGtpk7rg,258
|
|
41
|
-
semantic_release/data/templates/angular/md/CHANGELOG.md.j2,sha256=LjSFwb3QROfj3PZY-2qeMBSlbnP7vf2L9Qc_4-FX68Y,816
|
|
42
|
-
semantic_release/data/templates/angular/rst/.changelog_header.rst.j2,sha256=c9xN1SEYLFwMvPYXYKt-ZbYPn2-Ss0V7zepEtFFj3Os,200
|
|
43
|
-
semantic_release/data/templates/angular/rst/.changelog_init.rst.j2,sha256=kFFm5dQqKvENUP9w-FpIpdiw0bCuxmFdMX9LNDn4AX0,599
|
|
44
|
-
semantic_release/data/templates/angular/rst/.changelog_update.rst.j2,sha256=U4xnOehAe94CcPEKFelkJyqZ_sH-katKqLo-o9QQduo,2384
|
|
45
|
-
semantic_release/data/templates/angular/rst/.changes.rst.j2,sha256=9de_YbxmuvI2EBFYX1UmT9zRjfmd_X8vsiUCbiiikZg,939
|
|
46
|
-
semantic_release/data/templates/angular/rst/.macros.rst.j2,sha256=jTrUMX5TBpUFP5oo2UZTPB-88hX7NMr-LAuddIJdmhw,551
|
|
47
|
-
semantic_release/data/templates/angular/rst/.unreleased_changes.rst.j2,sha256=GScpwoAmN-R2Kzwwbo65wp5FCsQadS_GeyeWYHcCMHw,203
|
|
48
|
-
semantic_release/data/templates/angular/rst/.versioned_changes.rst.j2,sha256=NyFcDFi51xa-VMb22XtYopqpqI-nwBfruMGWli4cvO0,532
|
|
49
|
-
semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2,sha256=TVpi9ky7yuifldEZN2EJq46Jz3TtdQUvCdx4gBKnfH4,818
|
|
50
|
-
semantic_release/hvcs/__init__.py,sha256=JwoaLOF-12L-OBo_9-tOXXhdiHKeVungA9865to2oZk,494
|
|
51
|
-
semantic_release/hvcs/_base.py,sha256=9-iTqTPSbiEevKbCBP9K2hq4c-2T4wPbeLWe-kAxBzo,2607
|
|
52
|
-
semantic_release/hvcs/bitbucket.py,sha256=nqlOmeNda0sRSEBGWMluphy1KlpRTQrHV7itxf0IXE0,9266
|
|
53
|
-
semantic_release/hvcs/gitea.py,sha256=nJ1jdoOuNh_Xbcxc0R_vtLkeBmQ03FxewgBWx0kyUFI,11926
|
|
54
|
-
semantic_release/hvcs/github.py,sha256=TVXlviaXn2N_DBH0GxvIhTH-SQdn5mxbkjgu8rvb1y0,19148
|
|
55
|
-
semantic_release/hvcs/gitlab.py,sha256=f8mr9NoExphi4tZr4WSwwfkKxEmf356w_k_f2krACqQ,9234
|
|
56
|
-
semantic_release/hvcs/remote_hvcs_base.py,sha256=2TaPPp1NzsQjUMOKa0NjqkjYTxJpX245qGm7-GCrnx8,6085
|
|
57
|
-
semantic_release/hvcs/token_auth.py,sha256=ZjT56-NIPB4OKIt1qwHCu1TavXnrWFIBl9ARlg56hgU,663
|
|
58
|
-
semantic_release/hvcs/util.py,sha256=Mgr1dExd6E3qOpeeF8vRX9joP52YV9e82S68z8xa4KM,2859
|
|
59
|
-
semantic_release/version/__init__.py,sha256=CLhtGQry9dLIij5XyRa9ZevxU_1p8tjMTSQ-K_GMpWM,270
|
|
60
|
-
semantic_release/version/algorithm.py,sha256=ofx_bIWq6ptJVr-ekI11IzxzDEctDKFiVwaSmmmgRlE,16870
|
|
61
|
-
semantic_release/version/declaration.py,sha256=f6Ld7hIhrqvDrRBapJHr-KDimuyo-4IG8009Zu9BIgU,7357
|
|
62
|
-
semantic_release/version/translator.py,sha256=P1noIsVBn8u6zNOFjG0xKYOWapxqf_PHSMvMeLJ9kXg,3050
|
|
63
|
-
semantic_release/version/version.py,sha256=6PCtSbLP88U1daoxnCwHc--YguZo4waGNLqJ5JfeczE,14175
|
|
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,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{% include "./md/.versioned_changes.md.j2" %}
|
{python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/AUTHORS.rst
RENAMED
|
File without changes
|
{python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
{python_semantic_release-9.12.0.dist-info → python_semantic_release-9.12.2.dist-info}/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|