Skip to content

TypeError: 'NoneType' object is not iterable #209

@jeyrce

Description

@jeyrce

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions