Skip to content

Notifier._build_context(): mod.__version__ is outdated#273

Open
der-flo wants to merge 1 commit into
airbrake:masterfrom
adigi-ai:package-version-from-metadata
Open

Notifier._build_context(): mod.__version__ is outdated#273
der-flo wants to merge 1 commit into
airbrake:masterfrom
adigi-ai:package-version-from-metadata

Conversation

@der-flo

@der-flo der-flo commented Sep 19, 2025

Copy link
Copy Markdown

Notifier._build_context(): mod.__version__ is outdated and leads to warnings with multiple packages:

UserWarning: The 'version' attribute is deprecated and will be removed in AAA X.Y. Use feature detection, or importlib.metadata.version("AAA"), instead.

I changed it to use importlib.metadata.version() instead of __version__. It is loosely based on the solution in #269.

See https://peps.python.org/pep-0396/, https://packaging.python.org/en/latest/discussions/versioning/#runtime-version-access, https://packaging.python.org/en/latest/discussions/single-source-version/#single-source-version for background information

Maybe solves #269

It would be nice, if you merge my or similar changes and release a new version of the package. Thanks!

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