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

Fix type annotations in Python 3.9 #232

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Conversation

bbguimaraes
Copy link
Collaborator

TypeAlias was introduced in 3.10.

`TypeAlias` was introduced in 3.10.
Comment on lines -36 to -38
try:
from typing import Self
except ImportError:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this because mypy complains about the ImportError:

$ env-3.9/bin/mypy --follow-imports skip --disable-error-code import-untyped bw2data/revisions.py
[…]
bw2data/revisions.py:37: error: Module "typing" has no attribute "Self"  [attr-defined]
bw2data/revisions.py:37: note: Use `from typing_extensions import Self` instead
bw2data/revisions.py:37: note: See https://mypy.readthedocs.io/en/stable/runtime_troubles.html#using-new-additions-to-the-typing-module
[…]

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.19%. Comparing base (0c61d18) to head (629de69).
Report is 146 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
+ Coverage   83.24%   85.19%   +1.94%     
==========================================
  Files          39       42       +3     
  Lines        3730     4471     +741     
==========================================
+ Hits         3105     3809     +704     
- Misses        625      662      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmutel cmutel merged commit 733aff4 into brightway-lca:main Jan 20, 2025
26 checks passed
@cmutel cmutel deleted the types_3.9 branch January 20, 2025 12:35
@cmutel
Copy link
Member

cmutel commented Jan 20, 2025

Thanks @bbguimaraes !

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.

2 participants