guix-patches
[Top][All Lists]
Advanced

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

[bug#58310] [PATCH 01/14] gnu: Add python-pprintpp.


From: Garek Dyszel
Subject: [bug#58310] [PATCH 01/14] gnu: Add python-pprintpp.
Date: Wed, 05 Oct 2022 13:40:16 -0400

* gnu/packages/python-xyz.scm (python-pprintpp): New variable.
---
 gnu/packages/python-xyz.scm | 54 +++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8575d4a67e..439765dc4f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16688,6 +16688,60 @@ (define-public python-tabulate
 data in Python.")
     (license license:expat)))
 
+(define-public python-pprintpp
+  ;; Git version tags are inaccurate for this package; use the
+  ;; bare commit.
+  (let ((commit "7ede6da1f3062bbfb32ee04353d675a5bff185e0")
+        (revision "1"))
+    (package
+      (name "python-pprintpp")
+      (version (git-version "0.3.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/wolever/pprintpp";)
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0nk935m3ig8sc32laqbh698vwpk037yw27gd3nvwwzdv42jal2li"))))
+      (inputs (list python-pypa-build python-hypothesis python-wheel
+                    python-parameterized))
+      (native-inputs (list python-pytest python-nose))
+      (build-system python-build-system)
+      (arguments
+       (list #:phases #~(modify-phases %standard-phases
+                          (replace 'build
+                            (lambda _
+                              (setenv "SOURCE_DATE_EPOCH" "315532800")
+                              (invoke "python"
+                                      "-m"
+                                      "build"
+                                      "--wheel"
+                                      "--no-isolation"
+                                      ".")))
+                          (replace 'install
+                            (lambda* (#:key outputs #:allow-other-keys)
+                              (let ((whl (car (find-files "dist" "\\.whl$"))))
+                                (invoke "pip"
+                                        "--no-cache-dir"
+                                        "--no-input"
+                                        "install"
+                                        "--no-deps"
+                                        "--prefix"
+                                        #$output
+                                        whl))))
+                          (replace 'check
+                            (lambda* (#:key tests? #:allow-other-keys)
+                              (when tests?
+                                (invoke "python" "test.py")))))))
+      (home-page "https://github.com/wolever/pprintpp";)
+      (synopsis "Python pretty-printer")
+      (description
+       "This package is a printer for Python which pretty-prints structures.
+It also attempts to print Unicode characters without escaping them.")
+      (license license:bsd-3))))
+
 (define-public python-kazoo
   (package
     (name "python-kazoo")

base-commit: fd6cd9de8682c7ddf96bf8deb637b1ca6cdbd205
-- 
2.37.3







reply via email to

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