python / importlib_metadata

Library to access metadata for Python packages
https://importlib-metadata.readthedocs.io
Apache License 2.0
122 stars 79 forks source link

Mypy tests failing on Windows only #478

Closed jaraco closed 7 months ago

jaraco commented 7 months ago

In this run and others, the mypy test is failing with:

================================== FAILURES ===================================
_____________________________ tests\test_main.py ______________________________
409: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]

On the non-Windows tests, the same message is shown as a warning:

=============================== warnings summary ===============================
tests/test_main.py::mypy
  /home/runner/work/importlib_metadata/importlib_metadata/.tox/py/lib/python3.11/site-packages/pytest_mypy.py:212: MypyWarning: 
  409: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
    warnings.warn("\n" + "\n".join(errors), MypyWarning)  # pragma: no cover

Dear god, why?

jaraco commented 7 months ago

For what it's worth, I don't encounter the error when testing on my Windows machine, so the difference between Windows and non-Windows appears to be in how the CI is configured... which seems really unlikely, given that tox filters most environment variables. Doesn't matter - the warning and error are both addressed by adding more redundant typing info.