Skip to content

FIX: preserve PYTHONPATH under --python=same discovery - #1612

Open
HaoZeke wants to merge 1 commit into
airspeed-velocity:mainfrom
HaoZeke:fix/1537-pythonpath-same
Open

FIX: preserve PYTHONPATH under --python=same discovery#1612
HaoZeke wants to merge 1 commit into
airspeed-velocity:mainfrom
HaoZeke:fix/1537-pythonpath-same

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

--python=same discovery no longer strips host PYTHONPATH from sys.path when ASV_PYTHONPATH is unset (issue #1537). That was a 0.6.5 regression from #1462: SciPy (and other in-tree builds) put the meson build dir on PYTHONPATH, and ExistingEnvironment inherits it; the else branch then removed those paths and import scipy failed. Managed envs still drop bare PYTHONPATH in Environment.run_executable. The scipy#25847 ASV_PYTHONPATH = PYTHONPATH assignment remains valid for managed envs.

Test plan

  • test/test_benchmark_path_env.py (keep PYTHONPATH; apply ASV_PYTHONPATH; prepend order)
  • test_run_python_same, test_profile_python_same, test_check

Fixes #1537

benchmark.py stripped host PYTHONPATH whenever ASV_PYTHONPATH was
unset. That broke in-tree workflows (e.g. scipy build dirs on
PYTHONPATH) with --python=same / ExistingEnvironment, and also undid
ASV_PYTHONPATH after run_executable rewrote it to PYTHONPATH. Managed
env isolation stays in run_executable.

Fixes airspeed-velocity#1537.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: No module named 'scipy' with --python=same

1 participant