oceanprotocol / ocean.py

🦑 Ocean Protocol's Python library to privately & securely publish, exchange, and consume data.
https://oceanprotocol.com
Apache License 2.0
172 stars 78 forks source link

bumpversion.sh VersionNotFoundException in setup.py #194

Closed trentmc closed 3 years ago

trentmc commented 3 years ago

Describe the bug I got a VersionNotFoundException while trying to use bumpversion.sh as part of release process

To Reproduce

Go through the steps in release-process.md. Step 2 is make a call to ./bumpversion.sh.

I called it with the "patch" sub-argument. It gave me this traceback:

(venv) trentmc@trentmcLnv:~/code/ocean.py$ ./bumpversion.sh patch
+ set -e
++ command -v bumpversion
+ '[' -x /home/trentmc/code/ocean.py/venv/bin/bumpversion ']'
+ git diff-index --quiet HEAD --
+ '[' 1 -lt 1 ']'
+ [[ patch != \m\a\j\o\r ]]
+ [[ patch != \m\i\n\o\r ]]
+ [[ patch != \p\a\t\c\h ]]
+ [[ '' == \-\-\t\a\g ]]
+ bumpversion --no-tag patch
Traceback (most recent call last):
  File "/home/trentmc/.local/bin/bumpversion", line 8, in <module>
    sys.exit(main())
  File "/home/trentmc/.local/lib/python3.8/site-packages/bumpversion/cli.py", line 124, in main
    _check_files_contain_version(files, current_version, context)
  File "/home/trentmc/.local/lib/python3.8/site-packages/bumpversion/cli.py", line 618, in _check_files_contain_version
    f.should_contain_version(current_version, context)
  File "/home/trentmc/.local/lib/python3.8/site-packages/bumpversion/utils.py", line 68, in should_contain_version
    raise VersionNotFoundException(
bumpversion.exceptions.VersionNotFoundException: Did not find 'version='0.5.11'' in file: 'setup.py'

There were no changes made to setup.py or otherwise.

Expected behavior

trentmc commented 3 years ago

The fix of changing from double quotes to single quotes works because the py file called by bumpversion.sh only looks for single quotes.

trentmc commented 3 years ago

Commit 1/2, above (https://github.com/oceanprotocol/ocean.py/commit/4cd04ae895df12dc61ba8e6a17f8c3002ff1d0e8) led to complaints by black and flake8.

Commit 2/2, done just now (https://github.com/oceanprotocol/ocean.py/commit/ab8745a6d4ebe4ef7c67ce3da8e7e6ec3acce5de) fixes those.