[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/57: guix: python-build-system: Import setuptools before calling `setu
From: |
Hartmut Goebel |
Subject: |
03/57: guix: python-build-system: Import setuptools before calling `setup.py'. |
Date: |
Thu, 13 Oct 2016 15:20:31 +0000 (UTC) |
htgoebel pushed a commit to branch wip-python-build-system
in repository guix.
commit 746ab8080e688cd063228ff4e865d2ad4f901795
Author: Marius Bakke <address@hidden>
Date: Thu Sep 29 18:41:35 2016 +0100
guix: python-build-system: Import setuptools before calling `setup.py'.
This is needed for packages using "distutils" instead of "setuptools" since
the former does not understand the "--single-version-externally-managed"
flag. Also export __file__ since it will be unset when setup.py is called
from
python "exec".
* guix/build/python-build-system.scm (call-setuppy): extend "python
setup.py"
call to import setuptools, export __file__, and call setup.py from
setuptools python environment.
Co-Authored-By: Hartmut Goebel <address@hidden>
---
guix/build/python-build-system.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/guix/build/python-build-system.scm
b/guix/build/python-build-system.scm
index d07b83f..f16abad 100644
--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -36,13 +36,23 @@
;;
;; Code:
+(define setuptools-shim
+ ;; Run setup.py with "setuptools" being imported, which will patch
+ ;; "distutils". This is needed for packages using "distutils" instead of
+ ;; "setuptools" since the former does not understand the
+ ;; "--single-version-externally-managed" flag.
+ ;; Python code taken from pip 8.1.2 pip/utils/setuptools_build.py
+ (string-append
+ "import setuptools, tokenize;__file__='setup.py';"
+ "exec(compile(getattr(tokenize, 'open', open)(__file__).read()"
+ ".replace('\\r\\n', '\\n'), __file__, 'exec'))"))
(define (call-setuppy command params)
(if (file-exists? "setup.py")
(begin
(format #t "running \"python setup.py\" with command ~s and
parameters ~s~%"
command params)
- (zero? (apply system* "python" "setup.py" command params)))
+ (zero? (apply system* "python" "-c" setuptools-shim command params)))
(error "no setup.py found")))
(define* (build #:rest empty)
- 24/57: gnu: python-sphinx-rtd-theme: Remove inputs., (continued)
- 24/57: gnu: python-sphinx-rtd-theme: Remove inputs., Hartmut Goebel, 2016/10/13
- 26/57: make native-inputs: simple ones: one nose, docuitls, phinx, tests, …, Hartmut Goebel, 2016/10/13
- 37/57: gnu: python-pillow: Fix build., Hartmut Goebel, 2016/10/13
- 40/57: gnu: python-zope-testing: Remove needless input., Hartmut Goebel, 2016/10/13
- 43/57: gnu: python-numpy-bootstrap, python-numpy: Fix build., Hartmut Goebel, 2016/10/13
- 49/57: gnu: openstack: Correct inputs., Hartmut Goebel, 2016/10/13
- 35/57: gnu: python-pbr: Rework bootstrapping., Hartmut Goebel, 2016/10/13
- 44/57: gnu: python-matplotlib: Fix build., Hartmut Goebel, 2016/10/13
- 42/57: gnu: python-fonttools: Remove intervening directory in site-packges., Hartmut Goebel, 2016/10/13
- 48/57: gnu: thefuck: Fix build., Hartmut Goebel, 2016/10/13
- 03/57: guix: python-build-system: Import setuptools before calling `setup.py'.,
Hartmut Goebel <=