Skip to content

Change dynamic versioning approach#2

Merged
davidhjp01 merged 3 commits into
mainfrom
change-dynamic-versioning-approach
May 7, 2026
Merged

Change dynamic versioning approach#2
davidhjp01 merged 3 commits into
mainfrom
change-dynamic-versioning-approach

Conversation

@ClaasRostock

@ClaasRostock ClaasRostock commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Changed the approach how dynamic versioning is realised

  • Old:
    • src/pystclient/__about__.py was single source of truth for version number.
    • Version inside pyproject.toml was dynamically resolved via hatch.version.
  • New:
    • pyproject.toml is single source of truth for version number.
    • __version__ attribute inside src/pystclient/__init__.py gets dynamically resolved from project metadata
  • NOTE: Project metadata (and hence the project version number) gets populated with data from pyproject.toml whenever the package is installed in the local environment, i.e. with every call to uv 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.toml as 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 of uv, become a very uncommon case.

@ClaasRostock ClaasRostock force-pushed the change-dynamic-versioning-approach branch from 3b615ae to 7499eda Compare May 7, 2026 09:31
@ClaasRostock ClaasRostock requested a review from davidhjp01 May 7, 2026 09:34
@ClaasRostock ClaasRostock self-assigned this May 7, 2026
@davidhjp01 davidhjp01 merged commit 130de24 into main May 7, 2026
16 checks passed
@ClaasRostock ClaasRostock deleted the change-dynamic-versioning-approach branch May 7, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants