Add ability to append build number to version identifier at build time
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request
Currently, poetry assumes / forces you to define your product version number explicitly in the pyproject.toml
file. This is fine for building releases but doesn’t work well when building pre-releases since such builds typically share the same target version. To avoid name/version clashes between packages, poetry should have some way to append a build number to the final package version at build time.
When using setuptools this is typically handled by appending a suffix such as dev
or alpha
followed by some sort of unique identifier such as a timestamp or build number. I’d like to see something similar in poetry.
What I thought might work best is to add an optional suffix parameter to the poetry build
command which, when provided, would be appended to the version identifier stored in the the toml file. So if the static version in the toml file were, say, “1.0.0” and you ran poetry build --version_sufix = ".dev$BUILD_ID"
or something similar, then the generated package would be versioned as “1.0.0.dev1234” (where “1234” is the current build number as defined by the environment variable BUILD_ID).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:38
- Comments:15 (1 by maintainers)
Top GitHub Comments
I’d think this is the most wanted use-case for #693. Once this has landed it should not be long until setuptools-scm/versioneer-style plugins arrive. There have been tons of requests in that direction #5, #185, #672, #1034 and probably a lot more people waiting for this on the side-lines.
Workaround:
Assuming you have a numeric, increasing build ID, of course. I don’t. 😦