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

Issue while using search and replace configurations. #202

Open
mss30 opened this issue Apr 19, 2019 · 2 comments
Open

Issue while using search and replace configurations. #202

mss30 opened this issue Apr 19, 2019 · 2 comments

Comments

@mss30
Copy link

mss30 commented Apr 19, 2019

Thanks for replying. I'd tried to add search and replace options but these don't work as expected.

Here is my .bumpversion.cfg file:
[bumpversion]
current_version = 0.2.2

[bumpversion:file:setup.py]
search = version='{current_version}',
replace = version='{new_version}',

And here is the setup.py when I run the bumpversion command:

from setuptools import setup, find_packages

setup(
    name='my-pack',
    version='0.2.3',
    packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
    install_requires=[
        'someotherpackage==version='0.2.3',',
    ],
)

It would be great if you can help me in this problem.

Originally posted by @mss30 in #201 (comment)

@jawahar273
Copy link

jawahar273 commented May 8, 2019

It is best to remove quotes in .bumpversion.cfg and it run

[bumpversion:file:setup.py]
search = version={current_version},
replace = version={new_version},

@jlejeune
Copy link

I had the same issue using the same bumpversion config file and after using pdb to understand why this is happening, I realized that the _replace_version_in_files() function was called two times on the same setup.py file.
It was because I used the command : bumpversion minor setup.py but no need to specify setup.py as positional argument because it's already specified in bumpversion config file.
I don't really understand why on the second run it updated the dependency version but by running only that command bumpversion minor it does the trick.

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

3 participants