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

bumpversion does not work in directories below .bumpversion.cfg top-level directory #225

Open
adamgranthendry opened this issue Aug 3, 2021 · 2 comments

Comments

@adamgranthendry
Copy link

adamgranthendry commented Aug 3, 2021

In a "typical" project directory structure:

project/
|
└───.venv/
|
└───project/
|   |
|   └─── file1.py
|   |
|   └─── file2.py
|
└─── .bumpversion.cfg

bumpversion will incorrectly tell the user that --new-project is required if running bumpversion from a subdirectory of the top-level directory:

project/project> bumpversion minor
usage: bumpversion [-h] [--config-file FILE] [--verbose] [--list] [--allow-dirty] [--parse REGEX] [--serialize FORMAT] [--search SEARCH] [--replace REPLACE]
                   [--current-version VERSION] [--no-configured-files] [--dry-run] --new-version VERSION [--commit | --no-commit] [--tag | --no-tag] [--sign-tags | --no-sign-tags]    
                   [--tag-name TAG_NAME] [--tag-message TAG_MESSAGE] [--message COMMIT_MSG] [--commit-args COMMIT_ARGS]
                   part [file [file ...]]
bumpversion: error: the following arguments are required: --new-version

but works perfectly well when run from the top-level directory where .bumpversion.cfg is visible.

@florisla
Copy link
Collaborator

I'm not sure if this a bug or a design choice.

Many configuration files (e.g. .pylintrc) also only work when they're present at the right level.

Would it help if the error message can indicate if you're in the wrong directory?

@lowell80
Copy link
Contributor

lowell80 commented Apr 5, 2022

I've hit this many times myself and when training new developers to use bumpversion. I'd say "YES", a better error message telling me that a higher level has a .bumpversion.cfg would be reduce confusion!

That's my 2 cents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants