peritus / bumpversion

Version-bump your software with a single command
https://pypi.python.org/pypi/bumpversion
MIT License
1.5k stars 148 forks source link

All strings matching current version are bumping up in setup.py file. #201

Closed mss30 closed 5 years ago

mss30 commented 5 years ago

Here is the problem. My setup.py look like this (as below):

from setuptools import setup, find_packages

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

After running bumpvesrion command bumpversion --current-version `python setup.py --version` patch setup.py> I got this output:

from setuptools import setup, find_packages

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

The problem is the bumpversion should only bump the version of my-pack only instead it is bumping all the versions (or I can say strings) matching current version.

Is there any available solution for this issue?

peritus commented 5 years ago

Hey. Please have a look at the search and replace options.

Closing as duplicate of #178 #76 #46, but feel free to re-open.

mss30 commented 5 years ago

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.