fix: work around Wine build isolation failure in generate_release
All checks were successful
git-sync-with-mirror / git-sync (push) Successful in 13s
CI / test (push) Successful in 45s

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.
This commit is contained in:
2026-05-03 16:53:02 -05:00
parent 13708bb4ea
commit 456283a93d
2 changed files with 14 additions and 2 deletions

1
.gitignore vendored
View File

@@ -10,6 +10,7 @@ __pycache__/
*$py.class
*.so
.Python
python/
# -----------------------------------------------------------------------------
# Virtual Environments

View File

@@ -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'])