Skip to content

Commit

Permalink
set up mypy hook for incremental adoption
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Sep 15, 2021
1 parent 14b41a9 commit f104fa8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ repos:
| ^poetry/core/_vendor
)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- id: mypy
additional_dependencies:
- types-requests
files: |
(?x)(
^poetry
)
exclude: |
(?x)(
^poetry/core/_vendor
)
- repo: https://github.com/timothycrosley/isort
rev: 5.8.0
hooks:
Expand Down
29 changes: 29 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[mypy]
follow_imports = silent

[mypy-poetry.core.factory.*]
ignore_errors = True

[mypy-poetry.core.masonry.*]
ignore_errors = True

[mypy-poetry.core.packages.*]
ignore_errors = True

[mypy-poetry.core.poetry.*]
ignore_errors = True

[mypy-poetry.core.pyproject.*]
ignore_errors = True

[mypy-poetry.core.semver.*]
ignore_errors = True

[mypy-poetry.core.spdx.*]
ignore_errors = True

[mypy-poetry.core.vcs.*]
ignore_errors = True

[mypy-poetry.core.version.*]
ignore_errors = True
3 changes: 2 additions & 1 deletion poetry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pkgutil import extend_path
from typing import List


__path__ = extend_path(__path__, __name__)
__path__: List[str] = extend_path(__path__, __name__)
2 changes: 2 additions & 0 deletions poetry/core/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Iterator
from typing import List
from typing import Union
from typing import no_type_check

from poetry.core.version.pep440 import PEP440Version

Expand Down Expand Up @@ -42,6 +43,7 @@ def temporary_directory(*args: Any, **kwargs: Any) -> Iterator[str]:
safe_rmtree(name)


@no_type_check
def parse_requires(requires: str) -> List[str]:
lines = requires.split("\n")

Expand Down

0 comments on commit f104fa8

Please sign in to comment.