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
Add Github Action definition #11320
Add Github Action definition #11320
Conversation
Define a Github Action that can be used as a canonical way of running mypy as part of Github CI workflows as easy as: jobs: lint: runs-on: ubuntu-latest steps: - uses: python/mypy The action is inspired by its equivalent in black and supports the following options: with: options: "..." # mypy command-line options paths: "." # a list of paths to check version: "0.910" # mypy version to use install_types: yes|no # whether to auto-install stubs
Thanks, this does seem like it could be useful. I think it has to be at the root of the repo. Frankly, I wouldn't mind having this live in another repo (similar to how pyright does it https://github.com/jakebailey/pyright-action), the wide variety of project installations and configurations people have might make this an annoying thing to maintain. Speaking of the pyright-action, it does some cool Github magic to have errors show up in your PR, which is pretty nice |
Not necessarily, it can be in a subfolder, e.g.
We can add a problem matcher which would convert mypy errors into Github annotations via regexps. |
Thanks! |
Added #11359 to track documentation for this. |
This was broken by python#11320
This was broken by #11320 Co-authored-by: hauntsaninja <>
I am working on #11359, I have some feedback on currect state of mypy's GitHub Action:
name: mypy
jobs:
lint:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9.9
- run: pip install mypy
- run: mypy your_path In the example above you control everything. Python version, extra deps and how to install them, mypy version, its config, security, caching, even custom reporters like https://github.com/reviewdog/
Do others share my concerns? |
+1
I can follow up with a test.
It uses
Realistically, you almost always also want to install your dependencies and run
It's subjective, of course, but a Lastly, this action is modeled after black's, so there's precedent. |
Define a Github Action that can be used as a canonical way of running mypy as part of Github CI workflows as easy as: ``` jobs: lint: runs-on: ubuntu-latest steps: - uses: python/mypy ``` The action is inspired by its equivalent in black and supports the following options: ``` with: options: "..." # mypy command-line options paths: "." # a list of paths to check version: "0.910" # mypy version to use install_types: yes|no # whether to auto-install stubs ```
This was broken by python#11320 Co-authored-by: hauntsaninja <>
Define a Github Action that can be used as a canonical way of running mypy as part of Github CI workflows as easy as:
The action is inspired by its equivalent in black and supports the following options:
Example run