Installed-wheel CI installs wheels, then runs tests from a checkout that may still contain package sources. There is an obvious trap: an import check run from the repository root can find the installed wheel, while a later test run from inside a package directory may import checkout code. A green job could then tell us less about the wheel than we think. We have not identified a false pass; this is a preventive question.
#2892 explored skipping source-dependent tests when package sources are removed.
#2949 explored python -I -m pytest with an import-origin check inside each pytest process. -I keeps the working directory and PYTHONPATH off Python’s initial import path, addressing the most direct way checkout code can shadow a wheel while leaving source-tree tests available. However, this still falls short of isolation:
- pytest can alter
sys.path after Python starts,
- tests can load checkout files directly, and
- child processes do not automatically inherit
-I.
What should an installed-wheel job guarantee, and are import checks sufficient, or should package sources be made unavailable during those tests?
Installed-wheel CI installs wheels, then runs tests from a checkout that may still contain package sources. There is an obvious trap: an import check run from the repository root can find the installed wheel, while a later test run from inside a package directory may import checkout code. A green job could then tell us less about the wheel than we think. We have not identified a false pass; this is a preventive question.
#2892 explored skipping source-dependent tests when package sources are removed.
#2949 explored
python -I -m pytestwith an import-origin check inside each pytest process.-Ikeeps the working directory andPYTHONPATHoff Python’s initial import path, addressing the most direct way checkout code can shadow a wheel while leaving source-tree tests available. However, this still falls short of isolation:sys.pathafter Python starts,-I.What should an installed-wheel job guarantee, and are import checks sufficient, or should package sources be made unavailable during those tests?