Skip to content

[RFE] use tools.mypy from pyproject.toml #153

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

Closed
t184256 opened this issue May 5, 2023 · 5 comments · Fixed by #154
Closed

[RFE] use tools.mypy from pyproject.toml #153

t184256 opened this issue May 5, 2023 · 5 comments · Fixed by #154

Comments

@t184256
Copy link

t184256 commented May 5, 2023

Configuring through mypy.ini works for me, but it'd be great if mypy invoked through pytest-mypy could pick up configuration from tools.mypy section of pyproject.toml as described in https://mypy.readthedocs.io/en/stable/config_file.html.

@dmtucker
Copy link
Collaborator

dmtucker commented May 6, 2023

This should already be supported (but you need to use tool.mypy, not tools).
I will add a test to ensure this support doesn't break.

@t184256
Copy link
Author

t184256 commented May 6, 2023

Oh no. Sorry for bothering, it's indeed me not being attentive enough and using tools.mypy instead of tool.mypy.

@dmtucker
Copy link
Collaborator

dmtucker commented May 6, 2023

No worries! It'll be good to have that test 👍

@djwessel
Copy link

I'm not sure if it is fully taking all the configuration from the pyproject.toml file. For example, if you have the following:

[tool.mypy]
exclude = ["tests/*"]

It still runs mypy on the files that should be skipped. mypy . correctly skips the files, but pytest --mypy does not.

@dmtucker
Copy link
Collaborator

@djwessel That isn't specific to config in pyproject.toml actually. See #123 (comment)

tl;dr: That option isn't terribly compatible with this plugin (which aims to let Pytest decide which files get checked).

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.

3 participants