Commit 8ec7868
authored
tests(cli[sync_sigint]) Survive distro relative-PYTHONPATH builds (#549)
The single subprocess-based test in vcspull's CLI suite failed on
distro builders (e.g. Arch Linux PKGBUILD) that test staged-install
wheels through a relative ``PYTHONPATH`` entry from the source tree.
The root ``conftest.py``'s autouse ``cwd_default`` fixture chdirs each
test into a per-test ``tmp_path``, the subprocess inherits that CWD,
and the relative ``PYTHONPATH`` then resolves to a non-existent path
-- the child fails with ``ModuleNotFoundError: No module named
'vcspull'``. ``uv run pytest`` masks the bug because the venv exposes
vcspull via absolute site-packages.
- **Anchor** the subprocess to vcspull's actually-loaded install
location via ``importlib.util.find_spec``, then prepend that
absolute directory to the child's ``PYTHONPATH``.
- **Preserve** any incoming ``PYTHONPATH`` so other build setups
remain unaffected.
- **Audit** the rest of the codebase for the same failure mode --
this is the only test that spawns a Python subprocess importing
vcspull, so the fix closes the full exposure surface.
- **Document** the packager-visible behaviour change under the
CHANGES ``### Development`` section so distros can confirm the
test-suite portability fix in release notes.2 files changed
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
59 | 78 | | |
60 | 79 | | |
61 | 80 | | |
| |||
0 commit comments