Subject: [PATCH 1/2] gnu: Add python-userpath.

From: Wojtek Kosior <[email-masked]>
Date: Wed, 26 Jul 2023 11:09:01 +0200

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index db3e69fb45..022d26694c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -139,6 +139,7 @@
 ;;; Copyright © 2023 Dominik Delgado Steuter <[email-masked]>
 ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <[email-masked]>
 ;;; Copyright © 2023 Ontje Lünsdorf <[email-masked]>
+;;; Copyright © 2023 Wojtek Kosior <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -5223,6 +5224,44 @@ (define-public python-virtualenv-clone
      "Clone non-relocatable virtualenvs without breaking site-packages.")
     (license license:expat)))
 
+(define-public python-userpath
+  (package
+    (name "python-userpath")
+    (version "1.9.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ofek/userpath")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1zrbjb54h5p7f1xadk93by1663asr38jg6qs1jsaalsfz7x83v3z"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-hatchling))
+    (arguments
+     `(#:tests? #f ;tests depend on a docker image
+       #: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)))
+                         '("/HISTORY.rst" "/LICENSE.txt"))))))))
+    (propagated-inputs (list python-click))
+    (home-page "https://pypi.org/project/userpath/")
+    (synopsis "Cross-platform tool for adding locations to the user PATH")
+    (description "@code{userpath} can be used to make permanent changes to
+user's PATH.  It does so by modifying command line shell's initialization
+files.
+
+You may instead want to use @code{guix home} to define PATH declaratively.
+This tool is unfortunately not compatible with {guix home}.")
+    (license license:expat)))
+
 (define-public python-uc-micro-py
   (package
     (name "python-uc-micro-py")
-- 
2.41.0