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

Problems with bumpversion #1117

Closed
astrojuanlu opened this issue Apr 6, 2021 · 9 comments · Fixed by #1321
Closed

Problems with bumpversion #1117

astrojuanlu opened this issue Apr 6, 2021 · 9 comments · Fixed by #1321

Comments

@astrojuanlu
Copy link
Contributor

When trying to use bumpversion, I get this:

(.venv) juanlu@arion2:~/Projects/RTD/sphinx_rtd_theme$ bumpversion micro
Traceback (most recent call last):
  File "/home/juanlu/Projects/RTD/sphinx_rtd_theme/.venv/bin/bumpversion", line 8, in <module>
    sys.exit(main())
  File "/home/juanlu/Projects/RTD/sphinx_rtd_theme/.venv/lib/python3.8/site-packages/bumpversion/cli.py", line 124, in main
    _check_files_contain_version(files, current_version, context)
  File "/home/juanlu/Projects/RTD/sphinx_rtd_theme/.venv/lib/python3.8/site-packages/bumpversion/cli.py", line 618, in _check_files_contain_version
    f.should_contain_version(current_version, context)
  File "/home/juanlu/Projects/RTD/sphinx_rtd_theme/.venv/lib/python3.8/site-packages/bumpversion/utils.py", line 68, in should_contain_version
    raise VersionNotFoundException(
bumpversion.exceptions.VersionNotFoundException: Did not find '0.5.1' in file: 'setup.py'

(probably because the last hotfix was manually incremented?)

But then, even after I apply this diff:

commit 8d7f3ebcace63c1c65a1b5d56fb4ba0240502e92 (HEAD -> master)
Author: Juan Luis Cano Rodríguez <hello@juanlu.space>
Date:   Mon Apr 5 21:41:32 2021 +0200

    Fix bumpversion config

diff --git a/docs/conf.py b/docs/conf.py
index c586dc1..9c4d61d 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -14,8 +14,8 @@ from sphinx.locale import _
 
 project = u'Read the Docs Sphinx Theme'
 slug = re.sub(r'\W+', '-', project.lower())
-version = '0.5.1'
-release = '0.5.1'
+version = '0.5.2'
+release = '0.5.2'
 author = u'Dave Snider, Read the Docs, Inc. & contributors'
 copyright = author
 language = 'en'
diff --git a/setup.cfg b/setup.cfg
index fcbf17d..8bb0f79 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.5.1
+current_version = 0.5.2
 commit = false
 tag = false
 parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<dev>\d+))?
diff --git a/sphinx_rtd_theme/__init__.py b/sphinx_rtd_theme/__init__.py
index 2bc6499..b7a4bb9 100644
--- a/sphinx_rtd_theme/__init__.py
+++ b/sphinx_rtd_theme/__init__.py
@@ -12,7 +12,7 @@ from sphinx.locale import _
 from sphinx.util.logging import getLogger
 
 
-__version__ = '0.5.1'
+__version__ = '0.5.2'
 __version_full__ = __version__
 
 logger = getLogger(__name__)

bumpversion micro makes these weird changes:

diff --git a/package-lock.json b/package-lock.json
index ab0e53f..49daa19 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
 {
   "name": "sphinx_rtd_theme",
-  "version": "0.5.2",
+  "version": ""version": "0.5.2",",
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
@@ -2509,7 +2509,7 @@
         "escape-html": "~1.0.3",
         "etag": "~1.8.1",
         "finalhandler": "~1.1.2",
-        "fresh": "0.5.2",
+        "fresh": ""version": "0.5.2",",
         "merge-descriptors": "1.0.1",
         "methods": "~1.1.2",
         "on-finished": "~2.3.0",
@@ -2809,8 +2809,8 @@
       }
     },
     "fresh": {
-      "version": "0.5.2",
-      "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
+      "version": ""version": "0.5.2",",
+      "resolved": "https://registry.npmjs.org/fresh/-/fresh-"version": "0.5.2",.tgz",
       "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=",
       "dev": true
     },
@@ -6195,7 +6195,7 @@
         "encodeurl": "~1.0.2",
         "escape-html": "~1.0.3",
         "etag": "~1.8.1",
-        "fresh": "0.5.2",
+        "fresh": ""version": "0.5.2",",
         "http-errors": "~1.7.2",
         "mime": "1.6.0",
         "ms": "2.1.1",
diff --git a/package.json b/package.json
index 1f2b85c..1ec34ec 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "sphinx_rtd_theme",
   "main": "js/theme.js",
-  "version": "0.5.2",
+  "version": ""version": "0.5.2",",
   "scripts": {
     "dev": "webpack-dev-server --open --config webpack.dev.js",
     "build": "webpack --config webpack.prod.js",
@stsewd
Copy link
Member

stsewd commented Apr 6, 2021

Last time I used it had the similar errors, had to manually fix some.

Blendify added a commit that referenced this issue Apr 9, 2021
Found while looking into #1117
Blendify added a commit that referenced this issue Apr 9, 2021
@Blendify
Copy link
Member

Blendify commented Apr 9, 2021

The issue appears to be with the special meaning of colons in format strings remove the : in https://github.com/readthedocs/sphinx_rtd_theme/blob/master/setup.cfg#L50 it works as expected. I am not sure how to escape the colon, this may be a bug in bump2version.

@agjohnson
Copy link
Collaborator

bump2version worked fine for me. I performed several updates:

  • bump2version dev to get 1.0.0alpha1
  • bump2version release to get 1.0.0rc1
  • bump2version dev to get 1.0.0rc2

I think this can be closed.

@agjohnson
Copy link
Collaborator

agjohnson commented Aug 18, 2021

Oh wait. Are folks using bumpversion or bump2version? I believe these are completely separate packages. bump2version is the maintained fork of bumpversion and the dependency specified in setup.py.

@astrojuanlu
Copy link
Contributor Author

Woops, I initially used bumpversion, gotcha

@agjohnson
Copy link
Collaborator

Ah yeah, it's confusing, I'm guessing there are a few folks that hit this then. bump2version is a dev dependency, but perhaps you had bumpversion installed from somewhere else. 🤷

@benjaoming
Copy link
Contributor

benjaoming commented Aug 19, 2022

This issue has reappeared in package-lock.json since it was marked as fixed, namely in 143b350

bumpversion should not touch package-lock.json at all, it's an artifact generated by npm.

@agjohnson
Copy link
Collaborator

agjohnson commented Aug 19, 2022

This issue seems specific to using the wrong bumpversion. I think #1310 is probably still valid. Also, the output is different in this issue.

@benjaoming
Copy link
Contributor

Right, sorry, I misread the outputs of package-lock.json in the issue description, I thought it was the same issue of bumping the versions of node packages -- but here, we are seeing a very bad syntax error as well, which is definitely not the same as #1310.

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

Successfully merging a pull request may close this issue.

5 participants