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

Run Mypy inside pytest/Nox instead of pre-commit #15

Closed
MicaelJarniac opened this issue Nov 18, 2021 · 1 comment · Fixed by #48
Closed

Run Mypy inside pytest/Nox instead of pre-commit #15

MicaelJarniac opened this issue Nov 18, 2021 · 1 comment · Fixed by #48
Assignees
Labels
enhancement New feature or request

Comments

@MicaelJarniac
Copy link
Owner

Mypy quite often needs a complete set of requirements installed in order to function properly.

pre-commit creates a fresh environment for each hook and basically doesn't install anything other than the hook itself.

We can provide additional dependencies for pre-commit to install along with the hook, but that'd mean duplicating the requirements and having to maintain them both up-to-date.

A pre-commit hook can be run from the external environment, instead of its isolated one, but that'd then make it dependant on a properly configured environment, which won't always be the case, and that'd limit where pre-commit can be run from.

Another option would be to have the hook install the full set of requirements, but that'd add a considerable slowdown.

Since running pytest already requires a fully working environment, that could be a nice place to have Mypy run.

Perhaps a subset of Mypy features can still be called from pre-commit.

https://jaredkhan.com/blog/mypy-pre-commit
pre-commit/pre-commit#880 (comment)
https://github.com/dbader/pytest-mypy

@MicaelJarniac MicaelJarniac added the enhancement New feature or request label Nov 18, 2021
@MicaelJarniac MicaelJarniac self-assigned this Nov 18, 2021
@MicaelJarniac
Copy link
Owner Author

Maybe use Nox for running Mypy?

Related to #7.

@MicaelJarniac MicaelJarniac changed the title Run Mypy inside pytest instead of pre-commit Run Mypy inside pytest/Nox instead of pre-commit Dec 23, 2021
MicaelJarniac added a commit that referenced this issue Dec 23, 2021
@MicaelJarniac MicaelJarniac mentioned this issue Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant