summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2025-05-24 22:38:44 -0400
committerEli Schwartz <eschwartz93@gmail.com>2025-05-25 00:06:18 -0400
commit23e4e2f20ca698f4070f7da79f5e06249d34b622 (patch)
treee02eb3e4eaa9a81d6cec563be00caaa93a921011
parent315140fd07625ea9f692ac01fc19da27ae1754c5 (diff)
downloadmeson-23e4e2f20ca698f4070f7da79f5e06249d34b622.tar.gz
Unbreak "Fix setuptools 49 test. (fixes #7452)"
This unbreaks commit 59910c437a81b94c72e3cbdfc2c3612fae576d6e. It kind of maybe appears to fix something but does break it all quite terribly too. Totally random subdirectories of site-packages/ should certainly not be added to PYTHONPATH regardless of anything else as that may include mesonbuild/, leading to `import ast` finding mesonbuild.ast instead... The underlying issue here is that egg .pth is not loaded from PYTHONPATH at all, which means depending on versions of e.g. setuptools this test may end up solely testing system-installed meson, or fail entirely. So we can fix this by manually adding eggs specifically.
-rwxr-xr-xrun_meson_command_tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/run_meson_command_tests.py b/run_meson_command_tests.py
index f9faca9af..7265d3e03 100755
--- a/run_meson_command_tests.py
+++ b/run_meson_command_tests.py
@@ -143,7 +143,7 @@ class CommandTests(unittest.TestCase):
os.environ['PATH'] = str(bindir) + os.pathsep + os.environ['PATH']
self._run(python_command + ['setup.py', 'install', '--prefix', str(prefix)])
# Fix importlib-metadata by appending all dirs in pylibdir
- PYTHONPATHS = [pylibdir] + [x for x in pylibdir.iterdir()]
+ PYTHONPATHS = [pylibdir] + [x for x in pylibdir.iterdir() if x.name.endswith('.egg')]
PYTHONPATHS = [os.path.join(str(x), '') for x in PYTHONPATHS]
os.environ['PYTHONPATH'] = os.pathsep.join(PYTHONPATHS)
# Check that all the files were installed correctly