Skip to content

Commit 6da5d33

Browse files
henryiiipradyunsg
andauthored
chore: update mypy and move to toml (#547)
* Updates mypy to 0.950 * Uses pyproject.toml insted of mypy.ini - nicer config, fewer files * Uses `strict = true` instead of the long list (supported last few versions) * Uses more precise include ignoring, and includes a couple of typing requirements * Exposes a variable type change, fixed * Adds a few extra (easy) strictness and config flags. Didn't add unreachable, since it was more involved. Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: Pradyun Gedam <[email protected]>
1 parent 53dbb25 commit 6da5d33

File tree

5 files changed

+14
-21
lines changed

5 files changed

+14
-21
lines changed

.pre-commit-config.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ repos:
88
- id: trailing-whitespace
99

1010
- repo: https://github.com/pre-commit/mirrors-mypy
11-
rev: v0.942
11+
rev: v0.950
1212
hooks:
1313
- id: mypy
1414
exclude: '^(docs|tasks|tests)|setup\.py'
1515
args: []
16+
additional_dependencies: [pyparsing, nox]
1617

1718
- repo: https://github.com/asottile/pyupgrade
1819
rev: v2.32.0

MANIFEST.in

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ include LICENSE LICENSE.APACHE LICENSE.BSD
44
include .coveragerc
55
include .flake8
66
include .pre-commit-config.yaml
7-
include mypy.ini
87

98
recursive-include docs *
109
recursive-include tests *.py

mypy.ini

-17
This file was deleted.

packaging/requirements.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
stringStart,
2121
)
2222

23-
from .markers import MARKER_EXPR, Marker
23+
from .markers import MARKER_EXPR as _MARKER_EXPR, Marker
2424
from .specifiers import LegacySpecifier, Specifier, SpecifierSet
2525

2626

@@ -66,7 +66,7 @@ class InvalidRequirement(ValueError):
6666
VERSION_SPEC = originalTextFor(_VERSION_SPEC)("specifier")
6767
VERSION_SPEC.setParseAction(lambda s, l, t: t[1])
6868

69-
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
69+
MARKER_EXPR = originalTextFor(_MARKER_EXPR())("marker")
7070
MARKER_EXPR.setParseAction(
7171
lambda s, l, t: Marker(s[t._original_start : t._original_end])
7272
)

pyproject.toml

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
[build-system]
22
requires = ['setuptools >= 40.8.0', 'wheel']
33
build-backend = 'setuptools.build_meta'
4+
5+
6+
[tool.mypy]
7+
strict = true
8+
show_error_codes = true
9+
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
10+
11+
[[tool.mypy.overrides]]
12+
module = ["_manylinux"]
13+
ignore_missing_imports = true

0 commit comments

Comments
 (0)