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

Bumpversion fails when a part only contain one non-numeric part value #185

Open
mfcabrera opened this issue Sep 3, 2018 · 0 comments
Open

Comments

@mfcabrera
Copy link

I am attempting to use the following configuration:

current_version = 0.1-staging
parse = (?P<major>\d+)\.(?P<minor>\d+)(-(?P<release>[a-z]+))? 
commit = False
tag = False
serialize =
  {major}.{minor}-{release}
  {major}.{minor}
  
  


[bumpversion:file:sales_ground_truth/VERSION]

[bumpversion:part:release]
values =
    staging
 

The Idea is to have things like: 0.1-staging -> 0.1 and so on. However, with this configuration I get the following error:

Parsed the following values: major=0, minor=1, release=staging
Attempting to increment part 'release'
Traceback (most recent call last):
  File "/Users/mcabrera/development/sales_ground_truth/sales_gt_env/bin/bumpversion", line 11, in <module>
    sys.exit(main())
  File "/Users/mcabrera/development/sales_ground_truth/sales_gt_env/lib/python3.6/site-packages/bumpversion/__init__.py", line 816, in main
    new_version = current_version.bump(positionals[0], vc.order())
  File "/Users/mcabrera/development/sales_ground_truth/sales_gt_env/lib/python3.6/site-packages/bumpversion/__init__.py", line 408, in bump
    new_values[label] = self._values[label].bump()
  File "/Users/mcabrera/development/sales_ground_truth/sales_gt_env/lib/python3.6/site-packages/bumpversion/__init__.py", line 349, in bump
    return VersionPart(self.config.bump(self.value), self.config)
  File "/Users/mcabrera/development/sales_ground_truth/sales_gt_env/lib/python3.6/site-packages/bumpversion/__init__.py", line 308, in bump
    return self._values[self._values.index(value)+1]
IndexError: list index out of range```

If I add an optional value: 

[bumpversion:part:release]
optional_value = gamma
values =
staging
gamma


This works with no problem. 
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