mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Do not consider `import a.b as b` an explicit reexport

Open andersk opened this issue 3 years ago • 1 comments

The point of the import a as a and from a import b as b syntax for explicit reexport is that it indicates an intention to do something different from the ordinary import a and from a import b.

That is not the case with import a.b as b. Even mypy’s own code includes import mypy.types as types, which was not intended to be a reexport; if it were, it would be written from mypy import types as types.

Pyright agrees that import a.b as b should not reexport.

andersk avatar Nov 13 '22 22:11 andersk

Diff from mypy_primer, showing the effect of this PR on open source code:

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/compat.py:46: error: "Module py" does not explicitly export attribute "path"  [attr-defined]
+ src/_pytest/compat.py:50: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/compat.py:50: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/compat.py:52: error: Returning Any from function declared to return LEGACY_PATH?  [no-any-return]
+ src/_pytest/hookspec.py:266: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:266: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:287: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:287: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:359: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:359: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:742: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:742: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:773: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:773: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:96: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:96: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:107: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:110: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:118: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:122: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:170: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:170: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:191: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:191: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:580: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:580: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:637: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:637: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/config/compat.py:48: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/config/compat.py:48: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/config/compat.py:50: error: Statement is unreachable  [unreachable]
+ src/_pytest/config/compat.py:58: error: Statement is unreachable  [unreachable]
+ src/_pytest/config/compat.py:63: error: Statement is unreachable  [unreachable]
+ src/_pytest/python.py:665: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/python.py:665: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:59: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:59: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:64: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:64: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:95: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:95: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:107: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:111: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:111: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:119: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:119: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:123: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:127: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:127: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:135: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:135: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:139: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:139: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:143: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:143: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:291: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:291: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:295: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:295: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:310: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:310: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:332: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:332: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:340: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:340: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:345: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:345: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:355: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:355: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:366: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:366: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:376: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:376: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:386: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:386: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:409: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:409: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:414: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:414: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ testing/test_legacypath.py:17: error: Unsupported left operand type for == (LEGACY_PATH?)  [operator]
+ testing/test_legacypath.py:23: error: LEGACY_PATH? has no attribute "check"  [attr-defined]
+ testing/test_legacypath.py:61: error: LEGACY_PATH? has no attribute "exists"  [attr-defined]
+ testing/_py/test_local.py:8: error: Module "py" does not explicitly export attribute "error"  [attr-defined]

github-actions[bot] avatar Nov 13 '22 23:11 github-actions[bot]

Diff from mypy_primer, showing the effect of this PR on open source code:

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/hookspec.py:267: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:267: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:288: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:288: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:360: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:360: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:747: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:747: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:778: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:778: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/compat.py:30: error: Module "py" does not explicitly export attribute "path"  [attr-defined]
+ src/_pytest/compat.py:34: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/compat.py:34: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/compat.py:36: error: Returning Any from function declared to return LEGACY_PATH?  [no-any-return]
+ src/_pytest/nodes.py:97: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:97: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:108: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:111: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:119: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:123: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:172: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:172: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:193: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:193: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:587: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:587: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:644: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:644: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/config/compat.py:47: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/config/compat.py:47: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/config/compat.py:49: error: Statement is unreachable  [unreachable]
+ src/_pytest/config/compat.py:57: error: Statement is unreachable  [unreachable]
+ src/_pytest/config/compat.py:62: error: Statement is unreachable  [unreachable]
+ src/_pytest/python.py:667: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/python.py:667: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:58: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:58: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:63: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:63: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:94: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:106: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:110: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:118: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:122: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:122: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:126: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:126: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:134: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:134: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:138: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:138: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:142: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:142: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:290: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:290: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:294: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:294: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:309: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:309: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:331: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:331: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:339: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:339: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:344: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:344: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:354: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:354: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:365: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:365: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:375: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:375: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:385: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:385: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:408: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:408: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:413: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:413: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ testing/test_legacypath.py:18: error: Unsupported left operand type for == (LEGACY_PATH?)  [operator]
+ testing/test_legacypath.py:24: error: LEGACY_PATH? has no attribute "check"  [attr-defined]
+ testing/test_legacypath.py:62: error: LEGACY_PATH? has no attribute "exists"  [attr-defined]
+ testing/_py/test_local.py:10: error: Module "py" does not explicitly export attribute "error"  [attr-defined]

github-actions[bot] avatar Sep 16 '23 09:09 github-actions[bot]

https://github.com/python/mypy/pull/16129 should unblock this

hauntsaninja avatar Sep 16 '23 23:09 hauntsaninja

Diff from mypy_primer, showing the effect of this PR on open source code:

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/hookspec.py:267: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:267: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:288: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:288: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:360: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:360: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:747: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:747: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/hookspec.py:778: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/hookspec.py:778: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/compat.py:30: error: Module "py" does not explicitly export attribute "path"  [attr-defined]
+ src/_pytest/compat.py:34: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/compat.py:34: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/compat.py:36: error: Returning Any from function declared to return LEGACY_PATH?  [no-any-return]
+ src/_pytest/nodes.py:97: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:97: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:108: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:111: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:119: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:123: error: Statement is unreachable  [unreachable]
+ src/_pytest/nodes.py:172: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:172: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:193: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:193: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:587: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:587: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/nodes.py:644: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/nodes.py:644: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/config/compat.py:47: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/config/compat.py:47: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/config/compat.py:49: error: Statement is unreachable  [unreachable]
+ src/_pytest/config/compat.py:57: error: Statement is unreachable  [unreachable]
+ src/_pytest/config/compat.py:62: error: Statement is unreachable  [unreachable]
+ src/_pytest/python.py:667: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/python.py:667: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:58: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:58: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:63: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:63: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:94: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:106: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:110: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:118: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:118: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:122: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:122: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:126: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:126: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:134: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:134: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:138: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:138: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:142: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:142: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:290: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:290: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:294: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:294: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:309: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:309: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:331: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:331: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:339: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:339: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:344: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:344: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:354: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:354: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:365: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:365: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:375: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:375: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:385: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:385: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:408: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:408: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ src/_pytest/legacypath.py:413: error: Variable "_pytest.compat.LEGACY_PATH" is not valid as a type  [valid-type]
+ src/_pytest/legacypath.py:413: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
+ testing/test_legacypath.py:18: error: Unsupported left operand type for == (LEGACY_PATH?)  [operator]
+ testing/test_legacypath.py:24: error: LEGACY_PATH? has no attribute "check"  [attr-defined]
+ testing/test_legacypath.py:62: error: LEGACY_PATH? has no attribute "exists"  [attr-defined]
+ testing/_py/test_local.py:10: error: Module "py" does not explicitly export attribute "error"  [attr-defined]

github-actions[bot] avatar Sep 19 '23 04:09 github-actions[bot]

I guess I was wrong that #16129 would fix, but glad this got me to make that PR. Looks like it would take a larger change to how we handle ModuleType, so I will call it good and merge this.

hauntsaninja avatar Sep 20 '23 05:09 hauntsaninja