about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2026-03-31 16:17:53 +0300
committerMunyoki Kilyungi2026-05-15 18:17:02 +0300
commitf4e82c0d6cb0dcee86d7ad2ba8d9af5a17ae0620 (patch)
tree089f6e8b742ac39804a818cc6a6119621f93aab0
parent251f080599f67544cc16dc7ddeafc7cee94a7a5c (diff)
downloadgn-machines-f4e82c0d6cb0dcee86d7ad2ba8d9af5a17ae0620.tar.gz
Add gn-libs to PYTHONPATH.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rw-r--r--genenetwork-development.scm28
1 files changed, 20 insertions, 8 deletions
diff --git a/genenetwork-development.scm b/genenetwork-development.scm
index f7098d1..67e39a9 100644
--- a/genenetwork-development.scm
+++ b/genenetwork-development.scm
@@ -529,6 +529,7 @@ server described by CONFIG, a <genenetwork-configuration> object."
                                           (getenv "GN2_PROFILE")
                                           "/etc/ssl/certs/ca-certificates.crt"))
 	    (setenv "PYTHONPATH" (string-append
+				  "/home/genenetwork/gn-libs:"
 				  (getenv "GN3_PYTHONPATH")
 				  ":"
 				  (string-append
@@ -580,7 +581,7 @@ server described by CONFIG, a <genenetwork-configuration> object."
   "Return a G-expression that runs the latest genenetwork3 development
 server described by CONFIG, a <genenetwork-configuration> object."
   (match-record config <genenetwork-configuration>
-    (gn3-repository gn3-port gn3-secrets sparql-endpoint data-directory xapian-db-path auth-db-path llm-db-path lmdb-data-path)
+    (gn3-repository gn3-port gn3-secrets sparql-endpoint data-directory xapian-db-path auth-db-path llm-db-path lmdb-data-path gn-libs-repository)
     (with-manifest (package->development-manifest genenetwork3)
       (with-packages (list git-minimal nss-certs)
         (with-imported-modules '((guix build utils))
@@ -625,10 +626,13 @@ server described by CONFIG, a <genenetwork-configuration> object."
 	      (with-directory-excursion
 	       "/home/genenetwork"
 	       ;; Clone the latest genenetwork3 repository.
-	       (when (file-exists? "/home/genenetwork/genenetwork3")
-		 (delete-file-recursively "/home/genenetwork/genenetwork3"))
-	       (invoke "git" "clone" "--depth" "1" #$gn3-repository))
-
+	       (when (file-exists? "genenetwork3")
+		 (delete-file-recursively "genenetwork3"))
+	       (invoke "git" "clone" "--depth" "1" #$gn3-repository)
+	       (when (file-exists? "gn-libs")
+		 (delete-file-recursively "gn-libs"))
+	       (invoke "git" "clone" "--depth" "1" #$gn-libs-repository))
+	      (setenv "PYTHONPATH" "/home/genenetwork/gn-libs:$PYTHONPATH")
 	      (with-directory-excursion
 	       "/home/genenetwork/genenetwork3"
 	       (show-head-commit)
@@ -646,7 +650,7 @@ server described by CONFIG, a <genenetwork-configuration> object."
   "Return a G-expression that runs the latest gn-auth development
 server described by CONFIG, a <genenetwork-configuration> object."
   (match-record config <genenetwork-configuration>
-    (gn-auth-repository gn-auth-port auth-db-path gn-auth-secrets)
+    (gn-auth-repository gn-libs-repository gn-auth-port auth-db-path gn-auth-secrets)
     (with-manifest (package->development-manifest gn-auth)
       (with-packages (list git-minimal nss-certs)
         (with-imported-modules '((guix build utils))
@@ -672,7 +676,10 @@ server described by CONFIG, a <genenetwork-configuration> object."
 	       ;; Clone the latest gn-auth repository.
 	       (when (file-exists? "/home/genenetwork/gn-auth")
 		 (delete-file-recursively "/home/genenetwork/gn-auth"))
-               (invoke "git" "clone" "--depth" "1" #$gn-auth-repository))
+               (invoke "git" "clone" "--depth" "1" #$gn-auth-repository)
+	       (when (file-exists? "/home/genenetwork/gn-libs")
+		 (delete-file-recursively "/home/genenetwork/gn-libs"))
+	       (invoke "git" "clone" "--depth" "1" #$gn-libs-repository))
 
               ;; Configure gn-auth.
               (setenv "GN_AUTH_PROFILE" #$(profile
@@ -681,7 +688,12 @@ server described by CONFIG, a <genenetwork-configuration> object."
               (setenv "REQUESTS_CA_BUNDLE" (string-append
                                             (getenv "GN_AUTH_PROFILE")
                                             "/etc/ssl/certs/ca-certificates.crt"))
-
+	      (setenv "PYTHONPATH" (string-append
+				    "/home/genenetwork/gn-libs:"
+				    (string-append
+				     (getenv "GN_AUTH_PROFILE")
+				     ":"
+				     "/lib/python3.11/site-packages")))
               (setenv "GN_AUTH_CONF"
                       #$(mixed-text-file "gn-auth.conf"
                                          "AUTH_DB=\"" auth-db-path "\"\n"