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

TypeError: 'NoneType' object is not iterable #209

Open
jeyrce opened this issue Mar 29, 2020 · 1 comment
Open

TypeError: 'NoneType' object is not iterable #209

jeyrce opened this issue Mar 29, 2020 · 1 comment

Comments

@jeyrce
Copy link

jeyrce commented Mar 29, 2020

It's my configure following:

[bumpversion]
current_version = 0.1.1-dev
commit = False
tag = True
tag_name = 'v{new_version}'
message = 'Bump version: {current_version} → {new_version}'
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)-(?P<release>[a-z]+)
serialize = 
	{major}.{minor}.{patch}-{release}
	{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = rel
values = 
	dev
	rel

[bumpversion:file:VERSION]
search = {current_version}
replace = {new_version}

[bumpversion:file:README.md]
search = VERSION: {current_version}
replace = {new_version}

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

[bumpversion:file:src/app-one/__init__.py]
search = __version__ == {current_version}
replace = {new_version}

[bumpversion:file:src/app-two/__init__.py]
search = __version__ == {current_version}
replace = {new_version}

When I update the version 0.1.1-dev to 0.1.1-rel, I tried the command:

bumpversion release

Error occured like this:

(python3) jeeyshe@jeeyshe-PC:~/Code/python/xshop$ bumpversion release
Evaluating 'parse' option: '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)-(?P<release>[a-z]+)' does not parse current version '0.1.1'
Traceback (most recent call last):
  File "/home/jeeyshe/.local/share/.virtualenvs/python3/bin/bumpversion", line 8, in <module>
    sys.exit(main())
  File "/home/jeeyshe/.local/share/.virtualenvs/python3/lib/python3.8/site-packages/bumpversion/__init__.py", line 916, in main
    f.replace(current_version, new_version, context, args.dry_run)
  File "/home/jeeyshe/.local/share/.virtualenvs/python3/lib/python3.8/site-packages/bumpversion/__init__.py", line 238, in replace
    context['new_version'] = self._versionconfig.serialize(new_version, context)
  File "/home/jeeyshe/.local/share/.virtualenvs/python3/lib/python3.8/site-packages/bumpversion/__init__.py", line 561, in serialize
    serialized = self._serialize(version, self._choose_serialize_format(version, context), context)
  File "/home/jeeyshe/.local/share/.virtualenvs/python3/lib/python3.8/site-packages/bumpversion/__init__.py", line 542, in _choose_serialize_format
    self._serialize(version, serialize_format, context, raise_if_incomplete=True)
  File "/home/jeeyshe/.local/share/.virtualenvs/python3/lib/python3.8/site-packages/bumpversion/__init__.py", line 485, in _serialize
    for k in version:
TypeError: 'NoneType' object is not iterable

Is there some thing wrong?

@jeyrce
Copy link
Author

jeyrce commented Mar 29, 2020

It's my fault, I make it

[bumpversion]
current_version = 0.1.8-rel
commit = False
tag = True
tag_name = 'v{new_version}'
message = 'Bump version: {current_version} → {new_version}'
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)-{0,1}(?P<release>[a-z]*)
serialize = 
	{major}.{minor}.{patch}-{release}
	{major}.{minor}.{patch}

[bumpversion:part:release]
optional_value = dev
values = 
	dev
	rel

[bumpversion:file:VERSION]
search = {current_version}
replace = {new_version}

[bumpversion:file:README.md]
search = VERSION: {current_version}
replace = {new_version}

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

[bumpversion:file:src/app-one/__init__.py]
search = __version__ == {current_version}
replace = {new_version}

[bumpversion:file:src/app-two/__init__.py]
search = __version__ == {current_version}
replace = {new_version}


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

No branches or pull requests

1 participant