Closed mauritsvanrees closed 5 years ago
You're right. If something else than "unreleased" is somehow used, this PR might break some existing behaviour.
Would it be an idea to do the check the other way around? Try to detect (xxxx-xx-xx)? Just a basic regex .*\(\d[4]\-\d[2]\-\d[2]\)
-like?
You wouldn't have false positives this way.
That could work, although you wouldn't catch the case where people would use a history line like 1.0 (February 20, 2019)
.
Using bumpversion is already a bit of a corner case. That is, I've used it only once myself :-)
Supporting "February 20, last year" would be like supporting the corner case of a corner case.
But raising a warning on "not released yet", that's a one-level corner case of regular usage.
I regularly use bumpversion
when doing Plone releases.
Note that the other PR (#313) is specifically about bumpversion
, but this one is also applicable to prerelease
, as evidenced by the small change in the tests.
I will try the regular expression.
Fixed.
Test run with a test package for which I already prepared a release yesterday:
$ prerelease
Run pyroma on the package before tagging? (Y/n)? n
Do you want to run check-manifest? (Y/n)? n
Changelog entries for version 1.24.14:
1.24.14 (2019-02-19)
--------------------
- Nothing changed yet.
1.24.13 (2018-03-10)
--------------------
Enter version [1.24.14]:
WARNING: Changelog contains "- Nothing changed yet.". Are you sure you want to release? (y/N)? y
WARNING: Refused to edit history header, because it looks to be from an already released version with a date. Would have wanted to set this header: 1.24.14 (2019-02-20)
INFO: Set setup.py's version to '1.24.14'
INFO: Changed version from 1.24.14.dev0 to 1.24.14
INFO: History file CHANGES.rst updated.
INFO: The 'git diff':
diff --git a/setup.py b/setup.py
index 4096d10..62a3b10 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = '1.24.14.dev0'
+version = '1.24.14'
setup(name='mauritstestpackage2',
version=version,
OK to commit this (Y/n)?
Releasen maar.
6.17.0 released.
We look for "unreleased" in it. Give a warning when this happens. Fixes issue #311.
This is a more general fix than the one in PR #313 which is specific for
bumpversion
. But it seems good to do both.The current one might possibly have negative side effects when people do not have 'unreleased' in their changelog, but say
(release date to be determined)
. So it could be that this fixes some things and breaks something else. To counter this, we might just need support for an extra item insetup.cfg
,unreleased-marker
similar to thedevelopment-marker
that we already have.But it already fixes something in the tests: in
postrelease.txt
we callprerelease
and until now this would change1.0 (1972-12-25)
into1.3 (<today>)
. With the current PR, it keeps the header, and it would log a warning, though that is not visible in the tests.