about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-07-07 14:33:54 +0300
committerFrederick Muriuki Muriithi2022-07-07 14:33:54 +0300
commita21e759ac7a6b72a3d02814c2bfb26bc4f49204c (patch)
tree98bd67d0dbbe49fe012ad3cb7a1ef146c2dbfa27
parent665dd38d6be4587d1902c46dd8e3663cf42a5a18 (diff)
downloadgn-uploader-a21e759ac7a6b72a3d02814c2bfb26bc4f49204c.tar.gz
Rework guix.scm to use latest commit
Rather than specifying a specific commit in the development guix.scm
this commit has the system automatically get the latest commit and use
that for building the package object.
-rw-r--r--README.org2
-rw-r--r--guix.scm84
-rw-r--r--manifest.scm12
3 files changed, 50 insertions, 48 deletions
diff --git a/README.org b/README.org
index 5ec53f0..5e5e0a9 100644
--- a/README.org
+++ b/README.org
@@ -31,7 +31,7 @@ For reproducibility, this project is developed using guix.
 
 To launch a guix shell for development, do
 #+BEGIN_SRC shell
-  guix shell --container --network --pure --manifest=manifest.scm --share=/some/host/directory=/the/upload/directory
+  guix shell --container --network --development --file=guix.scm --share=/some/host/directory=/the/upload/directory
 #+END_SRC
 which environment that is isolated from the rest of your system.
 
diff --git a/guix.scm b/guix.scm
index 0c78fc1..2db6063 100644
--- a/guix.scm
+++ b/guix.scm
@@ -1,4 +1,9 @@
-(use-modules (guix packages)
+(use-modules (git oid)
+	     (guix gexp)
+	     (git bindings)
+	     (git reference)
+	     (git repository)
+	     (guix packages)
 	     (guix git-download)
 	     (gnu packages check)
 	     (gnu packages databases)
@@ -8,38 +13,47 @@
 	     (gnu packages python-check)
 	     ((guix licenses) #:prefix license:))
 
-(let ((commit "4808ae57ac83ef00e679c94fe6844c72f18735b9")
-      (revision "2"))
-  (package
-    (name "genenetwork-qc")
-    (version (git-version "0.0.1" revision commit))
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-	     (url "https://git.genenetwork.org/fredmanglis/gnqc_py.git")
-	     (commit commit)))
-       (sha256
-	(base32
-	 "14lbdbkqa5aiwldafirgqsfcydbqqbhz30vrf80afxj9sqxcscd9"))))
-    (build-system python-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-	 (replace 'check
-	   (lambda* (#:key tests? #:allow-other-keys)
-	     (when tests?
-	       (invoke "pytest")))))))
-    (inputs
-     (list python-mypy
-	   python-pylint
-	   python-pytest
-	   python-hypothesis))
-    (propagated-inputs
-     (list redis))
-    (synopsis "GeneNetwork Quality Control Application")
-    (description
-     "GeneNetwork qc is a quality control application for the data files that
+(define %source-dir (dirname (current-filename)))
+
+(libgit2-init!)
+(define gnqc-py
+  (let ((commit (oid->string
+		 (reference-target
+		  (repository-head (repository-open %source-dir)))))
+	(revision "3"))
+    (package
+      (name "genenetwork-qc")
+      (version (git-version "0.0.1" revision commit))
+      (source (local-file %source-dir
+			  "gnqc_py-checkout"
+			  #:recursive? #t
+			  #:select? (git-predicate %source-dir)))
+      (build-system python-build-system)
+      (arguments
+       `(#:phases
+	 (modify-phases %standard-phases
+	   (replace 'check
+	     (lambda* (#:key tests? #:allow-other-keys)
+	       (when tests?
+		 (invoke "pytest")))))))
+      (inputs
+       (list python-mypy
+	     python-pylint
+	     python-pytest
+	     python-hypothesis))
+      (propagated-inputs
+       (list redis
+	     python-redis
+	     python-flask
+	     python-jsonpickle
+	     python-mysqlclient))
+      (synopsis "GeneNetwork Quality Control Application")
+      (description
+       "GeneNetwork qc is a quality control application for the data files that
  eventually are used to add to the data in the GeneNetwork project.")
-    (home-page "https://git.genenetwork.org/fredmanglis/gnqc_py")
-    (license license:agpl3+)))
+      (home-page "https://git.genenetwork.org/fredmanglis/gnqc_py")
+      (license license:agpl3+))))
+
+(libgit2-shutdown!)
+
+gnqc-py
diff --git a/manifest.scm b/manifest.scm
deleted file mode 100644
index d18be5b..0000000
--- a/manifest.scm
+++ /dev/null
@@ -1,12 +0,0 @@
-(specifications->manifest
- (list "redis"
-       "python"
-       "python-mypy"
-       "python-redis"
-       "python-flask"
-       "python-magic"
-       "python-pylint"
-       "python-pytest"
-       "python-hypothesis"
-       "python-jsonpickle"
-       "python-mysqlclient"))