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

too few arguments #107

Closed nap closed 8 years ago

nap commented 9 years ago
unary$ bumpversion --verbose
Reading config file .bumpversion.cfg:
[bumpversion]
current_version = 0.0.1
commit = False
tag = False
message = "pypi version {new_version}"

[bumpversion:file:setup.py]

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
usage: bumpversion [-h] [--config-file FILE] [--verbose] [--list]
                   [--allow-dirty] [--parse REGEX] [--serialize FORMAT]
                   [--search SEARCH] [--replace REPLACE]
                   [--current-version VERSION] [--dry-run] --new-version
                   VERSION [--commit | --no-commit] [--tag | --no-tag]
                   [--tag-name TAG_NAME] [--message COMMIT_MSG]
                   part [file [file ...]]
bumpversion: error: too few arguments

Not sure why the app is telling me that I need to provide more argument since I believe everything is handled by the .bumpversion.cfg.

But then if I provide a filename, it run but does nothing:

unary$ bumpversion setup.py
ternary:PlexCleaner unary$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

But if I provide a filename and a part:

unary$ bumpversion patch setup.py --verbose
Reading config file .bumpversion.cfg:
[bumpversion]
current_version = 0.0.1
commit = False
tag = False
message = "pypi version {new_version}"

[bumpversion:file:setup.py]

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
Parsing version '0.0.2' using regexp '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)'
Parsed the following values: major=0, minor=0, patch=2
New version will be '0.0.2'
Asserting files setup.py, setup.py contain the version string:
Found '0.0.1' in setup.py at line 1: __version__ = '0.0.1'
Found '0.0.1' in setup.py at line 1: __version__ = '0.0.1'
Changing file setup.py:
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,5 @@
 __author__ = 'Jean-Bernard Ratte - jean.bernard.ratte@unary.ca'
-__version__ = '0.0.1'
+__version__ = '0.0.2'

 import os
 import sys
Not changing file setup.py
Writing to config file .bumpversion.cfg:
[bumpversion]
current_version = 0.0.2
commit = False
tag = False
message = "pypi version {new_version}"

[bumpversion:file:setup.py]

Would prepare Git commit
Would add changes in file 'setup.py' to Git
Would add changes in file 'setup.py' to Git
Would add changes in file '.bumpversion.cfg' to Git
Would commit to Git with message '"pypi version 0.0.2"'
Would tag 'v0.0.2' in Git

unary$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   .bumpversion.cfg
    modified:   setup.py

no changes added to commit (use "git add" and/or "git commit -a")
peritus commented 8 years ago

Not sure why the app is telling me that I need to provide more argument since I believe everything is handled by the .bumpversion.cfg

You need to tell it the part of the version that you want to update. That information is not in .bumpversion.cfg .. the usage output you posted above gives that information.

Please re-open if I misunderstood the intention of this issue.