guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: python-lambda-4dn: Fix pip install.


From: guix-commits
Subject: branch master updated: gnu: python-lambda-4dn: Fix pip install.
Date: Thu, 07 Mar 2024 17:41:20 -0500

This is an automated email from the git hooks/post-receive script.

rekado pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 0b5cbca689 gnu: python-lambda-4dn: Fix pip install.
0b5cbca689 is described below

commit 0b5cbca689b2f91949e191ca256ffc9bb48c1141
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Thu Mar 7 23:37:20 2024 +0100

    gnu: python-lambda-4dn: Fix pip install.
    
    * gnu/packages/web.scm (python-lambda-4dn)[arguments]: Add phase
    'fix-pip-install.
    [propagated-inputs]: Add python-virtualenv.
    
    Change-Id: I3722a9dd2b017d4db5ced7ac9c65603cfa98744d
---
 gnu/packages/web.scm | 37 ++++++++++++++++++++++++++++++++++---
 1 file changed, 34 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 75edf7b152..e519552a36 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2013 Aljosha Papsch <misc@rpapsch.de>
 ;;; Copyright © 2014-2024 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2015-2023 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2015-2024 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2018 Raoul Jean Pierre Bonnal <ilpuccio.febo@gmail.com>
 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Eric Bavier 
<bavier@posteo.net>
@@ -4893,9 +4893,40 @@ their web site.")
                 "1p5i8wsi8q5fpq63i7n7ri1w1lnh4gpn17f88vhkbh14aah5wxj1"))))
     (properties '(("upstream-name" . "python-lambda-4dn")))
     (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-pip-install
+            (lambda _
+              (substitute* "aws_lambda/aws_lambda.py"
+                ;; This package uses pip to install Python packages, wrap them
+                ;; up, and push them to AWS Lambda.  We need to reset
+                ;; GUIX_PYTHONPATH to avoid introducing package conflicts that
+                ;; would cause pip to fail.
+                
(("(subprocess.call\\(\\[sys.executable.*'--no-cache-dir'\\])\\)" _ m)
+                 (string-append m ", env={\"GUIX_PYTHONPATH\":\""
+                                #$(this-package-input "python")
+                                "/lib/python"
+                                #$(version-major+minor
+                                   (package-version (this-package-input 
"python")))
+                                "/site-packages/\"})"))
+                ;; Zipfile uses the mtime of the temporary directory to build
+                ;; a zip file.  But the temp directory has a timestamp of 0,
+                ;; and zipfile refuses to build a zip archive dated before
+                ;; 1980.  So we reset the mtime of all temp files before they
+                ;; are added to the zip archive.
+                (("^( +)arcname = os.path.join" line indent)
+                 (string-append indent
+                                "os.utime(os.path.join(root, file), 
(315619200, 315619200))\n"
+                                line))))))))
+    (inputs (list python))
     (propagated-inputs
-     (list python-boto3 python-botocore python-docutils
-           python-six))
+     (list python-boto3
+           python-botocore
+           python-docutils
+           python-six
+           python-virtualenv))
     (home-page "https://github.com/4dn-dcic/python-lambda";)
     (synopsis
      "Toolkit for developing and deploying Python code in AWS Lambda")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]