[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
43/43: gnu: python-2.7: Add all guix prefixes in PYTHONPATH to site-pref
From: |
Hartmut Goebel |
Subject: |
43/43: gnu: python-2.7: Add all guix prefixes in PYTHONPATH to site-prefixes. |
Date: |
Tue, 18 Oct 2016 11:20:12 +0000 (UTC) |
htgoebel pushed a commit to branch wip-python-build-system
in repository guix.
commit 2c57349f2c52ce4f7b14a10fd9f026e76a57d000
Author: Hartmut Goebel <address@hidden>
Date: Tue Oct 18 00:11:05 2016 +0200
gnu: python-2.7: Add all guix prefixes in PYTHONPATH to site-prefixes.
* gnu/packages/patches/python-2.7-site-prefixes.patch: New file.
* gnu/packages/python.scm (python-2)[source]: Use it.
* gnu/local.mk (dist_patch_DATA): Add patch.
---
gnu/local.mk | 1 +
.../patches/python-2.7-site-prefixes.patch | 26 ++++++++++++++++++++
gnu/packages/python.scm | 1 +
3 files changed, 28 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index a9343f0..2cf920e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -788,6 +788,7 @@ dist_patch_DATA =
\
%D%/packages/patches/pyqt-configure.patch \
%D%/packages/patches/python-2-deterministic-build-info.patch \
%D%/packages/patches/python-2.7-search-paths.patch \
+ %D%/packages/patches/python-2.7-site-prefixes.patch \
%D%/packages/patches/python-2.7-source-date-epoch.patch \
%D%/packages/patches/python-3-deterministic-build-info.patch \
%D%/packages/patches/python-3-search-paths.patch \
diff --git a/gnu/packages/patches/python-2.7-site-prefixes.patch
b/gnu/packages/patches/python-2.7-site-prefixes.patch
new file mode 100644
index 0000000..9e30665
--- /dev/null
+++ b/gnu/packages/patches/python-2.7-site-prefixes.patch
@@ -0,0 +1,26 @@
+Add all /gnu/store/ prefixes found in PYTHONPATH to the prefixes where
+site-packages (and .pth files) are searched.
+
+*** Python-2.7.11/Lib/site.py.orig 2016-10-17 23:27:23.746149690 +0200
+--- Python-2.7.11/Lib/site.py 2016-10-17 23:44:51.930871644 +0200
+***************
+*** 65,70 ****
+--- 65,82 ----
+
+ # Prefixes for site-packages; add additional prefixes like /usr/local here
+ PREFIXES = [sys.prefix, sys.exec_prefix]
++ # Guix: Add all /gnu/store-paths in PYTHONPATH--these are all
++ # "prefixes". This is required to search .pth files in all python
++ # packages contained in /gnu/store which is required to make
++ # .pth-defined namespace packages work.
++ # This is necessary if the packages are not merged into a single
++ # `site-packages` directory (like when using `guix environment`) but
++ # listed in PYTHONPATH (like when running `guix build`).
++ for p in sys.path:
++ if p.startswith('/gnu/store/'):
++ PREFIXES.append(p[:p.find('/', 44)]) # find first pathsep after hash
++ del p
++
+ # Enable per user site-packages directory
+ # set it to False to disable the feature or True to force the feature
+ ENABLE_USER_SITE = None
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 47bf64a..5ef354c 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -117,6 +117,7 @@
"0iiz844riiznsyhhyy962710pz228gmhv8qi3yk4w4jhmx2lqawn"))
(patches (search-patches "python-2.7-search-paths.patch"
"python-2-deterministic-build-info.patch"
+ "python-2.7-site-prefixes.patch"
"python-2.7-source-date-epoch.patch"))
(modules '((guix build utils)))
;; suboptimal to delete failing tests here, but if we delete them in the
- 42/43: python-nautilus: Correct inouts, (continued)
- 42/43: python-nautilus: Correct inouts, Hartmut Goebel, 2016/10/18
- 28/43: python-wsgi-intercept: Correct inputs., Hartmut Goebel, 2016/10/18
- 38/43: python-prompt-toolkit: Correct inputs, Hartmut Goebel, 2016/10/18
- 29/43: CLEAN: python-sphinxcontrib-newsfeed REmove needlass input, Hartmut Goebel, 2016/10/18
- 08/43: python-blinker: No longer disable tests., Hartmut Goebel, 2016/10/18
- 39/43: python-consul correct inputs, Hartmut Goebel, 2016/10/18
- 04/43: python-oauthlib: Correct inputs. REWORD, Hartmut Goebel, 2016/10/18
- 06/43: gnu: python-joblib: Add comment., Hartmut Goebel, 2016/10/18
- 12/43: gnu: python2-scikit-image: Remove needless inputs. 2 REWORD, Hartmut Goebel, 2016/10/18
- 22/43: TODO: Remove .pyc, Hartmut Goebel, 2016/10/18
- 43/43: gnu: python-2.7: Add all guix prefixes in PYTHONPATH to site-prefixes.,
Hartmut Goebel <=
- 09/43: FIXUP oauthlib, Hartmut Goebel, 2016/10/18
- 30/43: python-urllib3: update comment, Hartmut Goebel, 2016/10/18
- 36/43: python-responses: Correct inputs, Hartmut Goebel, 2016/10/18
- 37/43: python-pika: Correct input, Hartmut Goebel, 2016/10/18
- 16/43: python-rst.linker, python2-rst.linker MOVE REWORD, Hartmut Goebel, 2016/10/18
- 25/43: python-configobj: Correct inputs., Hartmut Goebel, 2016/10/18
- 14/43: gnu: python-numpydoc: Correct inputs., Hartmut Goebel, 2016/10/18