Conversation
a07a320 to
f57c91c
Compare
b2b5e84 to
ef07488
Compare
ef07488 to
1e170b0
Compare
74d635c to
fd2301e
Compare
fd2301e to
630fff0
Compare
b33c388 to
be6c64c
Compare
…ns is an implementation detail.
jaraco/text/__init__.py
Outdated
|
|
||
| @ExceptionTrap(UnicodeDecodeError).passes | ||
| def is_decodable(value): | ||
| @ExceptionTrap(UnicodeDecodeError).passes # type: ignore[no-untyped-call, untyped-decorator] # jaraco/jaraco.context#15 |
There was a problem hiding this comment.
Sadly, this isn't working on mypy under PyPy.
FAILED jaraco/text/__init__.py::mypy - jaraco/text/__init__.py:205: error: Unused "type: ignore[untyped-decorator]...
There was a problem hiding this comment.
Interestingly, it passes for me locally.
Details
jaraco.text main 🐚 tox -e pypy
.pkg-pypy310: install_requires> python -I -m pip install coherent.licensed 'setuptools>=77' 'setuptools_scm[toml]>=3.4.1'
.pkg-pypy310: _optional_hooks> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.13/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
.pkg-pypy310: get_requires_for_build_editable> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.13/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
.pkg-pypy310: build_editable> python '/Users/jaraco/Library/Application Support/pipx/venvs/tox/lib/python3.13/site-packages/pyproject_api/_backend.py' True setuptools.build_meta
pypy: install_package_deps> python -I -m pip install autocommand inflect 'jaraco.context>=4.1' jaraco.functools more_itertools 'mypy<1.19; platform_python_implementation == "PyPy"' 'pathlib2; python_version < "3.10"' 'pytest!=8.1.*,>=6' 'pytest-checkdocs>=2.4' pytest-cov 'pytest-enabler>=3.4' 'pytest-mypy>=1.0.1' 'pytest-ruff>=0.2.1; sys_platform != "cygwin"'
pypy: install_package> python -I -m pip install --force-reinstall --no-deps /Users/jaraco/code/jaraco/jaraco.text/.tox/.tmp/package/36/jaraco_text-4.0.1.dev56+g6a9b9bd06-0.editable-py3-none-any.whl
pypy: commands[0]> pytest
============================================================== test session starts ===============================================================
platform darwin -- Python 3.10.14[pypy-7.3.17-final], pytest-9.0.2, pluggy-1.6.0
cachedir: .tox/pypy/.pytest_cache
rootdir: /Users/jaraco/code/jaraco/jaraco.text
configfile: pytest.ini
plugins: mypy-1.0.1, ruff-0.5, checkdocs-2.14.0, enabler-3.4.0, typeguard-4.4.4, cov-7.0.0
collected 53 items
conftest.py ... [ 5%]
docs/conf.py ... [ 11%]
jaraco/text/__init__.py ........................... [ 62%]
jaraco/text/layouts.py ..... [ 71%]
jaraco/text/show-newlines.py .... [ 79%]
jaraco/text/strip-prefix.py .... [ 86%]
jaraco/text/to-dvorak.py ... [ 92%]
jaraco/text/to-qwerty.py ... [ 98%]
. . [100%]
================================================================ warnings summary ================================================================
conftest.py::mypy
/opt/homebrew/Cellar/pypy3.10/7.3.17_1/libexec/lib/pypy3.10/configparser.py:694: EncodingWarning: 'encoding' argument not specified.
encoding = io.text_encoding(encoding)
conftest.py::mypy
/Users/jaraco/code/jaraco/jaraco.text/.tox/pypy/lib/pypy3.10/site-packages/mypy/modulefinder.py:979: EncodingWarning: 'encoding' argument not specified.
with open(versions_path) as f:
conftest.py::mypy
/Users/jaraco/code/jaraco/jaraco.text/.tox/pypy/lib/pypy3.10/site-packages/mypy/build.py:3583: EncodingWarning: 'encoding' argument not specified.
with open(fnam, "w") as f:
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================================== mypy ======================================================================
Success: no issues found in 8 source files
================================================================= tests coverage =================================================================
_______________________________________________ coverage: platform darwin, python 3.10.14-final-0 ________________________________________________
Name Stmts Miss Cover Missing
------------------------------------------------------------
conftest.py 6 0 100%
docs/conf.py 15 0 100%
jaraco/text/__init__.py 165 0 100%
jaraco/text/layouts.py 8 0 100%
jaraco/text/show-newlines.py 10 0 100%
jaraco/text/strip-prefix.py 6 0 100%
jaraco/text/to-dvorak.py 3 0 100%
jaraco/text/to-qwerty.py 3 0 100%
------------------------------------------------------------
TOTAL 216 0 100%
=================================================== 53 passed, 3 warnings in 87.69s (0:01:27) ====================================================
pypy: OK (99.52=setup[10.55]+cmd[88.97] seconds)
congratulations :) (99.58 seconds)
There was a problem hiding this comment.
My guess is the untyped-decorator was added in a later mypy, but since mypy dropped support for PyPy (python/mypy#20454), it is now no longer compatible.
There was a problem hiding this comment.
It's not that the PyPy issue. And if it was, that wouldn't have explained why mine passed locally. I did try installing mypy<1.19 in my CPython install, but that had no effect (still passes).
There was a problem hiding this comment.
Oh, silly me. I wasn't on the PR branch. After switching to the PR branch, I'm able to replicate the failure.
There was a problem hiding this comment.
I tried adding in another ignore ("unused-ignore"), but now there's a new mypy error (still PyPy only):
jaraco/text/__init__.py:205: error: Untyped decorator makes function "is_decodable" untyped [misc]
jaraco/text/__init__.py:205: note: Error code "misc" not covered by "type: ignore" comment
There was a problem hiding this comment.
If it's a pypy-only failure, that's odd.
But even if it's not, I'll take this opportunity to mention that I've also been pushing to stop running mypy on pypy for various reasons: flaky tests, randomly not matching an import-based error (likely due to differing dependencies), sporadic build failures, taking more CI time for a static non-runtime check that is already covered, etc: jaraco/skeleton#187
There was a problem hiding this comment.
In ab1de64, I suppressed those additional classes and now the tests are passing on mypy too.
There was a problem hiding this comment.
I've been pushing to stop running mypy on pypy
Probably a wise choice. I'd like to avoid making that change a blocker for this change, so I'll follow up on that later, now that I've found a workaround.
There was a problem hiding this comment.
It's funny you can ignore unused-ignore, I seem to remember this was causing a self-referential issue a long time ago !
|
Thanks for the thorough review! Now that this is merged, my other 3 PRs have conflicts, but they are 3 suggestions for the same core issue. I'll let you think about your preferred approach before fixing conflicts. |
Closes #17
Ref: jaraco/skeleton#143
This is one of the untyped libs used by distutils and setuptools.