Skip to content

Dependency upgrade/cleanup after dropping py3.9#7245

Draft
agoscinski wants to merge 3 commits intoaiidateam:drop-py3.9from
agoscinski:py3.9-post-cleanup
Draft

Dependency upgrade/cleanup after dropping py3.9#7245
agoscinski wants to merge 3 commits intoaiidateam:drop-py3.9from
agoscinski:py3.9-post-cleanup

Conversation

@agoscinski
Copy link
Copy Markdown
Collaborator

@agoscinski agoscinski commented Mar 1, 2026

Removing two dependencies that are not anymore needed since we dropped 3.9.

We could also replace pytz with zoneinfo but that affects the hash function because the binary representation is not the same. A database migration seems a bit overkill to drop one dependency.

@agoscinski agoscinski force-pushed the py3.9-post-cleanup branch 2 times, most recently from 156e311 to ab9c709 Compare March 1, 2026 19:42
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.70%. Comparing base (ef6ce28) to head (07373ba).

Files with missing lines Patch % Lines
src/aiida/cmdline/params/types/identifier.py 0.00% 1 Missing ⚠️
src/aiida/cmdline/params/types/plugin.py 50.00% 1 Missing ⚠️
src/aiida/plugins/entry_point.py 83.34% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           drop-py3.9    #7245      +/-   ##
==============================================
+ Coverage       79.70%   79.70%   +0.01%     
==============================================
  Files             565      565              
  Lines           43863    43859       -4     
==============================================
- Hits            34957    34954       -3     
+ Misses           8906     8905       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@agoscinski
Copy link
Copy Markdown
Collaborator Author

Consider also this #7240 (comment)

@agoscinski
Copy link
Copy Markdown
Collaborator Author

Consider #7240 (comment)

In Python 3.10-3.11, `importlib.metadata.entry_points()` returns a
`SelectableGroups` dict (iterating yields group name strings, not
`EntryPoint` objects), unlike the `importlib_metadata` backport which
always returned a flat `EntryPoints` sequence. Flatten the dict before
sorting to fix `AttributeError: 'str' object has no attribute 'group'`.
@agoscinski agoscinski force-pushed the py3.9-post-cleanup branch from 728a4c5 to 07373ba Compare March 4, 2026 14:26
@agoscinski agoscinski changed the title Dependency cleanup after dropping py3.9 Dependency upgrade/cleanup after dropping py3.9 Mar 4, 2026
@agoscinski
Copy link
Copy Markdown
Collaborator Author

Consider upgrading pytest_asyncio https://github.com/aiidateam/aiida-core/pull/7258/changes#r2889517642

@danielhollas
Copy link
Copy Markdown
Collaborator

Consider upgrading pytest_asyncio https://github.com/aiidateam/aiida-core/pull/7258/changes#r2889517642

Let's do that in a separate PR, last time I tried it I ran into some ugly issues.

Copy link
Copy Markdown
Collaborator

@danielhollas danielhollas left a comment

Choose a reason for hiding this comment

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

Great cleanup!

except AttributeError:
# This type is not available for Python 3.9 and older
UnionType = None # type: ignore[assignment,misc]
UnionType = types.UnionType
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can just import the UnionType directly above as

from types import UnionType

except AttributeError:
# This is the backport for Python 3.9 and older
from get_annotations import get_annotations # type: ignore[no-redef]
get_annotations = inspect.get_annotations
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here, let's get rid of this alias

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