Also get rid of system_site_packages on Windows.
We can't symlink, so we copy the files instead.
This commit is contained in:
parent
b2646cb5c0
commit
6f1facac60
@ -109,10 +109,8 @@ def test_toolchain():
|
|||||||
|
|
||||||
def link_pyqt():
|
def link_pyqt():
|
||||||
"""Symlink the systemwide PyQt/sip into the venv."""
|
"""Symlink the systemwide PyQt/sip into the venv."""
|
||||||
if os.name == 'nt':
|
action = "Copying" if os.name == 'nt' else "Softlinking"
|
||||||
return
|
utils.print_title("{} PyQt5".format(action))
|
||||||
utils.print_title("Softlinking PyQt5")
|
|
||||||
|
|
||||||
sys_path = distutils.sysconfig.get_python_lib()
|
sys_path = distutils.sysconfig.get_python_lib()
|
||||||
venv_path = venv_python(
|
venv_path = venv_python(
|
||||||
'-c', 'from distutils.sysconfig import get_python_lib\n'
|
'-c', 'from distutils.sysconfig import get_python_lib\n'
|
||||||
@ -130,13 +128,19 @@ def link_pyqt():
|
|||||||
files += [os.path.basename(e) for e in globbed_sip]
|
files += [os.path.basename(e) for e in globbed_sip]
|
||||||
for fn in files:
|
for fn in files:
|
||||||
source = os.path.join(sys_path, fn)
|
source = os.path.join(sys_path, fn)
|
||||||
link_name = os.path.join(venv_path, fn)
|
dest = os.path.join(venv_path, fn)
|
||||||
if not os.path.exists(source):
|
if not os.path.exists(source):
|
||||||
raise FileNotFoundError(source)
|
raise FileNotFoundError(source)
|
||||||
if os.path.exists(link_name):
|
if os.path.exists(dest):
|
||||||
os.unlink(link_name)
|
os.unlink(dest)
|
||||||
print('{} -> {}'.format(source, link_name))
|
print('{} -> {}'.format(source, dest))
|
||||||
os.symlink(source, link_name)
|
if os.name == 'nt':
|
||||||
|
if os.path.isdir(source):
|
||||||
|
shutil.copytree(source, dest)
|
||||||
|
else:
|
||||||
|
shutil.copy(source, dest)
|
||||||
|
else:
|
||||||
|
os.symlink(source, dest)
|
||||||
|
|
||||||
|
|
||||||
def create_venv():
|
def create_venv():
|
||||||
@ -144,12 +148,10 @@ def create_venv():
|
|||||||
utils.print_title("Creating venv")
|
utils.print_title("Creating venv")
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
symlinks = False
|
symlinks = False
|
||||||
system_site_packages = True
|
|
||||||
else:
|
else:
|
||||||
symlinks = True
|
symlinks = True
|
||||||
system_site_packages = False
|
|
||||||
clear = g_args.clear or g_args.force
|
clear = g_args.clear or g_args.force
|
||||||
builder = venv.EnvBuilder(system_site_packages=system_site_packages,
|
builder = venv.EnvBuilder(system_site_packages=False,
|
||||||
clear=clear, upgrade=g_args.upgrade,
|
clear=clear, upgrade=g_args.upgrade,
|
||||||
symlinks=symlinks, with_pip=True)
|
symlinks=symlinks, with_pip=True)
|
||||||
builder.create(g_path)
|
builder.create(g_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user