From 456283a93de476b669a53c982980fbc5346a80da Mon Sep 17 00:00:00 2001 From: Astounds Date: Sun, 3 May 2026 16:53:02 -0500 Subject: [PATCH] fix: work around Wine build isolation failure in generate_release On POSIX (Wine), pip's isolated build environment can't import setuptools.build_meta. Install setuptools and wheel first, then use --no-build-isolation for requirements.txt. Also add python/ to .gitignore. --- .gitignore | 1 + generate_release.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1417685..025d0e0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ *$py.class *.so .Python +python/ # ----------------------------------------------------------------------------- # Virtual Environments diff --git a/generate_release.py b/generate_release.py index 76c979d..46e91bb 100644 --- a/generate_release.py +++ b/generate_release.py @@ -222,7 +222,14 @@ log('Inserting Microsoft C Runtime') check_subp(subprocess.run([r'7z', '-y', 'e', '-opython', visual_c_name, visual_c_path_to_dlls])) log('Installing dependencies') -wine_run(['./python/python.exe', '-I', '-m', 'pip', 'install', '--no-compile', '-r', './requirements.txt']) +pip_install = ['./python/python.exe', '-I', '-m', 'pip', 'install', '--no-compile'] +if os.name == 'posix': + # Wine's isolated build environment can't import setuptools.build_meta, + # so we install build tools first and disable isolation. + wine_run(pip_install + ['setuptools', 'wheel']) + wine_run(pip_install + ['--no-build-isolation', '-r', './requirements.txt']) +else: + wine_run(pip_install + ['-r', './requirements.txt']) log('Uninstalling unnecessary gevent stuff') wine_run(['./python/python.exe', '-I', '-m', 'pip', 'uninstall', '--yes', 'cffi', 'pycparser']) @@ -231,7 +238,11 @@ shutil.rmtree(r'./python/Lib/site-packages/gevent/testing') remove_files_with_extensions(r'./python/Lib/site-packages/gevent', ['.html']) # bloated html documentation log('Uninstalling pip and others') -wine_run(['./python/python.exe', '-I', '-m', 'pip', 'uninstall', '--yes', 'pip', 'wheel']) +pip_uninstall = ['./python/python.exe', '-I', '-m', 'pip', 'uninstall', '--yes'] +if os.name == 'posix': + wine_run(pip_uninstall + ['pip', 'setuptools', 'wheel']) +else: + wine_run(pip_uninstall + ['pip', 'wheel']) log('Removing pyc files') # Have to do this because get-pip and some packages don't respect --no-compile remove_files_with_extensions(r'./python', ['.pyc'])