From 02d42388408f71533d498c05046893c5773b23fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Mon, 15 Jun 2026 16:30:34 +0100 Subject: [PATCH] test: Install fake package non-editable for discovery test Modern setuptools installs editable packages via an import-hook finder shim (__editable__..._finder.py), so importlib.metadata reports the shim rather than the package's own source files, failing the discovery assertions. A regular install records the source files deterministically across setuptools versions. --- packages/pyright-scip/test/python-cli-test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/pyright-scip/test/python-cli-test.ts b/packages/pyright-scip/test/python-cli-test.ts index afc469ddc..d468e8f13 100644 --- a/packages/pyright-scip/test/python-cli-test.ts +++ b/packages/pyright-scip/test/python-cli-test.ts @@ -82,8 +82,13 @@ setup( execSync(`python3 -m venv "${venvDir}"`, { stdio: 'pipe' }); const venvBinDir = path.join(venvDir, process.platform === 'win32' ? 'Scripts' : 'bin'); const pipPath = path.join(venvBinDir, 'pip'); - // Install the fake package in the virtual environment - execSync(`"${pipPath}" install -e "${packageTempDir}"`, { stdio: 'pipe' }); + // Install the fake package in the virtual environment. We use a regular + // (non-editable) install so the package's source files are recorded in + // the dist metadata across setuptools versions. Modern setuptools + // installs editable packages via an import-hook finder shim + // (__editable__..._finder.py), which importlib.metadata reports instead + // of the package's own .py files. + execSync(`"${pipPath}" install "${packageTempDir}"`, { stdio: 'pipe' }); // Simulate `source venv/bin/activate` by modifying PATH so that it propagates // down to calls inside gatherPackageData. const originalPath = process.env.PATH;