Skip to content

chore: fix ability to run mypy via hatch#3952

Merged
maxrjones merged 2 commits intozarr-developers:mainfrom
chuckwondo:fix-hatch-run-mypy
May 8, 2026
Merged

chore: fix ability to run mypy via hatch#3952
maxrjones merged 2 commits intozarr-developers:mainfrom
chuckwondo:fix-hatch-run-mypy

Conversation

@chuckwondo
Copy link
Copy Markdown
Contributor

@chuckwondo chuckwondo commented May 7, 2026

The test script for running mypy via hatch was broken because mypy is a dev dep, not a test dep. This means that this was broken because mypy could not be found:

hatch env run --env test run-mypy

This PR adds a dev env that depends on the dev dep group so that we can now run the following:

hatch env run --env dev mypy

Note, however, that the output from the command above will expose numerous mypy errors that are currently masked by the equivalent pre-commit hook because the pre-commit hook pins numpy to an earlier version.

As far as I can tell, numpy is pinned to an earlier version in the pre-commit hook precisely because of a slew of new typing errors that were initially raised when a newer version of numpy was pulled into the dep tree. Thus pinning to an earlier version is currently masking/deferring the typing issues.

Note also that the script is now simply mypy, not run-mypy because there's no need for an explicit script entry in pyproject.toml in this case.

For now, this is not in the CI path, so will not cause builds to fail. Rather it allows us to manually produce a complete list of masked typing issues, so we can separately address the issues, as we see fit.

TODO:

  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions Bot added the needs release notes Automatically applied to PRs which haven't added release notes label May 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.26%. Comparing base (1445001) to head (51d34a7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3952      +/-   ##
==========================================
+ Coverage   93.22%   93.26%   +0.04%     
==========================================
  Files          87       87              
  Lines       11721    11721              
==========================================
+ Hits        10927    10932       +5     
+ Misses        794      789       -5     

see 2 files with indirect coverage changes

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

Copy link
Copy Markdown
Member

@maxrjones maxrjones left a comment

Choose a reason for hiding this comment

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

thanks @chuckwondo!

@maxrjones maxrjones changed the title Fix ability to run mypy via hatch chore: fix ability to run mypy via hatch May 8, 2026
@maxrjones maxrjones merged commit 7c2f372 into zarr-developers:main May 8, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants