Commit 6f9c52de authored by Jason Madden's avatar Jason Madden

Add postrelease hook to stop zest.releaser from modifying CHANGES.rst in its last step.

Fixes #1600

[skip ci]
parent 6b44f55e
......@@ -6,6 +6,8 @@ python-file-with-version = src/gevent/__init__.py
create-wheel = no
prereleaser.middle =
gevent._util.prereleaser_middle
postreleaser.before =
gevent._util.postreleaser_before
[metadata]
long_description_content_type = text/x-rst
......
......@@ -216,6 +216,14 @@ implementer = implementer
Attribute = Attribute
###
# Release automation.
#
# Most of this is to integrate zest.releaser with towncrier. There is
# a plugin package that can do the same:
# https://github.com/collective/zestreleaser.towncrier
###
def prereleaser_middle(data): # pragma: no cover
"""
zest.releaser prerelease middle hook for gevent.
......@@ -300,3 +308,18 @@ def prereleaser_middle(data): # pragma: no cover
print("Replaced version NEXT in", path)
with open(path, 'wb') as f:
f.write(new_contents)
def postreleaser_before(data): # pragma: no cover
"""
Prevents zest.releaser from modifying the CHANGES.rst to add the
'no changes yet' section; towncrier is in charge of CHANGES.rst.
Needs zest.releaser 6.15.0.
"""
if data['name'] != 'gevent':
# We are specified in ``setup.cfg``, not ``setup.py``, so we do not
# come into play for other projects, only this one. We shouldn't
# need this check, but there it is.
return
data['update_history'] = False
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment