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

Multiple configurations for a single file #13

Open
espetro opened this issue May 6, 2021 · 4 comments
Open

Multiple configurations for a single file #13

espetro opened this issue May 6, 2021 · 4 comments

Comments

@espetro
Copy link

espetro commented May 6, 2021

Hi,

I want to use versionner for updating the version of my package both on development and release stage. For the development stage, I would need to add a trailing -SNAPSHOT to the version, whereas that is not needed for the release stage.
However, with the current configuration I cannot do it. Is there any way to do it? Could this be added to the tool? I'm more than happy to contribute.

@msztolcman
Copy link
Owner

Hi @espetro,

I need to understand your usecase. You want to have two different configurations for two different usecases (dev and release)? Or you want to add to version something that it's unexpected? Sorry, but need more information :)
Could you please give me some examples what you want to achieve?

@msztolcman
Copy link
Owner

Hm, I think I'm tired ;) I've made small change to versionner (without releasing it yet, so need to be installed from branch, sth like:
pip install git+https://github.com/msztolcman/versionner.git

It allows you to specify porject-wide config file using env variables:
export VERSIONNER_PROJECT_CONFIG_FILE=.versionner-other.rc

Is this what you need? Am I understand correctly now?

@espetro
Copy link
Author

espetro commented May 10, 2021

Yes, sorry for not providing you with more information 😅

I'm willing to use this tool for 2 usecases: whilst I'm developing, I want to have a X.Y.Z-SNAPSHOT version, but when I'm releasing a new version, I want it to be like X.Y.Z i.e. without the trailing -SNAPSHOT part.

I will try the new update you did, thanks! As a proposal, it could be an optional parameter --config-file or similar, just as it's done here with --global-config.

@msztolcman
Copy link
Owner

For now, using --arguments will be hard for this purpose - versionner needs to know configuration before it starts parsing arguments. This may change in future, but don't know details.

BTW, env variables are more elastic for this purpose. Can be used in same way as arguments (VERSIONNER_PROJECT_CONFIG_FILE=path-to-file ver vs ver --project-config-file=path-to-file), also in alias or custom shell functions, and are easier provided using some tools like ansible or similar.

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

2 participants