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

Updating mypy in poetry to version 1 #365

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Conversation

davidorme
Copy link
Collaborator

@davidorme davidorme commented Dec 11, 2024

Description

This updates mypy in poetry to match the version now being used in pre-commit - I was getting errors from pre-commit that weren't being shown in VSCode, because it uses the setup in the poetry environment.

The initial PR was also updating numpy to 2.2.0 and that turns out to be a problem because of a change in the handling of typing numpy floating arrays:

numpy/numpy#27957

This still seems a bit lively, so this PR:

  • Updates pyproject.toml to specify mypy: "^1.0.0" to keep up with pre-commit.

It also pins numpy in two places to <2.2

  • pyproject.toml sets ~2.1
  • .pre-commit-config.yaml specifies numpy==2.1.3 as a mypy dependency.

We'll need to unpin those at some point, but let's see how that numpy issue resolves.

Fixes #384 (issue)

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@davidorme davidorme linked an issue Dec 11, 2024 that may be closed by this pull request
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.09%. Comparing base (1f315ba) to head (72313b2).
Report is 505 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #365      +/-   ##
===========================================
+ Coverage    95.29%   96.09%   +0.80%     
===========================================
  Files           28       35       +7     
  Lines         1720     2766    +1046     
===========================================
+ Hits          1639     2658    +1019     
- Misses          81      108      +27     

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

Copy link
Collaborator

@j-emberton j-emberton left a comment

Choose a reason for hiding this comment

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

looks good

@davidorme davidorme merged commit c99a4a7 into develop Dec 11, 2024
13 checks passed
@davidorme davidorme deleted the 364-update-mypy-to-version-1 branch December 11, 2024 13:07
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.

Update mypy to version 1+
3 participants