question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 4 years ago
  • Reactions:38
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
asodeurcommented, Jul 4, 2019

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.

5reactions
reitzigcommented, Jan 17, 2022

Workaround:

poetry version "$(poetry version).dev${BUILD_ID}"
poetry build # or publish

Assuming you have a numeric, increasing build ID, of course. I don’t. 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I upload a new build with same… - Apple Developer
I want to upload a new build with same version number i.e. 4.2. 1, with few changes in the build. Though I don't...
Read more >
Xcode "Manage Version and Build Number" option
It allows you to change version / build number before export/upload (after archiving), previously you had to create a new archive if you...
Read more >
Build numbering and app versioning - Bitrise Docs
Admin access only · Open your app on Bitrise. · Click on App Settings. · On the left, select Builds. · Scroll down...
Read more >
Adding a unique build number to GitHub Actions - Medium
The first thing needed is to create a unique identifier; we will worry about storing and sharing this identifier in a later step....
Read more >
7. Releasing and versioning - Python Packages
Versioning is the process of adding unique identifiers to different versions of your package. The unique identifier you use may be name-based or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found