diff mbox series

[bug#64869,2/2] gnu: Add python-pipx.

Message ID ce0bdf79a0aa89760d2e7590a3a9702a51ddec31.1690360848.git.koszko@koszko.org
State New
Headers show
Series Add pipx package manager for Python applications | expand

Commit Message

Wojtek Kosior July 26, 2023, 9:09 a.m. UTC
* gnu/packages/python-xyz.scm (python-pipx): New variable.
---
 gnu/packages/python-xyz.scm | 38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 022d26694c..c7f2bb4a4e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5262,6 +5262,44 @@  (define-public python-userpath
 This tool is unfortunately not compatible with {guix home}.")
     (license license:expat)))
 
+(define-public python-pipx
+  (package
+    (name "python-pipx")
+    (version "1.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/pypa/pipx")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "112vmvd5h7gmpr8flar4848h6gm0i2s52s8xa5dbiffdr7xx0vwn"))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:tests? #f ;tests require a bunch of wheels from the network
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((doc (string-append (assoc-ref outputs "out") "/share/doc")))
+               (mkdir-p doc)
+               (for-each (lambda (file)
+                           (copy-file (string-append "." file)
+                                      (string-append doc file)))
+                         '("/CHANGELOG.md" "/LICENSE"))))))))
+    (native-inputs (list python-hatchling))
+    (propagated-inputs (list python-argcomplete
+                             python-packaging
+                             python-userpath))
+    (home-page "https://pypa.github.io/pipx/")
+    (synopsis "Install and run python applications in isolated environments")
+    (description
+     "@code{pipx} is a tool to help you install and run end-user applications
+written in Python.  It's roughly similar to JavaScript's @code{npx}, and
+Trisquel's @code{apt}.")
+    (license license:expat)))
+
 (define-public python-uc-micro-py
   (package
     (name "python-uc-micro-py")