Skip to content

Use importlib to set __version__ and bump to 0.4.0b1#235

Open
JR-1991 wants to merge 1 commit into
mainfrom
beta-release
Open

Use importlib to set __version__ and bump to 0.4.0b1#235
JR-1991 wants to merge 1 commit into
mainfrom
beta-release

Conversation

@JR-1991

@JR-1991 JR-1991 commented Jun 18, 2026

Copy link
Copy Markdown
Member

This pull request updates the versioning approach for the pyDataverse package and makes related improvements to how the version is managed and reported. Instead of hardcoding the version in the codebase, it now dynamically retrieves the version from the installed package metadata, and the project version is updated to a beta release.

Version management improvements:

  • The __version__ attribute in pyDataverse/__init__.py is now dynamically set using importlib.metadata.version("pyDataverse"), ensuring it always reflects the installed package version. If the package is not installed, a RuntimeError is raised. [1] [2]
  • The hardcoded version string in pyDataverse/__init__.py is removed to avoid inconsistencies with the actual installed version.

Project version update:

  • The project version in pyproject.toml is updated from 0.4.0 to the beta release 0.4.0b1.

Replace the hardcoded __version__ with importlib.metadata.version("pyDataverse") so the runtime reports the installed distribution version and raise a RuntimeError if the package isn't installed. Also update the project version to 0.4.0b1 in pyproject.toml to mark a pre-release.
@JR-1991 JR-1991 self-assigned this Jun 18, 2026
@JR-1991 JR-1991 added the pkg:pkg Package related activities label Jun 18, 2026
@JR-1991 JR-1991 added this to the 0.4.0 milestone Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:pkg Package related activities

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant