Skip to content

Commit 2f18a6d

Browse files
authored
docs(changelog): add formatted changelog into hosted documentation (#1155)
* chore(changelog): configure custom release notes & RST changelog for PSR * chore(changelog): convert project changelog to an updating RST
1 parent 7c14f81 commit 2f18a6d

19 files changed

+6684
-5074
lines changed

CHANGELOG.md

Lines changed: 0 additions & 5074 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 5415 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
{#
2+
This file overrides what would be generated normally because the commits are
3+
not conformative to the standard commit message format.
4+
#}
5+
.. _changelog-v1.0.0:
6+
7+
v1.0.0 (2015-08-04)
8+
===================
9+
10+
💥 Breaking
11+
-----------
12+
13+
* Restructure helpers into history and pypi (`00f64e6`_)
14+
15+
📖 Documentation
16+
----------------
17+
18+
* Add automatic publishing documentation, resolves `#18`_ (`58076e6`_)
19+
20+
.. _#18: https://github.com/python-semantic-release/python-semantic-release/issues/18
21+
.. _00f64e6: https://github.com/python-semantic-release/python-semantic-release/commit/00f64e623db0e21470d55488c5081e12d6c11fd3
22+
.. _58076e6: https://github.com/python-semantic-release/python-semantic-release/commit/58076e60bf20a5835b112b5e99a86c7425ffe7d9
23+
24+
25+
.. _changelog-v0.9.1:
26+
27+
v0.9.1 (2015-08-04)
28+
===================
29+
30+
🪲 Bug Fixes
31+
------------
32+
33+
* Fix ``get_current_head_hash`` to ensure it only returns the hash (`7c28832`_)
34+
35+
.. _7c28832: https://github.com/python-semantic-release/python-semantic-release/commit/7c2883209e5bf4a568de60dbdbfc3741d34f38b4
36+
37+
38+
.. _changelog-v0.9.0:
39+
40+
v0.9.0 (2015-08-03)
41+
===================
42+
43+
✨ Features
44+
-----------
45+
46+
* Add Python 2.7 support, resolves `#10`_ (`c05e13f`_)
47+
48+
.. _#10: https://github.com/python-semantic-release/python-semantic-release/issues/10
49+
.. _c05e13f: https://github.com/python-semantic-release/python-semantic-release/commit/c05e13f22163237e963c493ffeda7e140f0202c6
50+
51+
52+
.. _changelog-v0.8.0:
53+
54+
v0.8.0 (2015-08-03)
55+
===================
56+
57+
✨ Features
58+
-----------
59+
60+
* Add ``check_build_status`` option, resolves `#5`_ (`310bb93`_)
61+
62+
* Add ``get_current_head_hash`` in git helpers (`d864282`_)
63+
64+
* Add git helper to get owner and name of repo (`f940b43`_)
65+
66+
.. _#5: https://github.com/python-semantic-release/python-semantic-release/issues/5
67+
.. _310bb93: https://github.com/python-semantic-release/python-semantic-release/commit/310bb9371673fcf9b7b7be48422b89ab99753f04
68+
.. _d864282: https://github.com/python-semantic-release/python-semantic-release/commit/d864282c498f0025224407b3eeac69522c2a7ca0
69+
.. _f940b43: https://github.com/python-semantic-release/python-semantic-release/commit/f940b435537a3c93ab06170d4a57287546bd8d3b
70+
71+
72+
.. _changelog-v0.7.0:
73+
74+
v0.7.0 (2015-08-02)
75+
===================
76+
77+
✨ Features
78+
-----------
79+
80+
* Add ``patch_without_tag`` option, resolves `#6`_ (`3734a88`_)
81+
82+
📖 Documentation
83+
----------------
84+
85+
* Set up sphinx based documentation, resolves `#1`_ (`41fba78`_)
86+
87+
.. _#1: https://github.com/python-semantic-release/python-semantic-release/issues/1
88+
.. _#6: https://github.com/python-semantic-release/python-semantic-release/issues/6
89+
.. _3734a88: https://github.com/python-semantic-release/python-semantic-release/commit/3734a889f753f1b9023876e100031be6475a90d1
90+
.. _41fba78: https://github.com/python-semantic-release/python-semantic-release/commit/41fba78a389a8d841316946757a23a7570763c39
91+
92+
93+
.. _changelog-v0.6.0:
94+
95+
v0.6.0 (2015-08-02)
96+
===================
97+
98+
✨ Features
99+
-----------
100+
101+
* Add twine for uploads to pypi, resolves `#13`_ (`eec2561`_)
102+
103+
.. _#13: https://github.com/python-semantic-release/python-semantic-release/issues/13
104+
.. _eec2561: https://github.com/python-semantic-release/python-semantic-release/commit/eec256115b28b0a18136a26d74cfc3232502f1a6
105+
106+
107+
.. _changelog-v0.5.4:
108+
109+
v0.5.4 (2015-07-29)
110+
===================
111+
112+
🪲 Bug Fixes
113+
------------
114+
115+
* Add python2 not supported warning (`e84c4d8`_)
116+
117+
.. _e84c4d8: https://github.com/python-semantic-release/python-semantic-release/commit/e84c4d8b6f212aec174baccd188185627b5039b6
118+
119+
120+
.. _changelog-v0.5.3:
121+
122+
v0.5.3 (2015-07-28)
123+
===================
124+
125+
⚙️ Build System
126+
---------------
127+
128+
* Add ``wheel`` as a dependency (`971e479`_)
129+
130+
.. _971e479: https://github.com/python-semantic-release/python-semantic-release/commit/971e4795a8b8fea371fcc02dc9221f58a0559f32
131+
132+
133+
.. _changelog-v0.5.2:
134+
135+
v0.5.2 (2015-07-28)
136+
===================
137+
138+
🪲 Bug Fixes
139+
------------
140+
141+
* Fix python wheel tag (`f9ac163`_)
142+
143+
.. _f9ac163: https://github.com/python-semantic-release/python-semantic-release/commit/f9ac163491666022c809ad49846f3c61966e10c1
144+
145+
146+
.. _changelog-v0.5.1:
147+
148+
v0.5.1 (2015-07-28)
149+
===================
150+
151+
🪲 Bug Fixes
152+
------------
153+
154+
* Fix push commands (`8374ef6`_)
155+
156+
.. _8374ef6: https://github.com/python-semantic-release/python-semantic-release/commit/8374ef6bd78eb564a6d846b882c99a67e116394e
157+
158+
159+
.. _changelog-v0.5.0:
160+
161+
v0.5.0 (2015-07-28)
162+
===================
163+
164+
✨ Features
165+
-----------
166+
167+
* Add setup.py hook for the cli interface (`c363bc5`_)
168+
169+
.. _c363bc5: https://github.com/python-semantic-release/python-semantic-release/commit/c363bc5d3cb9e9a113de3cd0c49dd54a5ea9cf35
170+
171+
172+
.. _changelog-v0.4.0:
173+
174+
v0.4.0 (2015-07-28)
175+
===================
176+
177+
✨ Features
178+
-----------
179+
180+
* Add publish command (`d8116c9`_)
181+
182+
.. _d8116c9: https://github.com/python-semantic-release/python-semantic-release/commit/d8116c9dec472d0007973939363388d598697784
183+
184+
185+
.. _changelog-v0.3.2:
186+
187+
v0.3.2 (2015-07-28)
188+
===================
189+
190+
* No change
191+
192+
193+
.. _changelog-v0.3.1:
194+
195+
v0.3.1 (2015-07-28)
196+
===================
197+
198+
🪲 Bug Fixes
199+
------------
200+
201+
* Fix wheel settings (`1e860e8`_)
202+
203+
.. _1e860e8: https://github.com/python-semantic-release/python-semantic-release/commit/1e860e8a4d9ec580449a0b87be9660a9482fa2a4
204+
205+
206+
.. _changelog-v0.3.0:
207+
208+
v0.3.0 (2015-07-27)
209+
===================
210+
211+
✨ Features
212+
-----------
213+
214+
* Add support for tagging releases (`5f4736f`_)
215+
216+
🪲 Bug Fixes
217+
------------
218+
219+
* Fix issue when version should not change (`441798a`_)
220+
221+
.. _441798a: https://github.com/python-semantic-release/python-semantic-release/commit/441798a223195138c0d3d2c51fc916137fef9a6c
222+
.. _5f4736f: https://github.com/python-semantic-release/python-semantic-release/commit/5f4736f4e41bc96d36caa76ca58be0e1e7931069
223+
224+
225+
.. _changelog-v0.2.0:
226+
227+
v0.2.0 (2015-07-27)
228+
===================
229+
230+
✨ Features
231+
-----------
232+
233+
* added no-operation (``--noop``) mode (`44c2039`_)
234+
235+
⚙️ Build System
236+
---------------
237+
238+
* Swapped pygit2 with gitpython to avoid libgit2 dependency (`8165a2e`_)
239+
240+
.. _44c2039: https://github.com/python-semantic-release/python-semantic-release/commit/44c203989aabc9366ba42ed2bc40eaccd7ac891c
241+
.. _8165a2e: https://github.com/python-semantic-release/python-semantic-release/commit/8165a2eef2c6eea88bfa52e6db37abc7374cccba
242+
243+
244+
.. _changelog-v0.1.1:
245+
246+
v0.1.1 (2015-07-27)
247+
===================
248+
249+
🪲 Bug Fixes
250+
------------
251+
252+
* Fix entry point (`bd7ce7f`_)
253+
254+
.. _bd7ce7f: https://github.com/python-semantic-release/python-semantic-release/commit/bd7ce7f47c49e2027767fb770024a0d4033299fa
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _changelog:
2+
3+
{% if ctx.changelog_mode == "update"
4+
%}{# # Modified insertion flag to insert a changelog header directly
5+
# which convienently puts the insertion flag incognito when reading raw RST
6+
#}{{
7+
insertion_flag ~ "\n"
8+
9+
}}{% endif
10+
%}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{#
2+
This changelog template initializes a full changelog for the project,
3+
it follows the following logic:
4+
1. Header
5+
2. Any Unreleased Details (uncommon)
6+
3. all previous releases except the very first release
7+
4. the first release
8+
9+
#}{#
10+
# # Header
11+
#}{% include "changelog_header.rst.j2"
12+
-%}{#
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+
# # We also have non-conformative commits, so insert manual write-ups.
19+
#}{% if releases | length > 0
20+
%}{% for release in releases
21+
%}{% if loop.last
22+
%}{{ "\n"
23+
}}{% include "first_release.rst.j2"
24+
-%}{{ "\n"
25+
}}{#
26+
#}{% elif release.version == "1.0.0"
27+
%}{# # Append 0.1.1 through 1.0.0 non-generated changelog only once
28+
#}{{ "\n"
29+
}}{% include "changelog_1.0.0.rst.j2"
30+
-%}{{ "\n\n"
31+
}}{#
32+
#}{% elif release.version > "1.0.0"
33+
%}{{ "\n"
34+
}}{% include "versioned_changes.rst.j2"
35+
-%}{{ "\n"
36+
}}{% endif
37+
%}{% endfor
38+
%}{% endif
39+
%}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{#
2+
This Update changelog template uses the following logic:
3+
4+
1. Read previous changelog file (ex. project_root/CHANGELOG.md)
5+
2. Split on insertion flag (ex. <!-- version list -->)
6+
3. Print top half of previous changelog
7+
3. New Changes (unreleased commits & newly released)
8+
4. Print bottom half of previous changelog
9+
10+
Note: if a previous file was not found, it does not write anything at the bottom
11+
but render does NOT fail
12+
13+
#}{% set prev_changelog_contents = prev_changelog_file | read_file | safe
14+
%}{% set changelog_parts = prev_changelog_contents.split(insertion_flag, maxsplit=1)
15+
%}{#
16+
#}{% if changelog_parts | length < 2
17+
%}{# # insertion flag was not found, check if the file was empty or did not exist
18+
#}{% if prev_changelog_contents | length > 0
19+
%}{# # File has content but no insertion flag, therefore, file will not be updated
20+
#}{{ changelog_parts[0]
21+
}}{% else
22+
%}{# # File was empty or did not exist, therefore, it will be created from scratch
23+
#}{% include "changelog_init.rst.j2"
24+
%}{% endif
25+
%}{% else
26+
%}{#
27+
# Previous Changelog Header
28+
# - Depending if there is header content, then it will separate the insertion flag
29+
# with a newline from header content, otherwise it will just print the insertion flag
30+
#}{% set prev_changelog_top = changelog_parts[0] | trim
31+
%}{% if prev_changelog_top | length > 0
32+
%}{{
33+
"%s\n\n%s\n" | format(prev_changelog_top, insertion_flag | trim)
34+
35+
}}{% else
36+
%}{{
37+
"%s\n" | format(insertion_flag | trim)
38+
39+
}}{% endif
40+
%}{#
41+
# Any Unreleased Details (uncommon)
42+
#}{% include "unreleased_changes.rst.j2"
43+
-%}{#
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"
57+
}}{%- include "versioned_changes.rst.j2"
58+
-%}{{ "\n"
59+
}}{#
60+
#}{% endif
61+
%}{% endif
62+
%}{#
63+
# Previous Changelog Footer
64+
# - skips printing footer if empty, which happens when the insertion_flag
65+
# was at the end of the file (ignoring whitespace)
66+
#}{% set previous_changelog_bottom = changelog_parts[1] | trim
67+
%}{% if previous_changelog_bottom | length > 0
68+
%}{{ "\n%s\n" | format(previous_changelog_bottom)
69+
}}{% endif
70+
%}{% endif
71+
%}

0 commit comments

Comments
 (0)