[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/104: gnu: python-2.7: Add all guix prefixes in PYTHONPATH to site-pre
From: |
Hartmut Goebel |
Subject: |
09/104: gnu: python-2.7: Add all guix prefixes in PYTHONPATH to site-prefixes. |
Date: |
Tue, 15 Nov 2016 21:36:59 +0000 (UTC) |
htgoebel pushed a commit to branch python-build-system
in repository guix.
commit 15e57f576291d9233ab25e1614c6218579db170a
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 08f99c4..5142f51 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -803,6 +803,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 b6aeb8c..ca40fe8 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -122,6 +122,7 @@
"0y7rl603vmwlxm6ilkhc51rx2mfj14ckcz40xxgs0ljnvlhp30yp"))
(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
- 01/104: guix: python-build-system: Fix an outdated comment., (continued)
- 01/104: guix: python-build-system: Fix an outdated comment., Hartmut Goebel, 2016/11/15
- 04/104: guix: python-build-system: Import setuptools before calling `setup.py'., Hartmut Goebel, 2016/11/15
- 06/104: guix: python-build-system: Add helpers for getting and setting PYTHONPATH., Hartmut Goebel, 2016/11/15
- 02/104: gnu: ensure pip and setuptools are installed even for Python 2., Hartmut Goebel, 2016/11/15
- 07/104: guix: python-build-system: Delete .egg-info file created in phase check., Hartmut Goebel, 2016/11/15
- 05/104: guix: python-build-system: Add option "#:use-setuptools?" (default true)., Hartmut Goebel, 2016/11/15
- 03/104: guix: build all Python packages with --single-version-externally-managed., Hartmut Goebel, 2016/11/15
- 11/104: lint: more packages to probably be a native input., Hartmut Goebel, 2016/11/15
- 18/104: gnu: Remove needless inputs python-pip and python2-pip., Hartmut Goebel, 2016/11/15
- 08/104: guix: python-build-system: Add background about Python installation methods., Hartmut Goebel, 2016/11/15
- 09/104: gnu: python-2.7: Add all guix prefixes in PYTHONPATH to site-prefixes.,
Hartmut Goebel <=
- 22/104: gnu: Fix python inputs, part 3: all native-inputs become propagated-inputs., Hartmut Goebel, 2016/11/15
- 15/104: gnu: Remove python-setuptools and python2-setuptools from inputs (part 3), Hartmut Goebel, 2016/11/15
- 10/104: guix: Add lint-checker for packages which should be no inputs at all., Hartmut Goebel, 2016/11/15
- 29/104: gnu: python-ccm: Add missing input python-psutil., Hartmut Goebel, 2016/11/15
- 27/104: gnu: python-pytest-cov: Use upstream options for testing., Hartmut Goebel, 2016/11/15
- 21/104: gnu: Fix python inputs, part 2: all inputs become native-inputs., Hartmut Goebel, 2016/11/15
- 33/104: gnu: python-fixture: Correct inputs., Hartmut Goebel, 2016/11/15
- 26/104: gnu: scons: Do not use setuptools for building., Hartmut Goebel, 2016/11/15
- 30/104: gnu: python-ccm: Update synopsis and description., Hartmut Goebel, 2016/11/15
- 25/104: gnu: Fix python inputs, part 7: Ensure python-cython is a native-input., Hartmut Goebel, 2016/11/15