peritus / bumpversion

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

Allow wildcards in [bumpversion:file:...] #104

Open louisl opened 9 years ago

louisl commented 9 years ago

Can I specify folders in .bumpversion.cfg?,

I'm trying to use this to update all the @version x.x.x php doc block tags in specific folders in my project.

peritus commented 9 years ago

You mean as in

[bumpversion:file:path/to/source/*.php]

would expand and match

path/to/source/a_file.php
path/to/source/a_second_file.php
path/to/source/another_file.php
path/to/source/file_that_does_not_start_with_a.php

?

No, it doesn't work that way at the moment, you'd have to specify all the files individually in the configuration.

I like the idea though, pull requests welcome :)

louisl commented 9 years ago

Yes, thats what I need.

I have the config working on all the unique files but it'll be back to the old find and replace on folders for now then :)

Thanks for the quick reply.

peritus commented 9 years ago

@louisl

back to the old find and replace on folders for now then

You have folders that have version numbers in their names or am I misunderstanding this ?

louisl commented 9 years ago

@peritus No not in the folders names, this is for a website so the version is in the header doc blocks of each php and js file and in a constants file as a variable. Also it's in bower.json, composer.json, package.json. So on a version bump I need to update a lot of places.

jackmaney commented 7 years ago

I'm currently working on this, by first trying the builtin glob library, and if that fails (because glob doesn't expand everything that a shell can, eg curly brackets) then calls the shell via subprocess.check_output. What I have seems to be working. Currently reading through the unit tests and adding some tests for multiple files via globs. I should have a PR ready within a few days or so.

jackmaney commented 7 years ago

Incidentally, do you mind if I refactor the 1864 line tests/test_cli.py module into some separate modules containing related tests?

~Also, do you mind if I cleanup tmpdir after each test that uses it (so I don't have to worry about which files already exist within it)?~ (Nevermind, just looked at the pytest docs and saw that tmpdir is unique per test function invocation...)

lorengordon commented 6 years ago

@jackmaney you ever get a PR for this? Or is your work available in a fork/branch?

jqadev commented 5 years ago

This feature is strongly needed, because specifying all the files individually in the configuration is uncomfortable and time-consuming when working on large projects.

@jackmaney what is the state of your PR?