Subject: [PATCH 1/3] gnu: python-typing-extensions: Move to (gnu packages python-build).

From: Nicolas Graves <[email-masked]>
Date: Fri, 23 Dec 2022 15:56:37 +0100

* a/gnu/packages/python-xyz.scm (python-typing-extensions): Move from here…
* a/gnu/packages/python-build.scm (python-typing-extensions): …to here.
---
 gnu/packages/admin.scm        |  2 ++
 gnu/packages/audio.scm        |  2 ++
 gnu/packages/embedded.scm     |  2 ++
 gnu/packages/orange.scm       |  2 ++
 gnu/packages/python-build.scm | 62 +++++++++++++++++++++++++++++++++++
 gnu/packages/python-xyz.scm   | 60 ---------------------------------
 gnu/packages/rpc.scm          |  2 ++
 gnu/packages/ssh.scm          |  2 ++
 8 files changed, 74 insertions(+), 60 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index b9fd3dab27..c9e2c5a281 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -55,6 +55,7 @@
 ;;; Copyright © 2022 ( <[email-masked]>
 ;;; Copyright © 2022 Matthew James Kraai <[email-masked]>
 ;;; Copyright © 2022 jgart <[email-masked]>
+;;; Copyright © 2022 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -153,6 +154,7 @@ (define-module (gnu packages admin)
   #:use-module (gnu packages polkit)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index b1d3007b8c..483ff18753 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -39,6 +39,7 @@
 ;;; Copyright © 2022 Arjan Adriaanse <[email-masked]>
 ;;; Copyright © 2022 Juliana Sims <[email-masked]>
 ;;; Copyright © 2022 Simon Streit <[email-masked]>
+;;; Copyright © 2022 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -107,6 +108,7 @@ (define-module (gnu packages audio)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)  ;libsndfile, libsamplerate
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 87c572ba0f..fabc27f8a0 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2021 Morgan Smith <[email-masked]>
 ;;; Copyright © 2022 Mathieu Othacehe <[email-masked]>
 ;;; Copyright © 2022 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2022 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -62,6 +63,7 @@ (define-module (gnu packages embedded)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
diff --git a/gnu/packages/orange.scm b/gnu/packages/orange.scm
index 0b8a642014..c6cfbff6b9 100644
--- a/gnu/packages/orange.scm
+++ b/gnu/packages/orange.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021, 2022 Vinicius Monego <[email-masked]>
+;;; Copyright © 2022 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,6 +26,7 @@ (define-module (gnu packages orange)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages graph)
   #:use-module (gnu packages machine-learning)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-web)
diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 716108df2b..07f7834a1e 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2021, 2022 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2022 Garek Dyszel <[email-masked]>
+;;; Copyright © 2022 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -515,6 +516,67 @@ (define-public python-flit-scm
 system, then @code{flit_core} to build the package.")
     (license license:expat)))
 
+(define-public python-typing-extensions
+  (package
+    (name "python-typing-extensions")
+    (version "4.0.1")
+    (source (origin
+              ;; The test script is missing from the PyPI archive.
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/python/typing")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0a35fh5wk9s538x0w3dz95y0avnhd2srzyv9s1a372711n8hdl4p"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:tests? #f       ;requires Python's test module, not available in Guix
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'enter-source-directory
+            (lambda _
+              (chdir "typing_extensions")))
+          ;; XXX: PEP 517 manual build copied from python-isort.
+          (replace 'build
+            (lambda _
+              (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "python" "src/test_typing_extensions.py"))))
+          (replace 'install
+            (lambda _
+              (let ((whl (car (find-files "dist" "\\.whl$"))))
+                (invoke "pip" "--no-cache-dir" "--no-input"
+                        "install" "--no-deps" "--prefix" #$output whl)))))))
+    (native-inputs (list python-pypa-build python-flit-core))
+    (home-page "https://github.com/python/typing/typing_extensions")
+    (synopsis "Experimental type hints for Python")
+    (description
+     "The typing_extensions module contains additional @code{typing} hints not
+yet present in the of the @code{typing} standard library.
+Included are implementations of:
+@enumerate
+@item ClassVar
+@item ContextManager
+@item Counter
+@item DefaultDict
+@item Deque
+@item NewType
+@item NoReturn
+@item overload
+@item Protocol
+@item runtime
+@item Text
+@item Type
+@item TYPE_CHECKING
+@item AsyncGenerator
+@end enumerate\n")
+    (license license:psfl)))
+
 (define-public python-setuptools-scm
   (package
     (name "python-setuptools-scm")
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6226f2a3ea..80981ca46a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22393,66 +22393,6 @@ (define-public python-typeguard
 with PEP 484 argument (and return) type annotations.")
     (license license:expat)))
 
-(define-public python-typing-extensions
-  (package
-    (name "python-typing-extensions")
-    (version "4.0.1")
-    (source (origin
-              ;; The test script is missing from the PyPI archive.
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/python/typing")
-                    (commit version)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "0a35fh5wk9s538x0w3dz95y0avnhd2srzyv9s1a372711n8hdl4p"))))
-    (build-system python-build-system)
-    (arguments
-     (list
-      #:tests? #f       ;requires Python's test module, not available in Guix
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-after 'unpack 'enter-source-directory
-            (lambda _
-              (chdir "typing_extensions")))
-          ;; XXX: PEP 517 manual build copied from python-isort.
-          (replace 'build
-            (lambda _
-              (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
-          (replace 'check
-            (lambda* (#:key tests? #:allow-other-keys)
-              (when tests?
-                (invoke "python" "src/test_typing_extensions.py"))))
-          (replace 'install
-            (lambda _
-              (let ((whl (car (find-files "dist" "\\.whl$"))))
-                (invoke "pip" "--no-cache-dir" "--no-input"
-                        "install" "--no-deps" "--prefix" #$output whl)))))))
-    (native-inputs (list python-pypa-build python-flit-core))
-    (home-page "https://github.com/python/typing/typing_extensions")
-    (synopsis "Experimental type hints for Python")
-    (description
-     "The typing_extensions module contains additional @code{typing} hints not
-yet present in the of the @code{typing} standard library.
-Included are implementations of:
-@enumerate
-@item ClassVar
-@item ContextManager
-@item Counter
-@item DefaultDict
-@item Deque
-@item NewType
-@item NoReturn
-@item overload
-@item Protocol
-@item runtime
-@item Text
-@item Type
-@item TYPE_CHECKING
-@item AsyncGenerator
-@end enumerate\n")
-    (license license:psfl)))
 
 (define-public python-typing-extensions-next
   (package
diff --git a/gnu/packages/rpc.scm b/gnu/packages/rpc.scm
index 59a4c41343..5699f5b2be 100644
--- a/gnu/packages/rpc.scm
+++ b/gnu/packages/rpc.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2021 Greg Hogan <[email-masked]>
 ;;; Copyright © 2021 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2022 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2022 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -42,6 +43,7 @@ (define-module (gnu packages rpc)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages regex)
   #:use-module (gnu packages tls)
diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm
index babed807f9..7a9b40b2e4 100644
--- a/gnu/packages/ssh.scm
+++ b/gnu/packages/ssh.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2020 Oleg Pykhalov <[email-masked]>
 ;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2021 Brice Waegeneire <[email-masked]>
+;;; Copyright © 2022 Nicolas Graves <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,6 +62,7 @@ (define-module (gnu packages ssh)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
-- 
2.38.1