Change dynamic versioning approach#2
Merged
Conversation
3b615ae to
7499eda
Compare
davidhjp01
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed the approach how dynamic versioning is realised
src/pystclient/__about__.pywas single source of truth for version number.pyproject.tomlwas dynamically resolved viahatch.version.pyproject.tomlis single source of truth for version number.__version__attribute insidesrc/pystclient/__init__.pygets dynamically resolved from project metadatapyproject.tomlwhenever the package is installed in the local environment, i.e. with every call touv sync,uv run, or when a user installs the package via pip.This means: As long as the package is installed (even when installed in "just" editable mode) the dynamic resolution of the version number from
pyproject.tomlas single source of truth works just fine.With that, the dynamic version is reliably resolved independent of whether or not the package is actually being built (as in the former approach, via
hatch.version). It is now sufficient that the package is installed in the local environment. Only in the hypothetical case that one runs code from the package directly from source, without installing the package beforehand, the version resolution would fail. However, using code from a package without installing it has, latest since the advent ofuv, become a very uncommon case.