Skip to content

Enable mypy warn unused ignores - #7335

Merged
dcherian merged 4 commits into
pydata:mainfrom
headtr1ck:mypyignores
Dec 1, 2022
Merged

Enable mypy warn unused ignores#7335
dcherian merged 4 commits into
pydata:mainfrom
headtr1ck:mypyignores

Conversation

@headtr1ck

Copy link
Copy Markdown
Collaborator

This PR adds the mypy option "warn_unused_ignores" which will raise an error if a # type: ignore is used where it is no longer necessary.

Should enable us to keep our types updated.

I am not sure if this will lead to many issues whenever e.g. numpy changes/improves their typing, so we might get errors whenever there is a new version. Maybe it is not that bad, or maybe we can also remove the option again and only do it manually from time to time?

@max-sixty

Copy link
Copy Markdown
Collaborator

Good idea! 👍

@IllviljanIllviljan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice! I think we merge this and see how the maintenance burden feels after a few releases.

@headtr1ckheadtr1ck added the plan to merge Final call for comments label Nov 30, 2022
@dcherian
dcherian merged commit 0e5e3fe into pydata:mainDec 1, 2022
dcherian added a commit to dcherian/xarray that referenced this pull request Dec 2, 2022
* upstream/main: (39 commits)
Support the new compression argument in netCDF4 > 1.6.0 (pydata#6981)
Remove setuptools-scm-git-archive, require setuptools-scm>=7 (pydata#7253)
Fix mypy failures (pydata#7343)
Docs: add example of writing and reading groups to netcdf (pydata#7338)
Reset file pointer to 0 when reading file stream (pydata#7304)
Enable mypy warn unused ignores (pydata#7335)
Optimize some copying (pydata#7209)
Add parse_dims func (pydata#7051)
Fix coordinate attr handling in `xr.where(..., keep_attrs=True)` (pydata#7229)
Remove code used to support h5py<2.10.0 (pydata#7334)
[pre-commit.ci] pre-commit autoupdate (pydata#7330)
Fix PR number in what’s new (pydata#7331)
Enable `origin` and `offset` arguments in `resample` (pydata#7284)
fix doctests: supress urllib3 warning (pydata#7326)
fix flake8 config (pydata#7321)
implement Zarr v3 spec support (pydata#6475)
Fix polyval overloads (pydata#7315)
deprecate pynio backend (pydata#7301)
mypy - Remove some ignored packages and modules (pydata#7319)
Switch to T_DataArray in .coords (pydata#7285)
...
@headtr1ck
headtr1ck deleted the mypyignores branch December 8, 2022 20:09
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@headtr1ck@max-sixty@Illviljan@dcherian