Skip to content

Commit 89ec907

Browse files
committed
fix(ci): stop PyPI commoncode from shadowing in-tree sources
After #5116, transitive deps still install PyPI commoncode into site-packages. That dist shadows src/commoncode from the editable install (PyPI clean_path uses rstrip; in-tree uses strip), so --full-root CLI tests fail on develop and on PRs. Uninstall the PyPI commoncode package after configure and after the latest_from_pip reinstall so the in-tree sources win.
1 parent 7fe8ee2 commit 89ec907

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

azure-pipelines.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,39 +194,39 @@ jobs:
194194
image_name: ubuntu-22.04
195195
python_versions: ['3.10', '3.11', '3.12', '3.13', '3.14']
196196
test_suites:
197-
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
197+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && (venv/bin/pip uninstall -y commoncode || true) && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
198198

199199
- template: etc/ci/azure-posix.yml
200200
parameters:
201201
job_name: ubuntu24_cpython_latest_from_pip
202202
image_name: ubuntu-24.04
203203
python_versions: ['3.10', '3.11', '3.12', '3.13', '3.14']
204204
test_suites:
205-
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
205+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && (venv/bin/pip uninstall -y commoncode || true) && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
206206

207207
- template: etc/ci/azure-posix.yml
208208
parameters:
209209
job_name: macos14_cpython_latest_from_pip
210210
image_name: macos-14
211211
python_versions: ['3.10', '3.11', '3.12', '3.13', '3.14']
212212
test_suites:
213-
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
213+
all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && (venv/bin/pip uninstall -y commoncode || true) && venv/bin/pytest -n 2 -vvs tests/scancode/test_cli.py
214214

215215
- template: etc/ci/azure-win.yml
216216
parameters:
217217
job_name: win2019_cpython_latest_from_pip
218218
image_name: windows-2025-vs2026
219219
python_versions: ['3.10', '3.11', '3.12', '3.13', '3.14']
220220
test_suites:
221-
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
221+
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv\Scripts\pip uninstall -y commoncode & venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
222222

223223
- template: etc/ci/azure-win.yml
224224
parameters:
225225
job_name: win2022_cpython_latest_from_pip
226226
image_name: windows-2022
227227
python_versions: ['3.10', '3.11', '3.12', '3.13', '3.14']
228228
test_suites:
229-
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
229+
all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e .[testing] && venv\Scripts\pip uninstall -y commoncode & venv\Scripts\pytest -n 2 -vvs tests\scancode\test_cli.py
230230

231231

232232
################################################################################

configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ find_python
314314
create_virtualenv "$VIRTUALENV_DIR"
315315
install_packages "$FLOT_REQUIREMENTS"
316316
install_packages "$CFG_REQUIREMENTS"
317+
# After commoncode was merged back (#5116), transitive deps still install PyPI
318+
# commoncode (e.g. 32.5.2) into site-packages. That package shadows the in-tree
319+
# src/commoncode from the editable install (clean_path uses rstrip on PyPI vs
320+
# strip in-tree), which breaks --full-root CLI tests. Drop the PyPI dist so the
321+
# in-tree sources on the editable path win.
322+
"$CFG_BIN_DIR/pip" uninstall -y commoncode >/dev/null 2>&1 || true
317323
. "$CFG_BIN_DIR/activate"
318324
"$CFG_BIN_DIR/scancode-train-gibberish-model"
319325

configure.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ if %ERRORLEVEL% neq 0 (
168168
%PIP_EXTRA_ARGS% ^
169169
%CFG_REQUIREMENTS%
170170

171+
@rem After commoncode was merged back (#5116), transitive deps still install PyPI
172+
@rem commoncode into site-packages and shadow in-tree src/commoncode. Uninstall
173+
@rem the PyPI dist so the editable path sources win (needed for --full-root tests).
174+
"%CFG_BIN_DIR%\pip" uninstall -y commoncode >nul 2>&1
175+
171176
"%CFG_BIN_DIR%\scancode-train-gibberish-model"
172177

173178
@rem ################################

0 commit comments

Comments
 (0)