help need: error while serialize following pattern (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.(?P<build>\d+)
KursLabIgor opened this issue · 0 comments
KursLabIgor commented
I need to support following version patter like : 0.0.0.0
i have following config file
[bumpversion]
current_version = 0.0.0.0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.(?P<build>\d+)
serialize =
{major}.{minor}.{patch}.{build}
{major}.{minor}.{patch}
[bumpversion:part:build]
[bumpversion:file:setup.py]
error
Attempting to increment part 'minor'
Values are now: build=0, major=0, minor=1, patch=0
Dry run active, won't touch any files.
Evaluating 'parse' option: '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)\.(?P<build>\d+)' does not parse current version '0.1.0'
New version will be '0.1.0'
Asserting files setup.py contain the version string...
Traceback (most recent call last):
File "/usr/local/bin/bumpversion", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/bumpversion/cli.py", line 125, in main
_replace_version_in_files(files, current_version, new_version, args.dry_run, context)
File "/usr/local/lib/python3.8/site-packages/bumpversion/cli.py", line 624, in _replace_version_in_files
f.replace(current_version, new_version, context, dry_run)
File "/usr/local/lib/python3.8/site-packages/bumpversion/utils.py", line 112, in replace
context["new_version"] = self._versionconfig.serialize(new_version, context)
File "/usr/local/lib/python3.8/site-packages/bumpversion/version_part.py", line 278, in serialize
version, self._choose_serialize_format(version, context), context
File "/usr/local/lib/python3.8/site-packages/bumpversion/version_part.py", line 257, in _choose_serialize_format
self._serialize(
File "/usr/local/lib/python3.8/site-packages/bumpversion/version_part.py", line 201, in _serialize
for k in version:
TypeError: 'NoneType' object is not iterable
what's wrong with my config file?