Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When CHANGES.rst and setup.py disagree about the next version number, pick the greater one? #339

Open
mgedmin opened this issue Nov 11, 2019 · 1 comment
Assignees

Comments

@mgedmin
Copy link
Contributor

mgedmin commented Nov 11, 2019

I accidentally released zope.proxy 4.3.3 instead of 4.4.0 today because while the upcoming version in CHANGES.rst was correctly specified as 4.4.0, people forgot to update setup.py and it still said 4.3.3.dev0.

This is entirely my own fault for not paying attention, but I think zest.releaser could help prevent such accidents if it noticed that the version numbers were different and picked the higher one, or at least printed an extra warning.

@mauritsvanrees
Copy link
Member

In prerelease.py after asking for the new version it seems we can do something like this:

# Be careful with AttributeErrors, KeyErrors.
last_released_version = self.data["headings"][0]["version"]
# Use some setuptools version parsing for the next line.
# If that fails, ignore the check.
if suggestion < last_released_version:
    print("Last version number X in history is greater than new version Y. "
             "Are you sure?")
    # if not: sys.exit(1)

Or before these lines, we can simply print the last history version, maybe only if it is higher than the version we get from the vcs.

I can see about that when I have some time. Or a PR is welcome.

@mauritsvanrees mauritsvanrees self-assigned this Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants