Skip to content

Conversation

@danielhollas
Copy link
Collaborator

Some python packages do not contain types, but they have separate "stub" packages that provide type information for them. It is much better to install these stub packages to have a stronger type-checking of code that uses these libraries.

@danielhollas danielhollas requested review from mbercx and removed request for agoscinski and unkcpz September 26, 2025 17:01
@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.25%. Comparing base (8b1943e) to head (0891442).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/aiida/common/progress_reporter.py 92.31% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7021      +/-   ##
==========================================
+ Coverage   79.25%   79.25%   +0.01%     
==========================================
  Files         566      566              
  Lines       43776    43779       +3     
==========================================
+ Hits        34690    34693       +3     
  Misses       9086     9086              

☔ 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.

) -> str:
"""Get summary for archive initialisation"""
parameters = [['Path', str(outfile)], ['Version', archive_version], ['Compression', compression]]
parameters: list[list[Any]] = [['Path', str(outfile)], ['Version', archive_version], ['Compression', compression]]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without this annotation mypy infers type list[object] which then fails a type check as we pass this parameter to tabulate.

'sqlalchemy[mypy]~=2.0',
'tomli',
'types-PyYAML'
'types-click-spinner~=0.1.8',
Copy link
Member

Choose a reason for hiding this comment

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

Thanks @danielhollas, always love more typing! 😍 Just one question before I approve: could you motivate the choice of these version specifications?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The version of the stub package need to match the version of the package itself. So these specifications are just copied over.

Copy link
Member

@mbercx mbercx left a comment

Choose a reason for hiding this comment

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

Thanks @danielhollas! LGTM 🚀 . Maybe add the motivation for the package versions to the commit message, so poor sods like me can learn from it. 😉

@danielhollas danielhollas force-pushed the more-stubs branch 2 times, most recently from 447ba22 to dc40477 Compare September 28, 2025 01:57
@danielhollas danielhollas enabled auto-merge (squash) September 28, 2025 01:57
@danielhollas
Copy link
Collaborator Author

Thanks @mbercx! I've added some notes to pyproject.toml

The added `types-*` packages are maintained in typeshed
per PEP561, see: https://github.com/python/typeshed
@danielhollas danielhollas merged commit 51f0ed7 into aiidateam:main Sep 28, 2025
30 of 32 checks passed
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