Skip to content

Commit 8220042

Browse files
committed
Add more type checks
1 parent 8ea3f09 commit 8220042

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,36 @@ all: test
1212
@touch .install-deps
1313

1414
.flake: .install-deps $(shell find multidict -type f) \
15-
$(shell find tests -type f)
15+
$(shell find tests -type f)
1616
flake8 multidict tests
1717
@if ! isort --check multidict tests; then \
18-
echo "Import sort errors, run 'make fmt' to fix them!!!"; \
19-
isort --diff --check multidict tests; \
20-
false; \
18+
echo "Import sort errors, run 'make fmt' to fix them!!!"; \
19+
isort --diff --check multidict tests; \
20+
false; \
2121
fi
2222
@touch .flake
2323

2424

2525
isort-check:
2626
@if ! isort --check $(SRC); then \
27-
echo "Import sort errors, run 'make fmt' to fix them!!!"; \
28-
isort --diff --check $(SRC); \
29-
false; \
27+
echo "Import sort errors, run 'make fmt' to fix them!!!"; \
28+
isort --diff --check $(SRC); \
29+
false; \
3030
fi
3131

3232
flake8:
3333
flake8 $(SRC)
3434

3535
black-check:
3636
@if ! isort --check $(SRC); then \
37-
echo "black errors, run 'make fmt' to fix them!!!"; \
37+
echo "black errors, run 'make fmt' to fix them!!!"; \
3838
black -t py35 --diff --check $(SRC); \
39-
false; \
39+
false; \
4040
fi
4141

4242
mypy:
4343
mypy --show-error-codes multidict tests
44+
mypy --show-error-codes tests/test_mypy.py --strict
4445

4546
lint: flake8 black-check mypy isort-check check_changes
4647

multidict/__init__.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ class MultiMapping(Mapping[_S, _T_co]):
3939
@abc.abstractmethod
4040
def getone(self, key: _S, default: _D) -> Union[_T_co, _D]: ...
4141

42-
_Arg = Union[Mapping[_S, _T], Dict[_S, _T], MultiMapping[_T], Iterable[Tuple[_S, _T]]]
42+
_Arg = Union[Mapping[str, _T], Mapping[istr, _T],
43+
Dict[str, _T], Dict[istr, _T],
44+
MultiMapping[_T],
45+
Iterable[Tuple[str, _T]], Iterable[Tuple[istr, _T]]]
4346

4447
class MutableMultiMapping(MultiMapping[_T], MutableMapping[_S, _T], Generic[_T]):
4548
@abc.abstractmethod

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
class VersionMixin:
20-
cls: Type[MultiMapping[str, str]]
20+
cls: Type[MultiMapping[str]]
2121

2222
def getver(self, md):
2323
raise NotImplementedError

0 commit comments

Comments
 (0)