diff options
| author | Astounds <kirito@disroot.org> | 2026-05-03 16:53:02 -0500 |
|---|---|---|
| committer | Astounds <kirito@disroot.org> | 2026-05-03 16:53:02 -0500 |
| commit | 456283a93de476b669a53c982980fbc5346a80da (patch) | |
| tree | d96561632523ce609c5b8637bc02b608e6fabd24 /generate_release.py | |
| parent | 13708bb4ea9e0f0e3c16308d0f7463c6968bd8b5 (diff) | |
| download | yt-local-456283a93de476b669a53c982980fbc5346a80da.tar.lz yt-local-456283a93de476b669a53c982980fbc5346a80da.tar.xz yt-local-456283a93de476b669a53c982980fbc5346a80da.zip | |
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.
Diffstat (limited to 'generate_release.py')
| -rw-r--r-- | generate_release.py | 15 |
1 files changed, 13 insertions, 2 deletions
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']) |
