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

Support a default value for dynamic version source "env"` #1853

Open
abrahammurciano opened this issue Dec 15, 2024 · 0 comments · May be fixed by #1854
Open

Support a default value for dynamic version source "env"` #1853

abrahammurciano opened this issue Dec 15, 2024 · 0 comments · May be fixed by #1854

Comments

@abrahammurciano
Copy link

Right now, hatch has an environment version source, which can be used to specify an environment variable to take the version from. e.g:

[tool.hatch.version]
source = "env"
variable = "MY_VERSION"

This is ideal for setting the version from an external source (e.g. in CICD), but this also means that if the environment variable is not set, some commands (e.g. pip install -e . will fail because the version was not set.

It would be great to have an optional default option to specify the version to use if none is set. e.g.

[tool.hatch.version]
source = "env"
variable = "MY_VERSION"
default = "0+dev"
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

Successfully merging a pull request may close this issue.

1 participant