c4urself / bump2version

Version-bump your software with a single command
https://pypi.python.org/pypi/bump2version
MIT License
1.07k stars 134 forks source link

dry-run+verbose doesn't show the diff anymore #215

Open ionelmc opened 3 years ago

ionelmc commented 3 years ago

Pretty sure older versions showed a diff. For sure bumpversion showed a diff.

Current output:

> bumpversion patch --dry-run --verbose --list                                                                                                           0.21s => 0 11:37
Reading config file .bumpversion.cfg:
[bumpversion]
current_version = 2.11.1
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:README.rst]
search = /v{current_version}.svg
replace = /v{new_version}.svg

[bumpversion:file:docs/conf.py]
search = version = release = '{current_version}'
replace = version = release = '{new_version}'

[bumpversion:file:src/pytest_cov/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

Attempting to increment part 'patch'
Values are now: major=2, minor=11, patch=2
Dry run active, won't touch any files.
New version will be '2.11.2'
Asserting files setup.py, README.rst, docs/conf.py, src/pytest_cov/__init__.py contain the version string...
current_version=2.11.1
commit=True
tag=True
new_version=2.11.2
Would write to config file .bumpversion.cfg:
[bumpversion]
current_version = 2.11.2
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:README.rst]
search = /v{current_version}.svg
replace = /v{new_version}.svg

[bumpversion:file:docs/conf.py]
search = version = release = '{current_version}'
replace = version = release = '{new_version}'

[bumpversion:file:src/pytest_cov/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

Would prepare Git commit
Would add changes in file 'setup.py' to Git
Would add changes in file 'README.rst' to Git
Would add changes in file 'docs/conf.py' to Git
Would add changes in file 'src/pytest_cov/__init__.py' to Git
Would add changes in file '.bumpversion.cfg' to Git
Would commit to Git with message 'Bump version: 2.11.1 → 2.11.2'
Would tag 'v2.11.2' with message 'Bump version: 2.11.1 → 2.11.2' in Git and not signing

Basically it pretty much now shows mostly useless output. Only the new version show is useful. It shows the configuration file content two times, without a diff - how is that useful?

ionelmc commented 3 years ago

I've checked some more, turns out this regressed in 0.5.11. Output from 0.5.10:

> bumpversion patch --dry-run --verbose                                                                                                                  0.68s => 0 11:59
Reading config file .bumpversion.cfg:
[bumpversion]
current_version = 2.11.1
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:README.rst]
search = /v{current_version}.svg
replace = /v{new_version}.svg

[bumpversion:file:docs/conf.py]
search = version = release = '{current_version}'
replace = version = release = '{new_version}'

[bumpversion:file:src/pytest_cov/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

Parsing version '2.11.1' using regexp '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)'
Parsed the following values: major=2, minor=11, patch=1
Attempting to increment part 'patch'
Values are now: major=2, minor=11, patch=2
Dry run active, won't touch any files.
Parsing version '2.11.2' using regexp '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)'
Parsed the following values: major=2, minor=11, patch=2
New version will be '2.11.2'
Asserting files setup.py, README.rst, docs/conf.py, src/pytest_cov/__init__.py contain the version string:
Found 'version='2.11.1'' in setup.py at line 87:     version='2.11.1',
Found '/v2.11.1.svg' in README.rst at line 40: .. |commits-since| image:: https://img.shields.io/github/commits-since/pytest-dev/pytest-cov/v2.11.1.svg
Found 'version = release = '2.11.1'' in docs/conf.py at line 28: version = release = '2.11.1'
Found '__version__ = '2.11.1'' in src/pytest_cov/__init__.py at line 1: __version__ = '2.11.1'
Would change file setup.py:
--- a/setup.py
+++ b/setup.py
@@ -85,7 +85,7 @@

 setup(
     name='pytest-cov',
-    version='2.11.1',
+    version='2.11.2',
     license='MIT',
     description='Pytest plugin for measuring coverage.',
     long_description='%s\n%s' % (read('README.rst'), re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst'))),
Would change file README.rst:
--- a/README.rst
+++ b/README.rst
@@ -38,7 +38,7 @@
 .. |conda-forge| image:: https://img.shields.io/conda/vn/conda-forge/pytest-cov.svg
     :target: https://anaconda.org/conda-forge/pytest-cov

-.. |commits-since| image:: https://img.shields.io/github/commits-since/pytest-dev/pytest-cov/v2.11.1.svg
+.. |commits-since| image:: https://img.shields.io/github/commits-since/pytest-dev/pytest-cov/v2.11.2.svg
     :alt: Commits since latest release
     :target: https://github.com/pytest-dev/pytest-cov/compare/v2.10.1...master

Would change file docs/conf.py:
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -26,7 +26,7 @@
 year = '2016'
 author = 'pytest-cov contributors'
 copyright = '{}, {}'.format(year, author)
-version = release = '2.11.1'
+version = release = '2.11.2'

 pygments_style = 'trac'
 templates_path = ['.']
Would change file src/pytest_cov/__init__.py:
--- a/src/pytest_cov/__init__.py
+++ b/src/pytest_cov/__init__.py
@@ -1,2 +1,2 @@
 """pytest-cov: avoid already-imported warning: PYTEST_DONT_REWRITE."""
-__version__ = '2.11.1'
+__version__ = '2.11.2'
Would write to config file .bumpversion.cfg:
[bumpversion]
current_version = 2.11.2
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file:README.rst]
search = /v{current_version}.svg
replace = /v{new_version}.svg

[bumpversion:file:docs/conf.py]
search = version = release = '{current_version}'
replace = version = release = '{new_version}'

[bumpversion:file:src/pytest_cov/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

Would prepare Git commit
Would add changes in file 'setup.py' to Git
Would add changes in file 'README.rst' to Git
Would add changes in file 'docs/conf.py' to Git
Would add changes in file 'src/pytest_cov/__init__.py' to Git
Would add changes in file '.bumpversion.cfg' to Git
Would commit to Git with message 'Bump version: 2.11.1 → 2.11.2'
Would tag 'v2.11.2' with message 'Bump version: 2.11.1 → 2.11.2' in Git and not signing
florisla commented 3 years ago

There is no commit between 0.5.10 and 0.5.11 which explicitly removes this behavior.

Also, the unit test covering --dry-run --verbose output, was only added in 4e700bc43070349a4f0cf9f05811b313471436ad (v1.0.1).

So we have to decide:

I'm in favor of showing the diff, since it would be very useful to spot configuration problems.

ionelmc commented 3 years ago

There is no commit between 0.5.10 and 0.5.11 which explicitly removes this behavior.

But there is :-)

Logging configuration was changed - in the current release it's configured incorrectly. See https://github.com/c4urself/bump2version/pull/216

florisla commented 3 years ago

Yes you are right.

What I meant to say was -- there is no commit which intentionally removed that behavior. So I think it got removed by accident.

jaap3 commented 3 years ago

Adding this back in would be super helpful. One more than one occasion bumpversion bumped one of the dependencies listed in install_requires because it happened to be pinned to the same version as the package I was bumping.