diff mbox series

[bug#39396,v2,2/2] gnu: Add grip.

Message ID 20200202225157.ncrok6nfrp2dgwhz@gravity
State Accepted
Headers show
Series [bug#39396] gnu: Add grip. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Maja Kądziołka Feb. 2, 2020, 10:51 p.m. UTC
* gnu/packages/python-web.scm (grip): New variable.
---
 gnu/packages/python-web.scm | 49 +++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

Comments

Efraim Flashner Feb. 4, 2020, 10:13 a.m. UTC | #1
I re-ordered the native-inputs so they'd be alphabetical and I changed
the custom 'check phase to replace the stock 'check phase. It's been a
while now that in the python-build-system the 'check phase comes after
the 'install phase.

Patches pushed. Thanks!
diff mbox series

Patch

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 3e5253489b..35c168948c 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -3527,3 +3527,52 @@  with GitLab instances through their API.")
     (description "Path-and-address resolves ambiguities of command-line
 interfaces, inferring which argument is the path, and which is the address.")
     (license license:expat)))
+
+(define-public grip
+  ;; No release by upstream for quite some time, some bugs fixed since. See:
+  ;; https://github.com/joeyespo/grip/issues/304
+  (let ((commit "27a4d6d87ea1d0ea7f7f120de55baabee3de73e3"))
+    (package
+      (name "grip")
+      (version (git-version "4.5.2" "1" commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/joeyespo/grip")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "0kx5hgb3q19i4l18a4vqdq9af390xgpk88lp2ay75qi96k0dc68w"))))
+      (build-system python-build-system)
+      (propagated-inputs
+       `(("python-docopt" ,python-docopt)
+         ("python-flask" ,python-flask)
+         ("python-markdown" ,python-markdown)
+         ("python-path-and-address" ,python-path-and-address)
+         ("python-pygments" ,python-pygments)
+         ("python-requests" ,python-requests)))
+      (native-inputs
+       `(("python-responses" ,python-responses)
+         ("python-pytest" ,python-pytest)))
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           ;; Run 'check after 'install so that the grip binary is available.
+           (delete 'check)
+           (add-after 'install 'check
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (add-installed-pythonpath inputs outputs)
+               (setenv "PATH" (string-append
+                                (getenv "PATH") ":"
+                                (assoc-ref %outputs "out") "/bin"))
+               (invoke "py.test" "-m" "not assumption"))))))
+      (home-page "https://github.com/joeyespo/grip")
+      (synopsis "Preview Markdown files using the GitHub API")
+      (description "Grip is a command-line server application written in Python
+that uses the GitHub Markdown API to render a local Markdown file.  The styles
+and rendering come directly from GitHub, so you'll know exactly how it will
+appear.  Changes you make to the file will be instantly reflected in the browser
+without requiring a page refresh.")
+      (license license:expat))))