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

check mypy at the end of some CI runs? #4881

Closed
mathause opened this issue Feb 8, 2021 · 2 comments · Fixed by #4929
Closed

check mypy at the end of some CI runs? #4881

mathause opened this issue Feb 8, 2021 · 2 comments · Fixed by #4929

Comments

@mathause
Copy link
Collaborator

mathause commented Feb 8, 2021

We currently run mypy in the pre-commit hooks CI. However, this is done in an environment where no dependencies are installed. Therefore we missed the errors that pop up when running mypy with numpy 1.20 installed. (Please correct my if I misunderstood this). Should we add a new step to our CI and run mypy?

I think we should at least add this to ubuntu-latest py3.8. For more complete checks we could also go for ubuntu-latest py37-min-all-deps and upstream-dev.

@keewis
Copy link
Collaborator

keewis commented Feb 11, 2021

Therefore we missed the errors that pop up when running mypy with numpy 1.20 installed.

that's true, mypy won't be able to check for changes in the type hints of dependencies if it is run by pre-commit. However, I don't think we should add mypy steps to our CI. Instead, I would prefer new jobs (not sure how many, though).

@mathause
Copy link
Collaborator Author

However, I don't think we should add mypy steps to our CI. Instead, I would prefer new jobs (not sure how many, though).

Works for me. I am also fine only testing in the ubuntu-latest py3.8 environment. I suggested ubuntu-latest py37-min-all-deps because we may now need to special-case depending on the numpy version.

if LooseVersion(np.__version__) >= "1.20": # type: ignore
from numpy.typing import DTypeLike
else:
DTypeLike = Union[np.dtype, str] # type: ignore

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 a pull request may close this issue.

2 participants