Skip to content

Read the package version from lionweb.__version__ - #12

Merged
ftomassetti merged 1 commit into
mainfrom
fix/single-version-source
Sep 26, 2026
Merged

ftomassetti merged 1 commit into
mainfrom
fix/single-version-source

Conversation

@ftomassetti

@ftomassetti ftomassetti commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

The package version was repeated in three places: .bumpversion.cfg, pyproject.toml and src/lionweb/__init__.py.

This PR brings it down to two:

  • pyproject.toml declares dynamic = ["version"] and reads it from lionweb.__version__ via [tool.setuptools.dynamic]. setuptools reads a literal __version__ statically, without importing the package, so building doesn't need the runtime dependencies.
  • The [bumpversion:file:pyproject.toml] section is removed from .bumpversion.cfg. bump2version now updates only src/lionweb/__init__.py and its own current_version, which it needs as the starting point.

release.sh is unchanged.

Testing

  • python -m build produces lionweb-0.4.2.tar.gz and lionweb-0.4.2-py3-none-any.whl, so the version is picked up from __init__.py.
  • bump2version --dry-run patch touches only src/lionweb/__init__.py and .bumpversion.cfg (0.4.2 → 0.4.3).

The version was repeated in .bumpversion.cfg, pyproject.toml and
src/lionweb/__init__.py. pyproject.toml now declares the version as
dynamic and setuptools reads it from lionweb.__version__, so
bump2version no longer needs to rewrite pyproject.toml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ftomassetti
ftomassetti merged commit 3a26811 into main Sep 26, 2026
5 checks passed
@ftomassetti
ftomassetti deleted the fix/single-version-source branch September 26, 2026 18:40
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.

1 participant