-
Notifications
You must be signed in to change notification settings - Fork 234
Install typing_extensions for all Python version #7096
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
Install typing_extensions for all Python version #7096
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7096 +/- ##
==========================================
+ Coverage 77.60% 77.61% +0.01%
==========================================
Files 566 566
Lines 43549 43535 -14
==========================================
- Hits 33793 33784 -9
+ Misses 9756 9751 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
To be clear, does installing the extension mean that you can now import them from |
Is it not correct that for us to move to Python >= 3.11 means that all dependencies MUST support it? And if this is true, they should all have access to |
No, you always import from |
I dunno, they can simply choose to always use the latest typing features that way, for example. |
I'm aware of |
|
@danielhollas I'd like to drop |
Yes, every time we drop a Python version, we should convert the corresponding
I think dropping the package entirely should not be a goal --- Python typing is still evolving quite a lot, and AiiDA codebase is quite comples so it's likely we will end up using newer features as we expand the typing coverage (I already know about an upcoming feature in 3.15 that we could utilize. Another potentially useful construct is TypeIs)
To be clear, the motivation for this PR was to make our lives simpler. The argument about dependencies was just to say that we currently make it more complicated for ourselves for no benefit. |
37d4dd3 to
cf71344
Compare
edan-bainglass
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I somehow feel like this might be an issue later, but maybe I just haven't read enough about it. You (@danielhollas) clearly have, considering the recent deluge of typing PRs 😅 Maybe you could give a short talk on the typing system in an upcoming AiiDA team meeting 🤔
|
Thanks. Not sure what problems you're envisioning but happy to talk about it. :-) |
Nothing envisioned 😅 Just a hunch, but again, one that is perhaps based in insufficient information 🙂 |
We currently use typing_extensions for several important typing features (Self, TypeAlias, ParamSpec), but we only install it for Python versions <3.11. But in practice, many other aiida-core dependencies depend on this package (sqlalchemy, pydantic) so it ends up being installed even on Python 3.14.
So let's just install it for all Python versions which let's us avoid the awkward
try...exceptimport dance.Split from #7091.