Skip to content

Commit 455050d

Browse files
authored
Merge pull request #243 from hbcarlos/empty_changelog
2 parents 9d9ec2f + 9b7f157 commit 455050d

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

jupyter_releaser/changelog.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ def get_version_entry(
105105
return f"## {version}\n\nNo merged PRs"
106106

107107
entry = md.replace("[full changelog]", "[Full Changelog]")
108-
entry = entry.replace("...None", f"...{until}")
108+
109+
if until:
110+
entry = entry.replace("...None", f"...{until}")
111+
else:
112+
entry = entry.replace("...None", "")
109113

110114
entry = entry.splitlines()[2:]
111115

jupyter_releaser/tests/test_functions.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,26 @@ def test_get_changelog_version_entry_since_last_stable(py_package, mocker):
125125
assert testutil.PR_ENTRY in resp
126126

127127

128+
def test_get_empty_changelog(py_package, mocker):
129+
mocked_gen = mocker.patch("jupyter_releaser.changelog.generate_activity_md")
130+
mocked_gen.return_value = testutil.EMPTY_CHANGELOG_ENTRY
131+
branch = "foo"
132+
util.run("git branch baz/bar")
133+
ref = "heads/baz/bar"
134+
resp = changelog.get_version_entry(ref, branch, "baz/bar", "0.2.5", since="v0.2.4")
135+
mocked_gen.assert_called_with(
136+
"baz/bar",
137+
since="v0.2.4",
138+
until=None,
139+
kind="pr",
140+
branch=branch,
141+
heading_level=2,
142+
auth=None,
143+
)
144+
145+
assert not ("...None" in resp)
146+
147+
128148
def test_compute_sha256(py_package):
129149
assert len(util.compute_sha256(py_package / "CHANGELOG.md")) == 64
130150

jupyter_releaser/tests/util.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@
4545
[@betatim](https://github.com/search?q=repo%3Aexecutablebooks%2Fgithub-activity+involves%3Abetatim+updated%3A2019-09-01..2019-11-01&type=Issues) | [@choldgraf](https://github.com/search?q=repo%3Aexecutablebooks%2Fgithub-activity+involves%3Acholdgraf+updated%3A2019-09-01..2019-11-01&type=Issues) | [@consideRatio](https://github.com/search?q=repo%3Aexecutablebooks%2Fgithub-activity+involves%3AconsideRatio+updated%3A2019-09-01..2019-11-01&type=Issues)
4646
"""
4747

48+
EMPTY_CHANGELOG_ENTRY = """
49+
## main@{2021-09-15}...main@{2022-01-18}
50+
51+
([Full Changelog](https://github.com/QuantStack/jupyterlab-js-logs/compare/v0.2.4...None))
52+
53+
### Contributors to this release
54+
55+
([GitHub contributors page for this release](https://github.com/QuantStack/jupyterlab-js-logs/graphs/contributors?from=2021-09-15&to=2022-01-18&type=c))
56+
57+
"""
58+
4859

4960
def setup_cfg_template(package_name="foo", module_name=None):
5061
return f"""

0 commit comments

Comments
 (0)