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

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

Open
ionelmc opened this issue May 14, 2021 · 5 comments · May be fixed by #216
Open

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

ionelmc opened this issue May 14, 2021 · 5 comments · May be fixed by #216

Comments

@ionelmc
Copy link

ionelmc commented May 14, 2021

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
Copy link
Author

ionelmc commented May 14, 2021

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

@ionelmc ionelmc linked a pull request May 14, 2021 that will close this issue
@florisla
Copy link
Collaborator

florisla commented May 20, 2021

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 4e700bc (v1.0.1).

So we have to decide:

  • Don't show the diff
  • Show the diff
  • Make this configurable

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

@ionelmc
Copy link
Author

ionelmc commented May 20, 2021

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 #216

@florisla
Copy link
Collaborator

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
Copy link
Contributor

jaap3 commented Aug 26, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants