Closed nyanshell closed 9 years ago
So, bumpversion is agnostic to the file format by design (i.e. it doesn't know about what version is a dependency and which is the software that is versioned).
Does https://github.com/peritus/bumpversion/issues/76#issuecomment-75938030 work for you or is this about something else ?
@peritus Not really, I edited my .bumpversion.cfg
like this:
[bumpversion]
files = setup.py
commit = True
tag = True
current_version = 0.0.1
[bumpversion:file:setup.py]
search = version='{current_version}',
replace = version='{new_version}',
but it still did change like this:
requirements = [
- "package>=0.0.1"
+ "package>=0.0.2"
# TODO: put package requirements here
]
@@ -19,7 +19,7 @@
setup(
name='test-proj',
- version='0.0.1',
+ version='0.0.2',
description='blablabla',
long_description=readme,
Strange. What if you remove
files = setup.py
?
Oh, it works somehow:
(yasaka)mitsukeru@Miku:~/project/test-proj$ bumpversion patch --dry-run --verbose
Reading config file .bumpversion.cfg:
[bumpversion]
commit = True
tag = True
current_version = 0.0.1
[bumpversion:file:setup.py]
search = version='{current_version}',
replace = version='{new_version}',
Parsing version '0.0.1' using regexp '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)'
Parsed the following values: major=0, minor=0, patch=1
Attempting to increment part 'patch'
Values are now: major=0, minor=0, patch=2
Dry run active, won't touch any files.
New version will be '0.0.2'
Asserting files setup.py contain the version string:
Found 'version='0.0.1',' in setup.py at line 21: version='0.0.1',
Would change file setup.py:
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,7 @@
setup(
name='test-proj',
- version='0.0.1',
+ version='0.0.2',
description='blablabla',
long_description=readme,
author='gestapolur',
Would write to config file .bumpversion.cfg:
[bumpversion]
commit = True
tag = True
current_version = 0.0.2
[bumpversion:file:setup.py]
search = version='{current_version}',
replace = version='{new_version}',
Would prepare Git commit
Would add changes in file 'setup.py' to Git
Would add changes in file '.bumpversion.cfg' to Git
Would commit to Git with message 'Bump version: 0.0.1 → 0.0.2'
Would tag 'v0.0.2' in Git
But such configure seems werid.
But such configure seems werid.
I'm committed to making bumpversion as simple as possible (though, not simpler). I'd like your opinion on what could be done better (one action point for me is pointing this out in the docs because you're not the first person to ask about this since it was implemented).
One idea would be to make bumpversion
language-specific (so that it knows about setup.py
or setup.cfg
and to differentiate between deps and versions of the package at hand), but then again there are a few hundred other software package metadata specifications.
Also happy for you that it works :)
If current_version same with a requirement package's version in a meta file(like
setup.py
), bumpversion will wrongly bump requirments's version.In following example, "package>=0.0.1" shouldn't be changed: