Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate __version__ #5230

Closed
davidism opened this issue Aug 21, 2023 · 4 comments · Fixed by #5242
Closed

deprecate __version__ #5230

davidism opened this issue Aug 21, 2023 · 4 comments · Fixed by #5242
Milestone

Comments

@davidism
Copy link
Member

The __version__ attribute is an old pattern from early in Python packaging. Setuptools eventually made it easier to use the pattern by allowing reading the value from the attribute at build time, and some other build backends have done the same.

However, there's no reason to expose this directly in code anymore. It's usually easier to use feature detection (hasattr, try/except) instead. importlib.metadata.version("werkzeug") can be used to get the version at runtime in a standard way, if it's really needed.

@davidism davidism added this to the 3.0.0 milestone Aug 21, 2023
@davidism
Copy link
Member Author

Reported to Sentry here: getsentry/sentry-python#2316

@pallets pallets deleted a comment from jgirouard23 Aug 24, 2023
@pallets pallets deleted a comment from ah410 Aug 27, 2023
@pallets pallets deleted a comment from B2-krunalrana Aug 27, 2023
@yokeshwaran1

This comment was marked as outdated.

@davidism

This comment was marked as outdated.

@yokeshwaran1

This comment was marked as outdated.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants