diff --git a/.flake8 b/.flake8 index 113f956..95926aa 100644 --- a/.flake8 +++ b/.flake8 @@ -19,12 +19,18 @@ exclude = runtime/src/prettypb/protobuf/*.py ignore = - F811 # redefinition of unused '...' from line ... - W503 # line break before binary operator - E203 # whitespace before ':' - E231 # missing whitespace after ',' - E501 # line too long - E731 # do not assign a lambda expression, use a def + # F811: redefinition of unused '...' from line ... + F811 + # W503: line break before binary operator + W503 + # E203: whitespace before ':' + E203 + # E231: missing whitespace after ',' + E231 + # E501:line too long + E501 + # E731: do not assign a lambda expression, use a def + E731 builtins = reveal_type diff --git a/constraints.txt b/constraints.txt index 1927c58..895cbd2 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,69 +1,72 @@ +# SPDX-FileCopyrightText: David Fritzsche +# SPDX-License-Identifier: CC0-1.0 # -# This file is autogenerated by lock_requirements.sh +# This file is autogenerated by lock-requirements.sh # To update, run: # -# sh lock_requirements.sh +# ./lock-requirements.sh # -attrs==22.1.0 +attrs==22.2.0 binaryornot==0.4.4 -black==22.8.0 +black==23.1.0 boolean-py==4.0 -build==0.8.0 +build==0.10.0 bump2version==1.0.1 -certifi==2022.9.14 -chardet==5.0.0 -charset-normalizer==2.1.1 +certifi==2022.12.7 +chardet==5.1.0 +charset-normalizer==3.0.1 click==8.1.3 -coverage==6.4.4 +coverage==7.2.0 dflit==2.3.0.1 dflit-core==2.3.0.1 distlib==0.3.6 docutils==0.19 -filelock==3.8.0 -flake8==5.0.4 -flake8-bugbear==22.9.11 -flake8-comprehensions==3.10.0 -flake8-html==0.4.2 -flake8-logging-format==0.7.5 +exceptiongroup==1.1.0 +filelock==3.9.0 +flake8==6.0.0 +flake8-bugbear==23.2.13 +flake8-comprehensions==3.10.1 +flake8-html==0.4.3 +flake8-logging-format==0.9.0 flake8-mutable==1.2.0 -flake8-pyi==22.8.2 +flake8-pyi==23.1.2 fsfe-reuse==1.0.0 idna==3.4 -iniconfig==1.1.1 -invoke==1.7.1 -isort==5.10.1 +iniconfig==2.0.0 +invoke==2.0.0 +isort==5.12.0 jinja2==3.1.2 -license-expression==30.0.0 -markupsafe==2.1.1 +license-expression==30.1.0 +markupsafe==2.1.2 mccabe==0.7.0 -mypy==0.971 -mypy-extensions==0.4.3 -packaging==21.3 -pathspec==0.10.1 -pep517==0.13.0 -pip-tools==6.8.0 -platformdirs==2.5.2 +mypy==1.0.1 +mypy-extensions==1.0.0 +packaging==23.0 +pathspec==0.11.0 +pip==23.0.1 +pip-tools==6.12.2 +platformdirs==3.0.0 pluggy==1.0.0 py==1.11.0 -pycodestyle==2.9.1 -pyflakes==2.5.0 -pygments==2.13.0 -pyparsing==3.0.9 -pytest==7.1.3 -pytest-cov==3.0.0 -pytest-html==3.1.1 -pytest-metadata==2.0.2 -python-debian==0.1.47 +pycodestyle==2.10.0 +pyflakes==3.0.1 +pygments==2.14.0 +pyproject-hooks==1.0.0 +pytest==7.2.1 +pytest-cov==4.0.0 +pytest-html==3.2.0 +pytest-metadata==2.0.4 +python-debian==0.1.49 pytoml==0.1.21 -requests==2.28.1 -reuse==1.0.0 +requests==2.28.2 +reuse==1.1.2 +setuptools==67.4.0 six==1.16.0 tomli==2.0.1 -tox==3.26.0 +tox==3.28.0 tox-pyenv==1.1.0 -typing-extensions==4.3.0 -urllib3==1.26.12 -virtualenv==20.16.5 -wheel==0.37.1 -pip==22.2.2 -setuptools==65.3.0 +types-invoke==2.0.0.3 +typing-extensions==4.5.0 +urllib3==1.26.14 +virtualenv==20.19.0 +wheel==0.38.4 diff --git a/lock-requirements.sh b/lock-requirements.sh new file mode 100755 index 0000000..8506cf8 --- /dev/null +++ b/lock-requirements.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: David Fritzsche +# SPDX-License-Identifier: CC0-1.0 + +export CUSTOM_COMPILE_COMMAND="./lock-requirements.sh" + +PYTHONWARNINGS=ignore pip-compile --unsafe-package='' --no-emit-index-url --resolver=backtracking "$@" +cat >constraints.txt <> constraints.txt diff --git a/lock_requirements.sh b/lock_requirements.sh deleted file mode 100755 index 5fc8f82..0000000 --- a/lock_requirements.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -pip-compile --allow-unsafe --no-emit-index-url "$@" -cat >constraints.txt <> constraints.txt diff --git a/mypy.ini b/mypy.ini index a751daf..7dbb797 100644 --- a/mypy.ini +++ b/mypy.ini @@ -47,3 +47,7 @@ warn_return_any = True # Strict Optional checks. # If False, mypy treats None as compatible with every type. (default True) strict_optional = True + + +[mypy-py.*] +ignore_missing_imports = True diff --git a/requirements.in b/requirements.in index 80f3df7..d612445 100644 --- a/requirements.in +++ b/requirements.in @@ -1,6 +1,6 @@ # SPDX-FileCopyrightText: David Fritzsche # SPDX-License-Identifier: CC0-1.0 -black<23 +black>=23,<24 bump2version coverage[toml] dflit @@ -13,12 +13,13 @@ flake8-pyi fsfe-reuse invoke isort -mypy==0.971 +mypy~=1.0 pip-tools -pip>=19.3 +pip>=20.3 pytest-cov pytest-html -pytest~=7.1.2 +pytest~=7.2.1 setuptools>=43 +tox < 4 tox-pyenv -tox>=3.14.3 +types-invoke diff --git a/requirements.txt b/requirements.txt index bcf75ba..40cd141 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,38 +1,38 @@ # -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: # -# pip-compile --allow-unsafe --no-emit-index-url +# ./lock-requirements.sh # -attrs==22.1.0 +attrs==22.2.0 # via # flake8-bugbear # pytest binaryornot==0.4.4 # via reuse -black==22.8.0 +black==23.1.0 # via -r requirements.in boolean-py==4.0 # via # license-expression # reuse -build==0.8.0 +build==0.10.0 # via pip-tools bump2version==1.0.1 # via -r requirements.in -certifi==2022.9.14 +certifi==2022.12.7 # via requests -chardet==5.0.0 +chardet==5.1.0 # via # binaryornot # python-debian -charset-normalizer==2.1.1 +charset-normalizer==3.0.1 # via requests click==8.1.3 # via # black # pip-tools -coverage[toml]==6.4.4 +coverage[toml]==7.2.0 # via # -r requirements.in # pytest-cov @@ -44,67 +44,72 @@ distlib==0.3.6 # via virtualenv docutils==0.19 # via dflit -filelock==3.8.0 +exceptiongroup==1.1.0 + # via pytest +filelock==3.9.0 # via # tox # virtualenv -flake8==5.0.4 +flake8==6.0.0 # via # flake8-bugbear # flake8-comprehensions # flake8-html # flake8-mutable # flake8-pyi -flake8-bugbear==22.9.11 +flake8-bugbear==23.2.13 # via -r requirements.in -flake8-comprehensions==3.10.0 +flake8-comprehensions==3.10.1 # via -r requirements.in -flake8-html==0.4.2 +flake8-html==0.4.3 # via -r requirements.in -flake8-logging-format==0.7.5 +flake8-logging-format==0.9.0 # via -r requirements.in flake8-mutable==1.2.0 # via -r requirements.in -flake8-pyi==22.8.2 +flake8-pyi==23.1.2 # via -r requirements.in fsfe-reuse==1.0.0 # via -r requirements.in idna==3.4 # via requests -iniconfig==1.1.1 +iniconfig==2.0.0 # via pytest -invoke==1.7.1 +invoke==2.0.0 # via -r requirements.in -isort==5.10.1 +isort==5.12.0 # via -r requirements.in jinja2==3.1.2 # via # flake8-html # reuse -license-expression==30.0.0 +license-expression==30.1.0 # via reuse -markupsafe==2.1.1 +markupsafe==2.1.2 # via jinja2 mccabe==0.7.0 # via flake8 -mypy==0.971 +mypy==1.0.1 # via -r requirements.in -mypy-extensions==0.4.3 +mypy-extensions==1.0.0 # via # black # mypy -packaging==21.3 +packaging==23.0 # via + # black # build # pytest # tox -pathspec==0.10.1 +pathspec==0.11.0 # via black -pep517==0.13.0 - # via build -pip-tools==6.8.0 +pip==23.0.1 + # via + # -r requirements.in + # pip-tools +pip-tools==6.12.2 # via -r requirements.in -platformdirs==2.5.2 +platformdirs==3.0.0 # via # black # virtualenv @@ -114,42 +119,45 @@ pluggy==1.0.0 # tox py==1.11.0 # via - # pytest + # pytest-html # tox -pycodestyle==2.9.1 +pycodestyle==2.10.0 # via flake8 -pyflakes==2.5.0 +pyflakes==3.0.1 # via # flake8 # flake8-pyi -pygments==2.13.0 +pygments==2.14.0 # via flake8-html -pyparsing==3.0.9 - # via packaging -pytest==7.1.3 +pyproject-hooks==1.0.0 + # via build +pytest==7.2.1 # via # -r requirements.in # pytest-cov # pytest-html # pytest-metadata -pytest-cov==3.0.0 +pytest-cov==4.0.0 # via -r requirements.in -pytest-html==3.1.1 +pytest-html==3.2.0 # via -r requirements.in -pytest-metadata==2.0.2 +pytest-metadata==2.0.4 # via pytest-html -python-debian==0.1.47 +python-debian==0.1.49 # via reuse pytoml==0.1.21 # via # dflit # dflit-core -requests==2.28.1 +requests==2.28.2 + # via dflit +reuse==1.1.2 + # via fsfe-reuse +setuptools==67.4.0 # via - # dflit + # -r requirements.in + # pip-tools # reuse -reuse==1.0.0 - # via fsfe-reuse six==1.16.0 # via tox tomli==2.0.1 @@ -158,31 +166,22 @@ tomli==2.0.1 # build # coverage # mypy - # pep517 + # pyproject-hooks # pytest # tox -tox==3.26.0 +tox==3.28.0 # via # -r requirements.in # tox-pyenv tox-pyenv==1.1.0 # via -r requirements.in -typing-extensions==4.3.0 +types-invoke==2.0.0.3 + # via -r requirements.in +typing-extensions==4.5.0 # via mypy -urllib3==1.26.12 +urllib3==1.26.14 # via requests -virtualenv==20.16.5 +virtualenv==20.19.0 # via tox -wheel==0.37.1 +wheel==0.38.4 # via pip-tools - -# The following packages are considered to be unsafe in a requirements file: -pip==22.2.2 - # via - # -r requirements.in - # pip-tools -setuptools==65.3.0 - # via - # -r requirements.in - # pip-tools - # reuse diff --git a/src/pytest_mypy_testing/output_processing.py b/src/pytest_mypy_testing/output_processing.py index b3b0c85..08e272d 100644 --- a/src/pytest_mypy_testing/output_processing.py +++ b/src/pytest_mypy_testing/output_processing.py @@ -111,7 +111,6 @@ def _chunk_to_dict(chunk: Sequence[Message]) -> Dict[int, List[Message]]: for a_chunk, b_chunk in iter_msg_seq_diff_chunks( actual_messages, expected_messages ): - a_dict = _chunk_to_dict(a_chunk) b_dict = _chunk_to_dict(b_chunk) diff --git a/src/pytest_mypy_testing/plugin.py b/src/pytest_mypy_testing/plugin.py index 5f146dc..10bf5c9 100644 --- a/src/pytest_mypy_testing/plugin.py +++ b/src/pytest_mypy_testing/plugin.py @@ -158,7 +158,6 @@ def run_mypy(self, item: MypyTestItem) -> Tuple[int, List[Message]]: def _run_mypy(self, filename: Union[pathlib.Path, os.PathLike, str]) -> MypyResult: filename = pathlib.Path(filename) with tempfile.TemporaryDirectory(prefix="pytest-mypy-testing-") as tmp_dir_name: - mypy_cache_dir = os.path.join(tmp_dir_name, "mypy_cache") os.makedirs(mypy_cache_dir) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 9be6f36..6e836bd 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -40,7 +40,6 @@ def test_create_mypy_assertion_error(): def mk_dummy_parent(tmp_path, filename, content=""): - path = tmp_path / filename path.write_text(content) diff --git a/tox.ini b/tox.ini index 01886c2..3506ae6 100644 --- a/tox.ini +++ b/tox.ini @@ -104,7 +104,7 @@ deps = allowlist_externals = sh commands = - sh ./lock_requirements.sh {posargs} + sh ./lock-requirements.sh {posargs} [tox:.package] # note tox will use the same python version as under what tox is