Skip to content

Expose __version__ on pygrgl package#133

Merged
dcdehaas merged 1 commit intoaprilweilab:mainfrom
rborder:auto-versioning
Apr 30, 2026
Merged

Expose __version__ on pygrgl package#133
dcdehaas merged 1 commit intoaprilweilab:mainfrom
rborder:auto-versioning

Conversation

@rborder
Copy link
Copy Markdown
Contributor

@rborder rborder commented Apr 30, 2026

Summary

  • _grgl.__version__ is already set from GRGL_MAJOR_VERSION/GRGL_MINOR_VERSION in include/grgl/version.h (see src/python/_grgl.cpp:1139-1141), but pygrgl/grg.py uses from _grgl import *, which skips dunder names. As a result pygrgl.__version__ was unset.
  • Re-export it explicitly in pygrgl/__init__.py so version.h is the single source of truth for both setup.py and the importable package.

Test plan

  • python -c "import pygrgl; print(pygrgl.__version__)" prints 2.7
  • python -c "from pygrgl import __version__; print(__version__)" prints 2.7

The C++ pybind module already sets _grgl.__version__ from
GRGL_MAJOR_VERSION/GRGL_MINOR_VERSION in include/grgl/version.h, but
pygrgl/grg.py uses 'from _grgl import *', which skips dunder names. As
a result, pygrgl.__version__ was unset.

Re-export it explicitly so version.h is the single source of truth for
both setup.py and the importable package.
@dcdehaas dcdehaas merged commit a544f33 into aprilweilab:main Apr 30, 2026
3 checks passed
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