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

Use stronger typing with Mypy #556

Merged
merged 2 commits into from
Mar 6, 2024
Merged

Use stronger typing with Mypy #556

merged 2 commits into from
Mar 6, 2024

Conversation

hoh
Copy link
Member

@hoh hoh commented Mar 5, 2024

Depends on #555 - Fix: Caller expected tuple but got a single value

Changes:

  • Fix: Type checks were not enforced
  • Fix: Mypy configuration was inline

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 38.29787% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 34.59%. Comparing base (d347031) to head (1daefc3).

Files Patch % Lines
src/aleph/vm/conf.py 0.00% 6 Missing ⚠️
src/aleph/vm/hypervisors/qemu/qemuvm.py 0.00% 6 Missing ⚠️
src/aleph/vm/models.py 64.28% 5 Missing ⚠️
src/aleph/vm/orchestrator/pubsub.py 37.50% 5 Missing ⚠️
src/aleph/vm/hypervisors/firecracker/microvm.py 40.00% 3 Missing ⚠️
src/aleph/vm/network/interfaces.py 0.00% 2 Missing ⚠️
src/aleph/vm/pool.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #556      +/-   ##
==========================================
- Coverage   34.76%   34.59%   -0.18%     
==========================================
  Files          52       52              
  Lines        4752     4770      +18     
  Branches      555      558       +3     
==========================================
- Hits         1652     1650       -2     
- Misses       3082     3102      +20     
  Partials       18       18              

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

@hoh hoh marked this pull request as ready for review March 6, 2024 07:51
@hoh hoh requested a review from nesitor March 6, 2024 07:52
@aleph-im aleph-im deleted a comment from github-actions bot Mar 6, 2024
@hoh hoh force-pushed the hoh-stronger-typing branch 2 times, most recently from 7c898e2 to d6c7af9 Compare March 6, 2024 13:45
hoh added 2 commits March 6, 2024 15:10
Code without type annotations were ignored by Mypy. This adds the relevant type annotations and configures Mypy to always check for types.
Solution: Use a dedicated section of pyproject.toml for the configuration of Mypy.

This also adds `check_untyped_defs` to force type checking on all code, annotated or not.
@hoh hoh merged commit abd0bbd into main Mar 6, 2024
20 checks passed
@Psycojoker Psycojoker deleted the hoh-stronger-typing branch July 24, 2024 15:39
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