Sisyphus repository
Last update: 17 october 2019 | SRPMs: 17500 | Visits: 15283904
en ru br
ALT Linux repos
S:16.7.2-alt1
5.0: 1.3.3-alt1

Group :: Development/Python
RPM: python-module-virtualenv

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: python3-installation-within-the-bare-virtualenv.patch
Download


From 3be0797619417c65ac690289f37810c2b85e6b70 Mon Sep 17 00:00:00 2001
From: Stanislav Levin <slev@altlinux.org>
Date: Mon, 26 Mar 2018 16:34:21 +0300
Subject: [PATCH] Fix installation within the bare virtualenv under Python3
Creating bare virtual environment
(virtualenv3 -p '/usr/bin/python3.5' --no-wheel --no-pip --no-setuptools)
puts site-packages directory to /usr/lib/python3.5. But
distutils/setuptools expects /usr/lib/python3. So installation to
such environment will fail.
---
 virtualenv/virtualenv.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/virtualenv/virtualenv.py b/virtualenv/virtualenv.py
index 42cd1f4..9a95b75 100755
--- a/virtualenv/virtualenv.py
+++ b/virtualenv/virtualenv.py
@@ -1108,6 +1108,11 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
     else:
         prefix = sys.prefix
     mkdir(lib_dir)
+
+    if sys.version_info > (3, 0):
+        alt_lib_dir = join(home_dir, 'lib', 'python%s' % sys.version_info[0])
+        mkdir(alt_lib_dir)
+
     fix_lib64(lib_dir, symlink)
     stdlib_dirs = [os.path.dirname(os.__file__)]
     if is_win:
@@ -1135,7 +1140,10 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
     # ...copy tcl/tk
     if is_win:
         copy_tcltk(prefix, home_dir, symlink)
-    mkdir(join(lib_dir, 'site-packages'))
+    if sys.version_info > (3, 0):
+        mkdir(join(alt_lib_dir, 'site-packages'))
+    else:
+        mkdir(join(lib_dir, 'site-packages'))
     import site
     site_filename = site.__file__
     if site_filename.endswith('.pyc') or site_filename.endswith('.pyo'):
@@ -1215,6 +1223,8 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
     logger.notify('New %s executable in %s', expected_exe, py_executable)
     pcbuild_dir = os.path.dirname(sys.executable)
     pyd_pth = os.path.join(lib_dir, 'site-packages', 'virtualenv_builddir_pyd.pth')
+    if sys.version_info > (3, 0):
+        pyd_pth = os.path.join(alt_lib_dir, 'site-packages', 'virtualenv_builddir_pyd.pth')
     if is_win and os.path.exists(os.path.join(pcbuild_dir, 'build.bat')):
         logger.notify('Detected python running from build directory %s', pcbuild_dir)
         logger.notify('Writing .pth file linking to build directory for *.pyd files')
-- 
2.10.4
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin