aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2025-04-16 20:28:26 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-04-16 20:34:13 +0100
commit6f6e795316546894beaa5898298177df5988ec09 (patch)
tree043ef4ac0088204a1f4d8430fb45ba6a39a86524
parent6dd0d0fd9074b0afe83df5b9708a35cf4e222e18 (diff)
downloadguix-6f6e795316546894beaa5898298177df5988ec09.tar.gz
guix-6f6e795316546894beaa5898298177df5988ec09.zip
gnu: grip: Fix build.
* gnu/packages/python-web.scm (grip): Fix build and refresh package style. [build-system]: Switch to pyproject. [arguments] <test-flags>: Ignore all tests requiring networking. <phases>: Add 'fix-response-encoding; use default 'check. [native-inputs]: Add python-setuptools, and python-wheel. [description]: Fix fill column indentation. Change-Id: I131ab5efa965760f05411c7dbdb2349d9e8cbcc3
-rw-r--r--gnu/packages/python-web.scm77
1 files changed, 45 insertions, 32 deletions
diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index e05ac25563..8fe9f58978 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -7771,46 +7771,59 @@ with GitLab instances through their API.")
interfaces, inferring which argument is the path, and which is the address.")
(license license:expat)))
+;; XXX: This project missed maintainer upstream, see
+;; <https://github.com/joeyespo/grip/issues/387>.
+;; Consider to remove if it keeps failing to build.
(define-public grip
(package
(name "grip")
(version "4.6.1")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/joeyespo/grip")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "0vhimd99zw7s1fihwr6yfij6ywahv9gdrfcf5qljvzh75mvzcwh8"))))
- (build-system python-build-system)
- (propagated-inputs (list python-docopt
- python-flask
- python-markdown
- python-path-and-address
- python-pygments
- python-requests))
- (native-inputs (list python-pytest python-responses))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/joeyespo/grip")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0vhimd99zw7s1fihwr6yfij6ywahv9gdrfcf5qljvzh75mvzcwh8"))))
+ (build-system pyproject-build-system)
(arguments
- (list #:phases
- #~(modify-phases %standard-phases
- (replace 'check
- (lambda* (#:key inputs outputs tests? #:allow-other-keys)
- (when tests?
- (add-installed-pythonpath inputs outputs)
- (setenv "PATH"
- (string-append (getenv "PATH") ":"
- #$output "/bin"))
- (invoke "py.test" "-m" "not assumption")))))))
+ (list
+ #:test-flags
+ ;; All tests fail requiring network access, ignore the whole file.
+ #~(list "--ignore=tests/test_github.py")
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; This fixes the removal of `charset` attribute of requests from
+ ;; Werkzeug 2.3.0.
+ ;; Fixed in grip's commit <2784eb2c1515f1cdb1554d049d48b3bff0f42085>.
+ (add-after 'unpack 'fix-response-encoding
+ (lambda _
+ (substitute* "grip/app.py"
+ (("response.charset")
+ "getattr(response, 'charset', 'utf-8')")))))))
+ (native-inputs
+ (list nss-certs-for-test
+ python-pytest
+ python-responses
+ python-setuptools
+ python-wheel))
+ (propagated-inputs
+ (list python-docopt
+ python-flask
+ python-markdown
+ python-path-and-address
+ python-pygments
+ python-requests))
(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.")
+ "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)))
(define-public python-port-for