[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
100/163: gnu: patchwork: Wrap with the new Guix PYTHONPATH.
From: |
guix-commits |
Subject: |
100/163: gnu: patchwork: Wrap with the new Guix PYTHONPATH. |
Date: |
Mon, 25 Jan 2021 02:01:43 -0500 (EST) |
apteryx pushed a commit to branch cu/farewell-to-pythonpath
in repository guix.
commit b36dcea1aa7092c13178a854c6095e064a2b5c77
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Sat Jan 23 23:40:21 2021 -0500
gnu: patchwork: Wrap with the new Guix PYTHONPATH.
* gnu/packages/patchutils.scm (patchwork)[phases]: Remove trailing #t.
{replace-wsgi.py}: Wrap with the new Guix PYTHONPATH.
---
gnu/packages/patchutils.scm | 38 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 22 deletions(-)
diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm
index 1354c86..778ac03 100644
--- a/gnu/packages/patchutils.scm
+++ b/gnu/packages/patchutils.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2015, 2018 Leo Famulari <leo@famulari.name>
;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -341,21 +342,18 @@ you to figure out what is going on in that merge you keep
avoiding.")
(delete 'build)
(add-after 'unpack 'replace-wsgi.py
(lambda* (#:key inputs outputs #:allow-other-keys)
- (delete-file "patchwork/wsgi.py")
- (call-with-output-file "patchwork/wsgi.py"
- (lambda (port)
- ;; Embed the PYTHONPATH containing the dependencies, as well
- ;; as the python modules in this package in the wsgi.py file,
- ;; as this will ensure they are available at runtime.
- (define pythonpath
- (string-append (getenv "PYTHONPATH")
- ":"
- (site-packages inputs outputs)))
- (display
- (string-append "
+ ;; Embed the PYTHONPATH containing the dependencies, as well
+ ;; as the python modules in this package in the wsgi.py file,
+ ;; as this will ensure they are available at runtime.
+ (let ((pythonpath (guix-pythonpath inputs)))
+ (delete-file "patchwork/wsgi.py")
+ (call-with-output-file "patchwork/wsgi.py"
+ (lambda (port)
+ (display
+ (string-append "
import os, sys
-sys.path.extend('" pythonpath "'.split(':'))
+sys.path.extend('" (getenv pythonpath) "'.split(':'))
from django.core.wsgi import get_wsgi_application
@@ -369,13 +367,12 @@ os.environ['DJANGO_SETTINGS_MODULE'] = os.getenv(
'guix.patchwork.settings' # default
)
-application = get_wsgi_application()\n") port)))))
+application = get_wsgi_application()\n") port))))))
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(setenv "DJANGO_SETTINGS_MODULE" "patchwork.settings.dev")
- (invoke "python" "-Wonce" "./manage.py" "test" "--noinput"))
- #t))
+ (invoke "python" "-Wonce" "./manage.py" "test" "--noinput"))))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
@@ -422,8 +419,7 @@ application = get_wsgi_application()\n") port)))))
;; may be useful when deploying patchwork.
(copy-recursively "lib"
(string-append
- out "/share/doc/" ,name "-" ,version)))
- #t))
+ out "/share/doc/" ,name "-" ,version)))))
;; The hasher script is used from the post-receive.hook
(add-after 'install 'install-hasher
(lambda* (#:key inputs outputs #:allow-other-keys)
@@ -432,8 +428,7 @@ application = get_wsgi_application()\n") port)))))
(out-hasher.py (string-append out-site-packages
"/patchwork/hasher.py")))
(chmod out-hasher.py #o555)
- (symlink out-hasher.py (string-append out "/bin/hasher")))
- #t))
+ (symlink out-hasher.py (string-append out "/bin/hasher")))))
;; Create a patchwork specific version of Django's command line admin
;; utility.
(add-after 'install 'install-patchwork-admin
@@ -449,8 +444,7 @@ if __name__ == \"__main__\":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)" (which "python"))))
- (chmod (string-append out "/bin/patchwork-admin") #o555))
- #t)))))
+ (chmod (string-append out "/bin/patchwork-admin") #o555)))))))
(inputs
`(("python-wrapper" ,python-wrapper)))
(propagated-inputs
- 42/163: gnu: tensorflow: Do not alter PYTHONPATH., (continued)
- 42/163: gnu: tensorflow: Do not alter PYTHONPATH., guix-commits, 2021/01/25
- 45/163: gnu: liferea: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 68/163: gnu: graphite2: Do not alter PYTHONPATH., guix-commits, 2021/01/25
- 63/163: gnu: python-django-url-filter: Do not alter PYTHONPATH., guix-commits, 2021/01/25
- 73/163: gnu: itstool: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 86/163: gnu: mpdris2: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 94/163: gnu: python-pure-protobuf: Do not alter PYTHONPATH., guix-commits, 2021/01/25
- 113/163: gnu: authenticator: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 108/163: gnu: eolie: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 92/163: gnu: fenics: Do not alter PYTHONPATH., guix-commits, 2021/01/25
- 100/163: gnu: patchwork: Wrap with the new Guix PYTHONPATH.,
guix-commits <=
- 125/163: gnu: python-pymediainfo: Do not set PYTHONPATH., guix-commits, 2021/01/25
- 120/163: gnu: python-attrs: Do not set PYTHONPATH., guix-commits, 2021/01/25
- 132/163: gnu: python-jinja2: Do not set PYTHONPATH., guix-commits, 2021/01/25
- 06/163: build/python: Add the installation bin directory to PATH., guix-commits, 2021/01/25
- 13/163: gnu: carla: Adjust wrap phase., guix-commits, 2021/01/25
- 16/163: gnu: python-pysam: Adjust following Python build system changes., guix-commits, 2021/01/25
- 38/163: gnu: git-imerge: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 36/163: gnu: cgit: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 50/163: gnu: econnman: Wrap with the new Guix PYTHONPATH., guix-commits, 2021/01/25
- 32/163: gnu: behave: Do not set PYTHONPATH., guix-commits, 2021/01/25