python-semantic-release 9.13.0__py3-none-any.whl → 9.14.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.
Files changed (26) hide show
  1. {python_semantic_release-9.13.0.dist-info → python_semantic_release-9.14.0.dist-info}/METADATA +2 -2
  2. {python_semantic_release-9.13.0.dist-info → python_semantic_release-9.14.0.dist-info}/RECORD +26 -24
  3. semantic_release/__init__.py +1 -1
  4. semantic_release/changelog/context.py +9 -0
  5. semantic_release/cli/changelog_writer.py +5 -4
  6. semantic_release/cli/commands/changelog.py +1 -0
  7. semantic_release/cli/commands/version.py +1 -0
  8. semantic_release/cli/config.py +4 -0
  9. semantic_release/data/templates/angular/md/.components/changelog_init.md.j2 +14 -7
  10. semantic_release/data/templates/angular/md/.components/changelog_update.md.j2 +16 -7
  11. semantic_release/data/templates/angular/md/.components/changes.md.j2 +3 -3
  12. semantic_release/data/templates/angular/md/.components/first_release.md.j2 +11 -0
  13. semantic_release/data/templates/angular/md/.components/macros.md.j2 +28 -7
  14. semantic_release/data/templates/angular/md/.release_notes.md.j2 +13 -1
  15. semantic_release/data/templates/angular/md/CHANGELOG.md.j2 +0 -4
  16. semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2 +19 -12
  17. semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2 +16 -7
  18. semantic_release/data/templates/angular/rst/.components/changes.rst.j2 +3 -3
  19. semantic_release/data/templates/angular/rst/.components/first_release.rst.j2 +20 -0
  20. semantic_release/data/templates/angular/rst/.components/macros.rst.j2 +16 -4
  21. semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2 +1 -4
  22. {python_semantic_release-9.13.0.dist-info → python_semantic_release-9.14.0.dist-info}/AUTHORS.rst +0 -0
  23. {python_semantic_release-9.13.0.dist-info → python_semantic_release-9.14.0.dist-info}/LICENSE +0 -0
  24. {python_semantic_release-9.13.0.dist-info → python_semantic_release-9.14.0.dist-info}/WHEEL +0 -0
  25. {python_semantic_release-9.13.0.dist-info → python_semantic_release-9.14.0.dist-info}/entry_points.txt +0 -0
  26. {python_semantic_release-9.13.0.dist-info → python_semantic_release-9.14.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 9.13.0
3
+ Version: 9.14.0
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -44,7 +44,7 @@ Requires-Dist: sphinxcontrib-apidoc==0.5.0; extra == "docs"
44
44
  Requires-Dist: sphinx-autobuild==2024.2.4; extra == "docs"
45
45
  Requires-Dist: furo~=2024.1; extra == "docs"
46
46
  Provides-Extra: mypy
47
- Requires-Dist: mypy==1.11.2; extra == "mypy"
47
+ Requires-Dist: mypy==1.13.0; extra == "mypy"
48
48
  Requires-Dist: types-requests~=2.32.0; extra == "mypy"
49
49
  Provides-Extra: test
50
50
  Requires-Dist: coverage[toml]~=7.0; extra == "test"
@@ -1,4 +1,4 @@
1
- semantic_release/__init__.py,sha256=HkSV-d4oTywSXoJB6atMrEkQnimWPdJJGqSSrFeYjQQ,1229
1
+ semantic_release/__init__.py,sha256=kHQQzNnUYSMycf0e29x0t_WKKyKzPNRw9RkN73SVOpw,1229
2
2
  semantic_release/__main__.py,sha256=kuotDU7aFKrCBeAJUPWrbIxgJWAmrXUMnztCqWMDMPY,1292
3
3
  semantic_release/const.py,sha256=Z1o2QNh60wSLeF-_1TemMBjU3ZXbV0XghnUFsbTVfOs,831
4
4
  semantic_release/enums.py,sha256=D5B_reQGGKQQT22HO5PUtvn2Bok3fkht6TfJtXkmAUg,1020
@@ -7,23 +7,23 @@ semantic_release/gitproject.py,sha256=izWc4NLdUzAwxGG_fJeqqHW9ivSrPcWBzSaOijQx4f
7
7
  semantic_release/globals.py,sha256=imI9WKGa6MS2pTRAZiWZ2qIJup2eWnBz3OZmIj2YIHM,158
8
8
  semantic_release/helpers.py,sha256=d1jOX0SNyqPc_3wr14xR25FfpqhMd4Ev7MNBOWlScc0,5581
9
9
  semantic_release/changelog/__init__.py,sha256=Bg6Xe5Vt32rWoMscW-hd4sUwiZqzWmsg4CD1EhMesMY,262
10
- semantic_release/changelog/context.py,sha256=y37y3M7UmVKwhu9UatNtlo5zNfTOJI8gGOTIzjYXVa8,5023
10
+ semantic_release/changelog/context.py,sha256=AQY9ZH1c5LjkyMcZyZG8Kjeyg0qvG_ueOWifgshtLWY,5354
11
11
  semantic_release/changelog/release_history.py,sha256=8RU6A4FMgWwwjndOO4WKjbSzPWgVsYbdcZol1xUPnfo,7815
12
12
  semantic_release/changelog/template.py,sha256=J1YJDI_SnXtBbTxoahN0NaVVHN7grOFghLwE9wDjxik,5685
13
13
  semantic_release/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- semantic_release/cli/changelog_writer.py,sha256=qucHQylViw61C8Rn3Lafbeyo80cjs2hxaCztd_EgIJ4,8859
14
+ semantic_release/cli/changelog_writer.py,sha256=4XWAiH2qv3WBLxPm0D0S31-0XDm2QwSwyopiUmjUdJk,9029
15
15
  semantic_release/cli/cli_context.py,sha256=23eyV6KWIpUckUSWILEd7t9dixp-QCY5-kGZnyucEYY,4114
16
- semantic_release/cli/config.py,sha256=0btSbu5KKFZ3HFqR_-WDyToWXljfv1EOuBjBqwwFJcc,30654
16
+ semantic_release/cli/config.py,sha256=XpFT5asSe65ye3Q63h9HaDJ4lTzWKyUBXyn_tZSdamk,30884
17
17
  semantic_release/cli/const.py,sha256=h7XE2D0D__TAZSrUUtVszwvzpkHTMOiQCf97XQNbEvA,163
18
18
  semantic_release/cli/github_actions_output.py,sha256=VYIOb5x5h8eEJdSlXM_mkhT9xXtYi-RgxvnoM7iUn8s,2288
19
19
  semantic_release/cli/masking_filter.py,sha256=DxqjiJyABlzwwwZ1r8JGQpb6QrF00StJFm0-2-s5Fv0,3071
20
20
  semantic_release/cli/util.py,sha256=FyXaBkeL7nXKjy3X9rQLEwvn7p46xPekp2V8Z-5MVrk,3755
21
21
  semantic_release/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- semantic_release/cli/commands/changelog.py,sha256=kVHcGdfud74-M6hjWf1PS6l95gD4yUlu3CZGBkCt7aY,3765
22
+ semantic_release/cli/commands/changelog.py,sha256=6SLdz8zHuLDXnB8JWz8NSko9c5YNLMmRoBw_9DrkRok,3834
23
23
  semantic_release/cli/commands/generate_config.py,sha256=2xZOu3NpyhBp0pWr7d8ugKl_kjqQgpSsSMHq5wHTfrE,1699
24
24
  semantic_release/cli/commands/main.py,sha256=wHG51tbaAHKra21nRe3-FAfQT81-e5PGhv0KnerS15c,4100
25
25
  semantic_release/cli/commands/publish.py,sha256=SZQlIewvqyIC14dkIIVVFetE0tPsKbO1cUyxnZsicrw,2845
26
- semantic_release/cli/commands/version.py,sha256=PKNoP_b8puzcScKkQEbeB3DviJv49cQ-vjq6v25nG9Q,23931
26
+ semantic_release/cli/commands/version.py,sha256=z4UNNmQ0Fo2e-SKPzmF1CF517X5mk8oaiGttYJAiVzA,24000
27
27
  semantic_release/commit_parser/__init__.py,sha256=cv5HFBdw7OJd4Laj4Ex8ZZ5Tml8GwXgQcXW6Pasr2Ao,615
28
28
  semantic_release/commit_parser/_base.py,sha256=t-Z9ALgAe7aZpYXz1mk3Fe-uAvipgKdNrq4Okg_WW9c,3026
29
29
  semantic_release/commit_parser/angular.py,sha256=a1AmgstkclzJnRWqSsF4cuO8awuOJe7VAG__1W7WF7U,7276
@@ -32,21 +32,23 @@ semantic_release/commit_parser/scipy.py,sha256=u_5OWOeM2V7_jZzYfEicKqx0GJBsAqIOf
32
32
  semantic_release/commit_parser/tag.py,sha256=4uwIKBqUM2SE6UTGIw-a7B6Jg1OONXmGwXsTyL3yZBA,3490
33
33
  semantic_release/commit_parser/token.py,sha256=-C1ZKG7pdbcGT2nc3-L2APLUUDGTXkbDeNi5mvvUwjk,2621
34
34
  semantic_release/commit_parser/util.py,sha256=b9lud_FBjsmimLrvILf_NXvZ2wg8JPDmA364hcfM6is,1710
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=zsf5C75jBP2JUdl_7dJvEXgPURvFp6GxPKGRelqLghM,854
35
+ semantic_release/data/templates/angular/md/.release_notes.md.j2,sha256=1wGyJGiML0FeSsHeywj4gv5qhAZHvs0wvea7eCIGiwM,558
36
+ semantic_release/data/templates/angular/md/CHANGELOG.md.j2,sha256=FZmrQ-qOIoSoJmAa_NFaRelfmqUpypU2xlDeScdGOf4,729
37
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=qA190vxbADim4M1b2f-oWF4uWT7Vx8ToSjKrRkPeJfA,1638
41
- semantic_release/data/templates/angular/md/.components/macros.md.j2,sha256=cUrl4tqjhR6Ur-gl_gHsuRz1DVU7X_-0QYnswahoTm0,1709
38
+ semantic_release/data/templates/angular/md/.components/changelog_init.md.j2,sha256=MyEQdWUemGXKWDhvpTmubZdozd3iaLECZAI1VRlE7mg,862
39
+ semantic_release/data/templates/angular/md/.components/changelog_update.md.j2,sha256=uVF4wbbjTMvl6Kbsq9xy3YIrj-uhBnHylEfA7S76aHI,2606
40
+ semantic_release/data/templates/angular/md/.components/changes.md.j2,sha256=PAt_vMMoP5uMbDQZKemx26m13TNGGAOmBVD1sUU-KNo,1701
41
+ semantic_release/data/templates/angular/md/.components/first_release.md.j2,sha256=jMUZiLwhMqAOjdYOCphJxJr8C411cKRzhsabyebj_AY,162
42
+ semantic_release/data/templates/angular/md/.components/macros.md.j2,sha256=rvMLeThRRmCVyF_utN0j6wrWL5PVb4TYraunOWWcdu4,2275
42
43
  semantic_release/data/templates/angular/md/.components/unreleased_changes.md.j2,sha256=HRLj6cyRfPZXC0s-0Av6s0Gp3jKxWg9AIEtIXBVqJuY,177
43
44
  semantic_release/data/templates/angular/md/.components/versioned_changes.md.j2,sha256=2Hky2mBrC4jltz3mvaiPDD0KQP0ELe5Ag75HgaLpaIE,257
44
- semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2,sha256=OQPAKgqTnYGXFyDTm8hwYsMWXfi_z8I5Fsgtw09sWBQ,840
45
+ semantic_release/data/templates/angular/rst/CHANGELOG.rst.j2,sha256=VmkXEMHiPBdZ1Z47QMxnJBZA0NbFSbKenUbThQVFAGY,731
45
46
  semantic_release/data/templates/angular/rst/.components/changelog_header.rst.j2,sha256=c9xN1SEYLFwMvPYXYKt-ZbYPn2-Ss0V7zepEtFFj3Os,200
46
- semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2,sha256=dOICVsTMVLewBDC9QMHhX6Ub9rUFlBAzHOGvsFtNzYY,596
47
- semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2,sha256=L44PJyCb1xge2wC2-w9cAPCLoJDFVIsm8BnZeQOzg94,2381
48
- semantic_release/data/templates/angular/rst/.components/changes.rst.j2,sha256=0JDnsFghFqHezOim9IuQhlVig5mHBKf8Aq7_Y9M2UQE,2852
49
- semantic_release/data/templates/angular/rst/.components/macros.rst.j2,sha256=C_5V80wQu-uCLE_Qp3ACwGS-4jQDGc7NmKaDi3C6m1s,2774
47
+ semantic_release/data/templates/angular/rst/.components/changelog_init.rst.j2,sha256=XD0l3eTyz1yydLKsmSqBk-u8RnO-RdQ2Q8uWezHMAWw,866
48
+ semantic_release/data/templates/angular/rst/.components/changelog_update.rst.j2,sha256=x23-qk9owJrOQaHx8SgSnIZECITjPf1R2awfv9EOHN0,2604
49
+ semantic_release/data/templates/angular/rst/.components/changes.rst.j2,sha256=REgnXdUDQKH2_BakQ-zbQtS4-MJMYKtA1jBXYFhfSjk,2915
50
+ semantic_release/data/templates/angular/rst/.components/first_release.rst.j2,sha256=tChYsdSFMaB0DU9KROYSxijdb7tqaN1psKmDMbrVrJw,443
51
+ semantic_release/data/templates/angular/rst/.components/macros.rst.j2,sha256=C4JkbfM9mfal-fMJJp6dPUT45PsqwfsCFu4pfZe34QI,3176
50
52
  semantic_release/data/templates/angular/rst/.components/unreleased_changes.rst.j2,sha256=ARBhc1ZpKwehGKDvOMqukmN59mTJiHzHsS7rOfKYCt8,202
51
53
  semantic_release/data/templates/angular/rst/.components/versioned_changes.rst.j2,sha256=NZfn1W14QochiAJ43oNKmcrCn_vgfbkKtvOTAw1jEc8,530
52
54
  semantic_release/hvcs/__init__.py,sha256=JwoaLOF-12L-OBo_9-tOXXhdiHKeVungA9865to2oZk,494
@@ -63,10 +65,10 @@ semantic_release/version/algorithm.py,sha256=ofx_bIWq6ptJVr-ekI11IzxzDEctDKFiVwa
63
65
  semantic_release/version/declaration.py,sha256=f6Ld7hIhrqvDrRBapJHr-KDimuyo-4IG8009Zu9BIgU,7357
64
66
  semantic_release/version/translator.py,sha256=P1noIsVBn8u6zNOFjG0xKYOWapxqf_PHSMvMeLJ9kXg,3050
65
67
  semantic_release/version/version.py,sha256=6PCtSbLP88U1daoxnCwHc--YguZo4waGNLqJ5JfeczE,14175
66
- python_semantic_release-9.13.0.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
67
- python_semantic_release-9.13.0.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
68
- python_semantic_release-9.13.0.dist-info/METADATA,sha256=aFjXFtGi0j7sN3G2CfwdCPBGENzFlgkU9a2oDp_2Jeo,3571
69
- python_semantic_release-9.13.0.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
70
- python_semantic_release-9.13.0.dist-info/entry_points.txt,sha256=r2Jql3GTQyugQnvf34l2eXk1O_Qx6llR_xixG1ZWgD0,105
71
- python_semantic_release-9.13.0.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
72
- python_semantic_release-9.13.0.dist-info/RECORD,,
68
+ python_semantic_release-9.14.0.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
69
+ python_semantic_release-9.14.0.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
70
+ python_semantic_release-9.14.0.dist-info/METADATA,sha256=tY6DDyFypAxFHo8kVuuCecr3h_siBZ7RO88JOQAIZQ4,3571
71
+ python_semantic_release-9.14.0.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
72
+ python_semantic_release-9.14.0.dist-info/entry_points.txt,sha256=r2Jql3GTQyugQnvf34l2eXk1O_Qx6llR_xixG1ZWgD0,105
73
+ python_semantic_release-9.14.0.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
74
+ python_semantic_release-9.14.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.13.0"
27
+ __version__ = "9.14.0"
28
28
 
29
29
  __all__ = [
30
30
  "CommitParser",
@@ -23,6 +23,7 @@ class ReleaseNotesContext:
23
23
  hvcs_type: str
24
24
  version: Version
25
25
  release: Release
26
+ mask_initial_release: bool
26
27
  filters: tuple[Callable[..., Any], ...] = ()
27
28
 
28
29
  def bind_to_environment(self, env: Environment) -> Environment:
@@ -53,6 +54,7 @@ class ChangelogContext:
53
54
  changelog_mode: Literal["update", "init"]
54
55
  prev_changelog_file: str
55
56
  changelog_insertion_flag: str
57
+ mask_initial_release: bool
56
58
  filters: tuple[Callable[..., Any], ...] = ()
57
59
 
58
60
  def bind_to_environment(self, env: Environment) -> Environment:
@@ -69,6 +71,7 @@ def make_changelog_context(
69
71
  mode: ChangelogMode,
70
72
  prev_changelog_file: Path,
71
73
  insertion_flag: str,
74
+ mask_initial_release: bool,
72
75
  ) -> ChangelogContext:
73
76
  return ChangelogContext(
74
77
  repo_name=hvcs_client.repo_name,
@@ -76,6 +79,7 @@ def make_changelog_context(
76
79
  history=release_history,
77
80
  changelog_mode=mode.value,
78
81
  changelog_insertion_flag=insertion_flag,
82
+ mask_initial_release=mask_initial_release,
79
83
  prev_changelog_file=str(prev_changelog_file),
80
84
  hvcs_type=hvcs_client.__class__.__name__.lower(),
81
85
  filters=(
@@ -111,6 +115,11 @@ def convert_md_to_rst(md_content: str) -> str:
111
115
  "bullets": (regexp(r"^(\s*)-(\s)"), r"\1*\2"),
112
116
  # Replace markdown inline raw content with rst inline raw content
113
117
  "raw-inline": (regexp(r"(?<=\s)(`[^`]+`)(?![`_])"), r"`\1`"),
118
+ # Replace markdown inline link with rst inline link
119
+ "link-inline": (
120
+ regexp(r"(?<=\s)\[([^\]]+)\]\(([^)]+)\)(?=\s|$)"),
121
+ r"`\1 <\2>`_",
122
+ ),
114
123
  }
115
124
 
116
125
  for pattern, replacement in replacements.values():
@@ -178,6 +178,7 @@ def write_changelog_files(
178
178
  mode=runtime_ctx.changelog_mode,
179
179
  insertion_flag=runtime_ctx.changelog_insertion_flag,
180
180
  prev_changelog_file=runtime_ctx.changelog_file,
181
+ mask_initial_release=runtime_ctx.changelog_mask_initial_release,
181
182
  )
182
183
 
183
184
  user_templates = []
@@ -226,6 +227,7 @@ def generate_release_notes(
226
227
  template_dir: Path,
227
228
  history: ReleaseHistory,
228
229
  style: str,
230
+ mask_initial_release: bool,
229
231
  ) -> str:
230
232
  users_tpl_file = template_dir / DEFAULT_RELEASE_NOTES_TPL_FILE
231
233
 
@@ -251,6 +253,7 @@ def generate_release_notes(
251
253
  hvcs_type=hvcs_client.__class__.__name__.lower(),
252
254
  version=release["version"],
253
255
  release=release,
256
+ mask_initial_release=mask_initial_release,
254
257
  filters=(*hvcs_client.get_changelog_context_filters(), autofit_text_width),
255
258
  ).bind_to_environment(
256
259
  # Use a new, non-configurable environment for release notes -
@@ -259,11 +262,9 @@ def generate_release_notes(
259
262
  )
260
263
 
261
264
  # TODO: Remove in v10
262
- release_notes_env.globals["context"] = {
263
- "history": history,
264
- }
265
- release_notes_env.globals["ctx"] = {
265
+ release_notes_env.globals["context"] = release_notes_env.globals["ctx"] = {
266
266
  "history": history,
267
+ "mask_initial_release": mask_initial_release,
267
268
  }
268
269
 
269
270
  return render_release_notes(
@@ -119,6 +119,7 @@ def changelog(cli_ctx: CliContextObj, release_tag: str | None) -> None:
119
119
  runtime.template_dir,
120
120
  release_history,
121
121
  style=runtime.changelog_style,
122
+ mask_initial_release=runtime.changelog_mask_initial_release,
122
123
  )
123
124
 
124
125
  try:
@@ -696,6 +696,7 @@ def version( # noqa: C901
696
696
  runtime.template_dir,
697
697
  history=release_history,
698
698
  style=runtime.changelog_style,
699
+ mask_initial_release=runtime.changelog_mask_initial_release,
699
700
  )
700
701
 
701
702
  exception: Exception | None = None
@@ -123,6 +123,8 @@ class ChangelogEnvironmentConfig(BaseModel):
123
123
  class DefaultChangelogTemplatesConfig(BaseModel):
124
124
  changelog_file: str = "CHANGELOG.md"
125
125
  output_format: ChangelogOutputFormat = ChangelogOutputFormat.NONE
126
+ # TODO: Breaking Change v10, it will become True
127
+ mask_initial_release: bool = False
126
128
 
127
129
  @model_validator(mode="after")
128
130
  def interpret_output_format(self) -> Self:
@@ -511,6 +513,7 @@ class RuntimeContext:
511
513
  version_declarations: Tuple[VersionDeclarationABC, ...]
512
514
  hvcs_client: hvcs.HvcsBase
513
515
  changelog_insertion_flag: str
516
+ changelog_mask_initial_release: bool
514
517
  changelog_mode: ChangelogMode
515
518
  changelog_file: Path
516
519
  changelog_style: str
@@ -795,6 +798,7 @@ class RuntimeContext:
795
798
  hvcs_client=hvcs_client,
796
799
  changelog_file=changelog_file,
797
800
  changelog_mode=raw.changelog.mode,
801
+ changelog_mask_initial_release=raw.changelog.default_templates.mask_initial_release,
798
802
  changelog_insertion_flag=raw.changelog.insertion_flag,
799
803
  assets=raw.assets,
800
804
  commit_author=commit_author,
@@ -3,7 +3,8 @@ This changelog template initializes a full changelog for the project,
3
3
  it follows the following logic:
4
4
  1. Header
5
5
  2. Any Unreleased Details (uncommon)
6
- 3. all previous releases
6
+ 3. all previous releases except the very first release
7
+ 4. the first release
7
8
 
8
9
  #}{#
9
10
  # Header
@@ -13,10 +14,16 @@ it follows the following logic:
13
14
  #}{% include "unreleased_changes.md.j2"
14
15
  -%}{#
15
16
  # Since this is initialization, we are generating all the previous
16
- # release notes per version.
17
- #}{% for release in context.history.released.values()
18
- %}{{ "\n"
19
- }}{% include "versioned_changes.md.j2"
20
- -%}{{ "\n"
21
- }}{% endfor
17
+ # release notes per version. The very first release notes is specialized
18
+ #}{% if releases | length > 0
19
+ %}{% for release in releases
20
+ %}{{ "\n"
21
+ }}{% if loop.last and ctx.mask_initial_release
22
+ %}{%- include "first_release.md.j2"
23
+ -%}{% else
24
+ %}{%- include "versioned_changes.md.j2"
25
+ -%}{% endif
26
+ %}{{ "\n"
27
+ }}{% endfor
28
+ %}{% endif
22
29
  %}
@@ -41,15 +41,24 @@ This Update changelog template uses the following logic:
41
41
  # Any Unreleased Details (uncommon)
42
42
  #}{% include "unreleased_changes.md.j2"
43
43
  -%}{#
44
- # Latest Release Details
45
- #}{% for release in new_releases
46
- %}{# # Check if the release version is already in the changelog and if not, add it
47
- #}{% if "# " ~ release.version.as_semver_tag() ~ " " not in changelog_parts[1]
48
- %}{{ "\n"
44
+ #}{% if releases | length > 0
45
+ %}{# # Latest Release Details
46
+ #}{% set release = releases[0]
47
+ %}{#
48
+ #}{% if releases | length == 1 and ctx.mask_initial_release
49
+ %}{# # First Release detected
50
+ #}{{ "\n"
51
+ }}{%- include "first_release.md.j2"
52
+ -%}{{ "\n"
53
+ }}{#
54
+ #}{% elif "# " ~ release.version.as_semver_tag() ~ " " not in changelog_parts[1]
55
+ %}{# # The release version is not already in the changelog so we add it
56
+ #}{{ "\n"
49
57
  }}{%- include "versioned_changes.md.j2"
50
58
  -%}{{ "\n"
51
- }}{% endif
52
- %}{% endfor
59
+ }}{#
60
+ #}{% endif
61
+ %}{% endif
53
62
  %}{#
54
63
  # Previous Changelog Footer
55
64
  # - skips printing footer if empty, which happens when the insertion_flag
@@ -7,15 +7,15 @@ EXAMPLE:
7
7
  - Add new feature ([#10](https://domain.com/namespace/repo/pull/10),
8
8
  [`abcdef0`](https://domain.com/namespace/repo/commit/HASH))
9
9
 
10
- - Add new feature ([`abcdef0`](https://domain.com/namespace/repo/commit/HASH))
10
+ - **scope**: Add new feature ([`abcdef0`](https://domain.com/namespace/repo/commit/HASH))
11
11
 
12
12
  ### Fixes
13
13
 
14
14
  - Fix bug ([#11](https://domain.com/namespace/repo/pull/11),
15
15
  [`abcdef1`](https://domain.com/namespace/repo/commit/HASH))
16
16
 
17
- #}{% set max_line_width = 100
18
- %}{% set hanging_indent = 2
17
+ #}{% set max_line_width = max_line_width | default(100)
18
+ %}{% set hanging_indent = hanging_indent | default(2)
19
19
  %}{#
20
20
  #}{% for type_, commits in commit_objects if type_ != "unknown"
21
21
  %}{# PREPROCESS COMMITS (order by description & format description line)
@@ -0,0 +1,11 @@
1
+ {#
2
+
3
+ ## vX.X.X (YYYY-MMM-DD)
4
+
5
+ #}{{
6
+ "## %s (%s)" | format(
7
+ release.version.as_semver_tag(),
8
+ release.tagged_date.strftime("%Y-%m-%d")
9
+ )}}
10
+
11
+ - Initial Release
@@ -1,9 +1,18 @@
1
+ {#
2
+ MACRO: format a inline link reference in Markdown
3
+ #}{% macro format_link(link, label)
4
+ %}{{ "[%s](%s)" | format(label, link)
5
+ }}{% endmacro
6
+ %}
7
+
8
+
1
9
  {#
2
10
  MACRO: commit message links or PR/MR links of commit
3
11
  #}{% macro commit_msg_links(commit)
4
12
  %}{% if commit.error is undefined
5
- %}{% set commit_hash_link = "[`%s`](%s)" | format(
6
- commit.short_hash, commit.hexsha | commit_hash_url
13
+ %}{% set commit_hash_link = format_link(
14
+ commit.hexsha | commit_hash_url,
15
+ "`%s`" | format(commit.short_hash)
7
16
  )
8
17
  %}{#
9
18
  #}{% set summary_line = commit.descriptions[0] | safe
@@ -15,7 +24,7 @@
15
24
  #}{% if commit.linked_merge_request != ""
16
25
  %}{# # Add PR references with a link to the PR
17
26
  #}{% set pr_num = commit.linked_merge_request
18
- %}{% set pr_link = "[%s](%s)" | format(pr_num, pr_num | pull_request_url)
27
+ %}{% set pr_link = format_link(pr_num | pull_request_url, pr_num)
19
28
  %}{#
20
29
  # TODO: breaking change v10, remove summary line replacers as PSR will do it for us
21
30
  #}{% set summary_line = summary_line | replace("(pull request", "(") | replace("(" ~ pr_num ~ ")", "") | trim
@@ -39,10 +48,22 @@
39
48
  {#
40
49
  MACRO: format commit summary line
41
50
  #}{% macro format_commit_summary_line(commit)
42
- %}{% if commit.error is undefined
43
- %}{{ commit_msg_links(commit)
44
- }}{% else
45
- %}{{ (commit.commit.message | string).split("\n", maxsplit=1)[0]
51
+ %}{# # Check for Parsing Error
52
+ #}{% if commit.error is undefined
53
+ %}{#
54
+ # # Add any message links to the commit summary line
55
+ #}{% set summary_line = commit_msg_links(commit)
56
+ %}{#
57
+ #}{% if commit.scope
58
+ %}{% set summary_line = "**%s**: %s" | format(commit.scope, summary_line)
59
+ %}{% endif
60
+ %}{#
61
+ # # Return the modified summary_line
62
+ #}{{ summary_line
63
+ }}{#
64
+ #}{% else
65
+ %}{# # Return the first line of the commit if there was a Parsing Error
66
+ #}{{ (commit.commit.message | string).split("\n", maxsplit=1)[0]
46
67
  }}{% endif
47
68
  %}{% endmacro
48
69
  %}
@@ -1 +1,13 @@
1
- {% include ".components/versioned_changes.md.j2" %}
1
+ {# # Set line width to 1000 to avoid wrapping as GitHub will handle it
2
+ #}{% set max_line_width = max_line_width | default(1000)
3
+ %}{% set hanging_indent = hanging_indent | default(2)
4
+ %}{% set releases = context.history.released.items() | list
5
+ %}{#
6
+ #}{% if releases | length == 1 and mask_initial_release
7
+ %}{# # On a first release, generate our special message
8
+ #}{% include ".components/first_release.md.j2"
9
+ %}{% else
10
+ %}{# # Not the first release so generate notes normally
11
+ #}{% include ".components/versioned_changes.md.j2"
12
+ %}{% endif
13
+ %}
@@ -15,10 +15,6 @@
15
15
  %}{#
16
16
  #}{% elif ctx.changelog_mode == "update"
17
17
  %}{% set prev_changelog_file = ctx.prev_changelog_file
18
- %}{% set new_releases = []
19
- %}{% if releases | length > 0
20
- %}{% set new_releases = [releases | first]
21
- %}{% endif
22
18
  %}{% include ".components/changelog_update.md.j2"
23
19
  %}{#
24
20
  #}{% endif
@@ -3,20 +3,27 @@ This changelog template initializes a full changelog for the project,
3
3
  it follows the following logic:
4
4
  1. Header
5
5
  2. Any Unreleased Details (uncommon)
6
- 3. all previous releases
6
+ 3. all previous releases except the very first release
7
+ 4. the first release
7
8
 
8
9
  #}{#
9
- # Header
10
- #}{% include "changelog_header.rst.j2"
10
+ # Header
11
+ #}{% include "changelog_header.rst.j2"
11
12
  -%}{#
12
- # Any Unreleased Details (uncommon)
13
- #}{% include "unreleased_changes.rst.j2"
14
- %}{#
15
- # Since this is initialization, we are generating all the previous
16
- # release notes per version.
17
- #}{% for release in context.history.released.values()
13
+ # Any Unreleased Details (uncommon)
14
+ #}{% include "unreleased_changes.rst.j2"
15
+ -%}{#
16
+ # Since this is initialization, we are generating all the previous
17
+ # release notes per version. The very first release notes is specialized
18
+ #}{% if releases | length > 0
19
+ %}{% for release in releases
20
+ %}{{ "\n"
21
+ }}{% if loop.last and ctx.mask_initial_release
22
+ %}{%- include "first_release.rst.j2"
23
+ -%}{% else
24
+ %}{%- include "versioned_changes.rst.j2"
25
+ -%}{% endif
18
26
  %}{{ "\n"
19
- }}{% include "versioned_changes.rst.j2"
20
- -%}{{ "\n"
21
- }}{% endfor
27
+ }}{% endfor
28
+ %}{% endif
22
29
  %}
@@ -41,15 +41,24 @@ This Update changelog template uses the following logic:
41
41
  # Any Unreleased Details (uncommon)
42
42
  #}{% include "unreleased_changes.rst.j2"
43
43
  -%}{#
44
- # Latest Release Details
45
- #}{% for release in new_releases
46
- %}{# # Check if the release version is already in the changelog and if not, add it
47
- #}{% if release.version.as_semver_tag() ~ " (" not in changelog_parts[1]
48
- %}{{ "\n"
44
+ #}{% if releases | length > 0
45
+ %}{# # Latest Release Details
46
+ #}{% set release = releases[0]
47
+ %}{#
48
+ #}{% if releases | length == 1 and ctx.mask_initial_release
49
+ %}{# # First Release detected
50
+ #}{{ "\n"
51
+ }}{%- include "first_release.rst.j2"
52
+ -%}{{ "\n"
53
+ }}{#
54
+ #}{% elif release.version.as_semver_tag() ~ " (" not in changelog_parts[1]
55
+ %}{# # The release version is not already in the changelog so we add it
56
+ #}{{ "\n"
49
57
  }}{%- include "versioned_changes.rst.j2"
50
58
  -%}{{ "\n"
51
- }}{% endif
52
- %}{% endfor
59
+ }}{#
60
+ #}{% endif
61
+ %}{% endif
53
62
  %}{#
54
63
  # Previous Changelog Footer
55
64
  # - skips printing footer if empty, which happens when the insertion_flag
@@ -7,7 +7,7 @@ Features
7
7
 
8
8
  * Add new feature (`#10`_, `8a7b8ec`_)
9
9
 
10
- * Add another feature (`abcdef0`_)
10
+ * **scope**: Add another feature (`abcdef0`_)
11
11
 
12
12
  Fixes
13
13
  -----
@@ -19,8 +19,8 @@ Fixes
19
19
  .. _abcdef0: https://domain.com/owner/repo/commit/abcdef0
20
20
  .. _11: https://domain.com/namespace/repo/pull/11
21
21
 
22
- #}{% set max_line_width = 100
23
- %}{% set hanging_indent = 2
22
+ #}{% set max_line_width = max_line_width | default(100)
23
+ %}{% set hanging_indent = hanging_indent | default(2)
24
24
  %}{#
25
25
  #}{% set post_paragraph_links = []
26
26
  %}{#
@@ -0,0 +1,20 @@
1
+ {% from "macros.rst.j2" import generate_heading_underline
2
+ %}{#
3
+
4
+ .. _changelog-vX.X.X:
5
+
6
+ vX.X.X (YYYY-MMM-DD)
7
+ ====================
8
+
9
+ #}{% set version_header = "%s (%s)" | format(
10
+ release.version.as_semver_tag(),
11
+ release.tagged_date.strftime("%Y-%m-%d")
12
+ )
13
+ %}
14
+
15
+ {{- ".. _changelog-%s:" | format(release.version.as_semver_tag()) }}
16
+
17
+ {{ version_header }}
18
+ {{ generate_heading_underline(version_header, "=") }}
19
+
20
+ * Initial Release
@@ -9,10 +9,22 @@
9
9
  {#
10
10
  MACRO: format commit summary line
11
11
  #}{% macro format_commit_summary_line(commit)
12
- %}{% if commit.error is undefined
13
- %}{{ commit_msg_links(commit)
14
- }}{% else
15
- %}{{ (commit.commit.message | string).split("\n", maxsplit=1)[0]
12
+ %}{# # Check for Parsing Error
13
+ #}{% if commit.error is undefined
14
+ %}{#
15
+ # # Add any message links to the commit summary line
16
+ #}{% set summary_line = commit_msg_links(commit)
17
+ %}{#
18
+ #}{% if commit.scope
19
+ %}{% set summary_line = "**%s**: %s" | format(commit.scope, summary_line)
20
+ %}{% endif
21
+ %}{#
22
+ # # Return the modified summary_line
23
+ #}{{ summary_line
24
+ }}{#
25
+ #}{% else
26
+ %}{# # Return the first line of the commit if there was a Parsing Error
27
+ #}{{ (commit.commit.message | string).split("\n", maxsplit=1)[0]
16
28
  }}{% endif
17
29
  %}{% endmacro
18
30
  %}
@@ -8,16 +8,13 @@
8
8
 
9
9
  #}{% set insertion_flag = ctx.changelog_insertion_flag
10
10
  %}{% set unreleased_commits = ctx.history.unreleased | dictsort
11
+ %}{% set releases = ctx.history.released.values() | list
11
12
  %}{#
12
13
  #}{% if ctx.changelog_mode == "init"
13
14
  %}{% include ".components/changelog_init.rst.j2"
14
15
  %}{#
15
16
  #}{% elif ctx.changelog_mode == "update"
16
17
  %}{% set prev_changelog_file = ctx.prev_changelog_file
17
- %}{% set new_releases = []
18
- %}{% if ctx.history.released.values() | length > 0
19
- %}{% set new_releases = [ctx.history.released.values() | first]
20
- %}{% endif
21
18
  %}{% include ".components/changelog_update.rst.j2"
22
19
  %}{#
23
20
  #}{% endif