-
Notifications
You must be signed in to change notification settings - Fork 32
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
Why not just use mypy
and "pytest`? What are the advantages of the "pytest-mypy" package?
#114
Comments
I think the main appeal is that this, and plugins like it (e.g. pipenv run pytest --mypy --flake8 --pylint --bandit src/ tests/ # run the tests and static checks That said, I see applications and other projects that target a single Python version as the primary audience. tox -e py37,py38,py39 # run the tests (with each Python version) tox -e static # run the static checks (only once) As for development, @dbader made the package, and I found it interesting. |
I use this plugin, and a few more for my favourite linters, to run all the checks in a single command as @dmtucker described. This has several advantages:
I do actually use this for projects that support a range of Python versions; I just run pytest with all the plugins in an appropriate container on the CI. The checks are fast anyway, so it's no big deal. It's true that I should get rid of that setup and move to tox though, I just haven't got a sufficiently round tuit yet :-). So thanks to @dmtucker and @dbader and the other contributors for this useful tool! Maybe we could consider this issue a request for adding a few lines on "What is this for?" to the README? |
FWIW, PyCharm doesn't provide a Furthermore, it doesn't have a Run Configuration to run some arbitrary executable or script in an arbitrary way without limitations or strange peculiarities. It does have a Therefore, this module can be a simple way to integrate an explicit |
Wow, why someone may need mypy configuration? Mypy is a static type checker with its settings file, I have no idea what someone may want to configure for it in a "Run configuration".
It looks like you are reinventing here pre-commit. Issue conclusionPeople, thank you for all your answers. I made a conclusion that pytest-mypy is a kind of alternative without any significant difference and without any valuable advantages. So, I will keep using pytest and pre-commit (that includes mypy, black, isort, etc.) in my company in all my CI/CD. With consideration of all the above I am closing the issue. |
FTFY |
A Run Configuration is just an entry/item in PyCharm that can easily be executed with the press of a button (or menu entry, or shortcut, whatever), similar to how you execute a debug, coverage, profiling or any other "Run" for that matter.
That is based on the assumption that I only want to see mypy output just before I want to commit, which isn't generally true. For instance, I may want to iteratively work on a commit and check mypy or pytest results in between, for which "runs" in PyCharm are well-suited. And there are other instances for which one may not want a strict reliance on commits. I was just giving a use case and therefore another justification for the existence of the package. It's not applicable for everyone and that's ok. |
Thank you for valuable reply. I run directly |
Sorry for my noob question, but what is the purpose of the package?
I can run in a terminal locally or at a cloud's CI/CD the following two commands:
So why waste time on a new package development instead of just running two simple commands?
The text was updated successfully, but these errors were encountered: