-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Allow for version number to be set #69
Conversation
This doesn't work, but I tried. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for getting this started. I'm open to adding it, but we just need to fix it up.
) | ||
# allow for version to be overwritten, or fetch from vcs | ||
if "POETRY_DYNAMIC_VERSIONING_PRETEND_VERSION" in os.environ.keys: | ||
version = Version(os.environ.get("POETRY_DYNAMIC_VERSIONING_PRETEND_VERSION")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this work, we should do a little bit of refactoring:
_get_version()
currently returns both a Dunamai Version
and an opaque string, but the Version
isn't really needed (it's stored, but not being used currently) and is causing a complication for this new option. I think _get_version()
should just immediately return the opaque string from the environment variable if it's set and ditch the Version
from the return.
Since the environment variable is a backdoor, we should make sure we skip the formatting/bumping logic and use it as-is. In other words, rather than setting 1.2.3
in the env var and letting the plugin bump it to 1.2.4
, I would expect to set the env var to 1.2.4
directly.
) | ||
# allow for version to be overwritten, or fetch from vcs | ||
if "POETRY_DYNAMIC_VERSIONING_PRETEND_VERSION" in os.environ.keys: | ||
version = Version(os.environ.get("POETRY_DYNAMIC_VERSIONING_PRETEND_VERSION")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to call the variable POETRY_DYNAMIC_VERSIONING_BYPASS
to convey that it's bypassing the regular function of the plugin.
Closing in favor of 1fc9aac. |
closes: #62