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.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,6 +10,7 @@ __pycache__/
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
python/
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Virtual Environments
|
||||
|
||||
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user