Commit f645ab96 by David Hotham Committed by GitHub

run mypy in proper environment (#5279)

* enable strict mypy checking

* update contribution guide

* remove mypy precommit hook
parent 93317410
...@@ -85,6 +85,9 @@ jobs: ...@@ -85,6 +85,9 @@ jobs:
- name: Run pytest - name: Run pytest
run: poetry run python -m pytest -p no:sugar -q tests/ run: poetry run python -m pytest -p no:sugar -q tests/
- name: Run mypy
run: poetry run mypy
- name: Run pytest (integration suite) - name: Run pytest (integration suite)
run: poetry run python -m pytest -p no:sugar -q --integration tests/integration run: poetry run python -m pytest -p no:sugar -q --integration tests/integration
......
...@@ -81,14 +81,6 @@ repos: ...@@ -81,14 +81,6 @@ repos:
- id: flake8 - id: flake8
additional_dependencies: *flake8_deps additional_dependencies: *flake8_deps
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.950
hooks:
- id: mypy
pass_filenames: false
additional_dependencies:
- types-requests
- repo: https://github.com/pre-commit/pre-commit - repo: https://github.com/pre-commit/pre-commit
rev: v2.18.1 rev: v2.18.1
hooks: hooks:
......
...@@ -122,6 +122,13 @@ $ poetry install ...@@ -122,6 +122,13 @@ $ poetry install
$ poetry run pytest tests/ $ poetry run pytest tests/
``` ```
Poetry uses [mypy](https://github.com/python/mypy) for typechecking, and the CI
will fail if it finds any errors. To run mypy locally:
```bash
$ poetry run mypy
```
Poetry uses the [black](https://github.com/psf/black) coding style and you must ensure that your Poetry uses the [black](https://github.com/psf/black) coding style and you must ensure that your
code follows it. If not, the CI will fail and your Pull Request will not be merged. code follows it. If not, the CI will fail and your Pull Request will not be merged.
......
...@@ -139,6 +139,13 @@ $ poetry install ...@@ -139,6 +139,13 @@ $ poetry install
$ poetry run pytest tests/ $ poetry run pytest tests/
``` ```
Poetry uses [mypy](https://github.com/python/mypy) for typechecking, and the CI
will fail if it finds any errors. To run mypy locally:
```bash
$ poetry run mypy
```
Poetry uses the [black](https://github.com/psf/black) coding style and you must ensure that your Poetry uses the [black](https://github.com/psf/black) coding style and you must ensure that your
code follows it. If not, the CI will fail and your Pull Request will not be merged. code follows it. If not, the CI will fail and your Pull Request will not be merged.
......
...@@ -71,6 +71,8 @@ httpretty = "^1.0" ...@@ -71,6 +71,8 @@ httpretty = "^1.0"
typing-extensions = { version = "^4.0.0", python = "<3.8" } typing-extensions = { version = "^4.0.0", python = "<3.8" }
zipp = { version = "^3.4", python = "<3.8" } zipp = { version = "^3.4", python = "<3.8" }
flatdict = "^4.0.1" flatdict = "^4.0.1"
mypy = ">=0.950"
types-requests = ">=2.27.11"
[tool.poetry.scripts] [tool.poetry.scripts]
poetry = "poetry.console.application:main" poetry = "poetry.console.application:main"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment