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

DeprecationWarning for accessing attr.__version__ #699

Closed
timothygebhard opened this issue Apr 20, 2023 · 2 comments
Closed

DeprecationWarning for accessing attr.__version__ #699

timothygebhard opened this issue Apr 20, 2023 · 2 comments

Comments

@timothygebhard
Copy link

Line 49 in canmatrix.py is giving me a DeprecationWarning:

DeprecationWarning: Accessing attr.__version__ is deprecated and will be removed in a future release. Use importlib.metadata directly to query for attrs's packaging metadata.
    if attr.__version__ < '17.4.0':  # type: ignore

I think fixing it should be as easy as:

from importlib.metadata import version

if version("attr") < '17.4.0':  # type: ignore
    raise RuntimeError("need attrs >= 17.4.0")

However, the attr package on PyPI currently only is at version 0.3.2, so this will always give a RuntimeError. Additionally, the error message refers to attrs (note the s at the end), and that's also what is required in the setup.py, so maybe it should be attrs everywhere instead of attr? 🙂

ebroecker pushed a commit that referenced this issue Apr 25, 2023
@ebroecker
Copy link
Owner

@timothygebhard
thanks for your report.

ebroecker added a commit that referenced this issue Jun 20, 2023
Co-authored-by: Eduard Bröcker <conuslt@eduard-broecker.de>
@ebroecker
Copy link
Owner

should be fixed

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

No branches or pull requests

2 participants