-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 finding project version from sources #4971
Comments
Hello @pbarker, there are no plans to provide such a feature in Poetry, because we believe that the version is one of the static metadata and the However with the upcoming minor release (1.2) there will be a plugin system and there is already a plugin called poetry-version-plugin that provides what you are asking for. fin swimmer |
Hey @finswimmer, thanks for the response. Yeah I've seen
Could that just be the default? I don't see anything in the PEP denoting that should be the case. In most other parts of the software world, the SCM version is preferred because its the root-most version. Lots of existing staple Python projects version their packages this way. If it can't be the default, would there be a way to expand the scope of plugins to cover this? From reading the code it looks like version is pulled right when the config file is passed. Would it be possible to inject plugins there? Thanks |
Also worth noting our current flow with Poetry now requires us to use Its a very common and natural flow to want your package version to sync with SCM, I would go as far as to say it's best practice. It would be nice if there was at least an avenue of doing this in the project. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
There are a number of workflows which would benefit from pulling the
version
parameter inpyproject.toml
dynamically. PDM has a nice way of doing this:Our use case involves using private Python modules which we prefer to install directly from git. In doing so, using the git revision produces an accurate and easily traceable version for the python package. The only way to replicate this today is to bump the version each time you commit, which is a lot of overhead, and there isn't a great way of automating this.
#4299 also mentions a use case for wanting to use
__init__.py
It is worth noting tools like https://github.com/mtkennerly/poetry-dynamic-versioning cannot solve this problem when installing from git. The version is set on building the wheel which never happens on scm install, so you end up with a package version of
0.0.0
. It's not clear to me if any plugin derived method could do this properly.The text was updated successfully, but these errors were encountered: