venv: Only copy needed files on Windows.
This commit is contained in:
parent
6ceb0a41ff
commit
f3d570dd5b
@ -121,6 +121,12 @@ def test_toolchain():
|
|||||||
venv_python('-c', 'import {}'.format(pkg))
|
venv_python('-c', 'import {}'.format(pkg))
|
||||||
|
|
||||||
|
|
||||||
|
def get_ignored_files(dir, files):
|
||||||
|
"""Get the files which should be ignored for link_pyqt() on Windows."""
|
||||||
|
needed_exts = ('py', 'dll', 'pyd')
|
||||||
|
return [f for f in files if os.path.splitext(f)[1] not in needed_exts]
|
||||||
|
|
||||||
|
|
||||||
def link_pyqt():
|
def link_pyqt():
|
||||||
"""Symlink the systemwide PyQt/sip into the venv."""
|
"""Symlink the systemwide PyQt/sip into the venv."""
|
||||||
action = "Copying" if os.name == 'nt' else "Softlinking"
|
action = "Copying" if os.name == 'nt' else "Softlinking"
|
||||||
@ -150,7 +156,7 @@ def link_pyqt():
|
|||||||
print('{} -> {}'.format(source, dest))
|
print('{} -> {}'.format(source, dest))
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
if os.path.isdir(source):
|
if os.path.isdir(source):
|
||||||
shutil.copytree(source, dest)
|
shutil.copytree(source, dest, ignore=get_ignored_files)
|
||||||
else:
|
else:
|
||||||
shutil.copy(source, dest)
|
shutil.copy(source, dest)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user