guix-patches
[Top][All Lists]
Advanced

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

[bug#57540] [RFC PATCH v2 13/19] gnu: Add python-pprintpp.* gnu/packages


From: Garek Dyszel
Subject: [bug#57540] [RFC PATCH v2 13/19] gnu: Add python-pprintpp.* gnu/packages/python-xyz.scm (python-pprintpp): New variable.
Date: Wed, 07 Sep 2022 14:34:19 -0400

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2c358b8c58..90bf269341 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -30963,3 +30963,61 @@ (define-public python-hatch-fancy-pypi-readme
     (description "Fancy PyPI READMEs with Hatch")
     ;; MIT License
     (license license:expat)))
+
+(define-public python-pprintpp
+  ;; Git version tags are inaccurate for this package, too; 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 python-pypa-build python-hypothesis python-wheel
+                    python-parameterized))
+      (native-inputs (list python-pytest python-nose))
+      (build-system python-build-system)
+      (arguments
+       ;; Copied directly from the build process for
+       ;; python-jsonschema-next.
+       (substitute-keyword-arguments (package-arguments python-jsonschema)
+         ((#:phases phases)
+          #~(modify-phases #$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 "Drop-in replacement for pprint that's actually pretty")
+      (description
+       "This package provides a drop-in replacement for pprint that's actually 
pretty.")
+      (license license:bsd-3))))
-- 
2.37.2







reply via email to

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