Skip to content

Commit

Permalink
Merge pull request #243 from hbcarlos/empty_changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Jan 19, 2022
2 parents 9d9ec2f + 9b7f157 commit 455050d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jupyter_releaser/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ def get_version_entry(
return f"## {version}\n\nNo merged PRs"

entry = md.replace("[full changelog]", "[Full Changelog]")
entry = entry.replace("...None", f"...{until}")

if until:
entry = entry.replace("...None", f"...{until}")
else:
entry = entry.replace("...None", "")

entry = entry.splitlines()[2:]

Expand Down
20 changes: 20 additions & 0 deletions jupyter_releaser/tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,26 @@ def test_get_changelog_version_entry_since_last_stable(py_package, mocker):
assert testutil.PR_ENTRY in resp


def test_get_empty_changelog(py_package, mocker):
mocked_gen = mocker.patch("jupyter_releaser.changelog.generate_activity_md")
mocked_gen.return_value = testutil.EMPTY_CHANGELOG_ENTRY
branch = "foo"
util.run("git branch baz/bar")
ref = "heads/baz/bar"
resp = changelog.get_version_entry(ref, branch, "baz/bar", "0.2.5", since="v0.2.4")
mocked_gen.assert_called_with(
"baz/bar",
since="v0.2.4",
until=None,
kind="pr",
branch=branch,
heading_level=2,
auth=None,
)

assert not ("...None" in resp)


def test_compute_sha256(py_package):
assert len(util.compute_sha256(py_package / "CHANGELOG.md")) == 64

Expand Down
11 changes: 11 additions & 0 deletions jupyter_releaser/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@
[@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)
"""

EMPTY_CHANGELOG_ENTRY = """
## main@{2021-09-15}...main@{2022-01-18}
([Full Changelog](https://github.com/QuantStack/jupyterlab-js-logs/compare/v0.2.4...None))
### Contributors to this release
([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))
"""


def setup_cfg_template(package_name="foo", module_name=None):
return f"""
Expand Down

0 comments on commit 455050d

Please sign in to comment.