Skip to content

Commit 175fb57

Browse files
committed
Replace mypy_run.py hack with patched mypy version proposed for upstream inclusion
1 parent ddf4130 commit 175fb57

File tree

3 files changed

+7
-44
lines changed

3 files changed

+7
-44
lines changed

datastore/core/objectstore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def is_valid_value_type(value: util.stream.ArbitraryReceiveChannel[typing.Any])
2626
Unfortunately this cannot check whether iterators return the correct types,
2727
so the utility of this function unfortunately is limited to some extent.
2828
"""
29-
return isinstance(value, ( # type: ignore[misc] # “Should be always true…”
29+
return isinstance(value, ( # type: ignore[unreachable] # “Should be always true…”
3030
trio.abc.ReceiveChannel,
3131
collections.abc.AsyncIterable,
3232
collections.abc.Awaitable,

mypy_run.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

tox.ini

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ envlist =
66
styleck
77

88
# While tox does have PEP-517 (pyproject.toml buildapi) support it's very
9-
# inconvinient and slow to use so disable installation of ourselves entirely
9+
# inconvenient and slow to use so disable installation of ourselves entirely
1010
skipsdist = true
1111

1212
# Keep this in sync with `tool.flit.metadata.requires` from "pyproject.toml"
1313
#
1414
# Note the difference in version number strictness is intentional however since
15-
# 0.13.0 fixes an annoying test warining.
15+
# 0.13.0 fixes an annoying test warning.
1616
deps =
1717
trio ~= 0.13.0
1818

@@ -39,19 +39,15 @@ commands =
3939
skip_install = true
4040
deps =
4141
{[tox]deps}
42-
mypy >= 0.761
4342
pytest ~= 5.0
43+
git+https://github.com/alexander255/mypy.git@0cf7515eefd981bd7627a371dd109f1a4cddc90f
4444
commands =
45-
python {toxinidir}/mypy_run.py --config-file=tox.ini {posargs} -p datastore -p tests
45+
mypy --config-file=tox.ini {posargs} -p datastore -p tests
4646

4747
# Pass down TERM environment variable to allow mypy output to be colorized
4848
# See: https://github.com/tox-dev/tox/issues/1441
4949
passenv = TERM
5050

51-
#HACK: We cannot use mypy's optimized (mypyc) binary distribution as that breaks
52-
# the monkey patching in the `./mypy_run.py` script…
53-
install_command=python -m pip install --no-binary mypy {opts} {packages}
54-
5551
[mypy]
5652
# CLI behaviour
5753
color_output = true
@@ -78,6 +74,8 @@ warn_unused_ignores = true
7874
warn_return_any = true
7975
warn_unreachable = true
8076

77+
pep561_override = pytest, trio
78+
8179
[mypy-datastore.core.query]
8280
#FIXME: This file is seriously messed up
8381
ignore_errors = true

0 commit comments

Comments
 (0)