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

use importlib.metadata.version to get package version #2316

Closed
davidism opened this issue Aug 21, 2023 · 2 comments
Closed

use importlib.metadata.version to get package version #2316

davidism opened this issue Aug 21, 2023 · 2 comments

Comments

@davidism
Copy link

Problem Statement

Modern packaging metadata provides a standard way to get the version of any package. Flask and other Pallets projects will be deprecating the __version__ attribute. Instead, use importlib.metadata.version if the version is needed (or use feature detection). This will work regardless of what version is installed.

It looks like your Pyramid integration already does this, might be worth it to use the standard consistently across all integrations.

Solution Brainstorm

Replace from flask import __version__ as FLASK_VERSION with FLASK_VERSION = importlib.metadata.version("flask"). Possibly replace all __version__ imports.

@sentrivana
Copy link
Contributor

Thanks for the heads up @davidism, we'll look into this.

@sentrivana
Copy link
Contributor

Fixed by #2338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants