unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [bug#70672] ["PATCH core-updates" 1/1] gnu: python: Fix python's idle installation.
  @ 2024-04-30 13:44 65% ` Jean-Baptiste Note
  0 siblings, 0 replies; 200+ results
From: Jean-Baptiste Note @ 2024-04-30 13:44 UTC (permalink / raw)
  To: 70672
  Cc: Jean-Baptiste Note, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python.scm (python-2.7): Fix idle output for python-2.7.
---
 gnu/packages/python.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b2757c651e..b41e75ed45 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -345,12 +345,15 @@ (define-public python-2.7
                       (install-file file (dirname target))
                       (delete-file file)))
                   (find-files (string-append out "/bin") "^idle"))
+                 ;; The idlelib directory is in OUT/lib/pythonX.Y, but we
+                 ;; want it under IDLE/lib/pythonX.Y/site-packages.
                  (match (find-files out "^idlelib$" #:directories? #t)
                    ((idlelib)
                     (let* ((len (string-length out))
                            (target (string-append idle "/"
-                                                  (string-drop idlelib len)
-                                                  "/site-packages")))
+                                                  (string-drop
+                                                   (dirname idlelib) len)
+                                                  "/site-packages/idlelib")))
                       (mkdir-p (dirname target))
                       (rename-file idlelib target))))))))
          (add-after 'move-idle 'rebuild-bytecode
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70656] [PATCH python-team 3/4] gnu: python-pbr: Use git-minimal/pinned.
  @ 2024-04-29 20:40 65% ` Christopher Baines
  2024-04-29 20:40 65% ` [bug#70656] [PATCH python-team 4/4] gnu: python-versioneer: " Christopher Baines
  1 sibling, 0 replies; 200+ results
From: Christopher Baines @ 2024-04-29 20:40 UTC (permalink / raw)
  To: 70656
  Cc: Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

This helps reduce the dependencies on git, as I think it's find to build with
a slightly older git, at least during periods when git-minimal/pinned needs
updating.

* gnu/packages/version-control.scm (python-pbr)[propagated-inputs]: Use
git-minimal/pinned.

Change-Id: Ib90056a1a603e06a99b5c601f9fcba7375dc24ac
---
 gnu/packages/python-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f22b891ba5..16b47d0aa7 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5128,7 +5128,7 @@ (define-public python-pbr
     (arguments
      `(#:tests? #f)) ;; Most tests seem to use the Internet.
     (propagated-inputs
-      (list git)) ;; pbr actually uses the "git" binary.
+      (list git-minimal/pinned)) ;; pbr actually uses the "git" binary.
     (native-inputs
       `(("python-fixtures" ,python-fixtures-bootstrap)
         ;; discover, coverage, hacking, subunit
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70656] [PATCH python-team 4/4] gnu: python-versioneer: Use git-minimal/pinned.
    2024-04-29 20:40 65% ` [bug#70656] [PATCH python-team 3/4] gnu: python-pbr: " Christopher Baines
@ 2024-04-29 20:40 65% ` Christopher Baines
  1 sibling, 0 replies; 200+ results
From: Christopher Baines @ 2024-04-29 20:40 UTC (permalink / raw)
  To: 70656
  Cc: Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

This helps reduce the dependencies on git, as I think it's find to build with
a slightly older git, at least during periods when git-minimal/pinned needs
updating.

* gnu/packages/version-control.scm (python-versioneer)[propagated-inputs]: Use
git-minimal/pinned.

Change-Id: Id537baa8228afeb3b84161ecb5fea0d131b45442
---
 gnu/packages/python-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 16b47d0aa7..b5a2197a0a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31915,7 +31915,7 @@ (define-public python-versioneer
                 (invoke "pycodestyle" "--max-line-length=88"
                         "git_version.py" "versioneer.py")))))))
     (native-inputs
-     (list git python-flake8 python-pycodestyle python-pyflakes))
+     (list git-minimal/pinned python-flake8 python-pycodestyle python-pyflakes))
     (propagated-inputs
      (list python-tomli))
     (home-page "https://github.com/python-versioneer/python-versioneer")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70483] [PATCH v2 1/1] gnu: Add python-robotframework-requests.
  2024-04-20  8:41 61% [bug#70483] [PATCH 1/1] gnu: Add python-robotframework-requests Markku Korkeala
@ 2024-04-23  8:54 60% ` Markku Korkeala
  0 siblings, 0 replies; 200+ results
From: Markku Korkeala @ 2024-04-23  8:54 UTC (permalink / raw)
  To: 70483
  Cc: Markku Korkeala, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-web.scm (python-robotframework-requests): New variable.

Change-Id: I01d814d1a9e20d26e9bfa4a0a77ba91577da2bd8
---
Improved the patch according to feedback:

Moved package to gnu/packages/python-web.scm
Switched to pyproject-build-system
Simplified the test phase
Removed duplicate and unnecessary dependencies
Fixed description identation

 gnu/packages/python-web.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 5a532f8460..2d0695d5a4 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -64,6 +64,7 @@
 ;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com>
 ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2024 normally_js <normally_js@posteo.net>
+;;; Copyright © 2024 Markku Korkeala <markku.korkeala@iki.fi>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3763,6 +3764,33 @@ (define-public python-requests-ftp
 adapter for use with the Requests library.")
     (license license:asl2.0)))
 
+(define-public python-robotframework-requests
+  (package
+    (name "python-robotframework-requests")
+    (version "0.9.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/MarketSquare/robotframework-requests")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "077j8p5k41v53slyv8h32fcmqfi7m6z3r4gmyqqaawm5szfmy61m"))))
+    (build-system pyproject-build-system)
+    (arguments
+     '(#:test-flags '("-v" "utests/")))
+    (propagated-inputs (list python-requests python-robotframework))
+    (native-inputs (list python-flask python-mock python-pytest
+                         python-pytest-cov))
+    (home-page "https://github.com/MarketSquare/robotframework-requests")
+    (synopsis "Robot Framework keyword library wrapper around requests")
+    (description
+     "RequestsLibrary is a Robot Framework library aimed to provide HTTP
+api testing functionalities by wrapping the well known Python Requests
+Library.")
+    (license license:expat)))
+
 (define-public python-aioftp
   (package
     (name "python-aioftp")

base-commit: ee9cf4f00bcb8966fa125787e8534580b270bb99
-- 
2.41.0





^ permalink raw reply related	[relevance 60%]

* [bug#70528] [PATCH] gnu: jube: Update to version 2.6.1.
@ 2024-04-23  8:18 83% Romain GARBAGE
  0 siblings, 0 replies; 200+ results
From: Romain GARBAGE @ 2024-04-23  8:18 UTC (permalink / raw)
  To: 70528

* gnu/packages/python-xyz.scm (jube): Update to new version. Add
`python-pyyaml' to `native-inputs'.

Change-Id: I77e1532f069f2f745b4acb575dc3c4a6861a8945
---
 gnu/packages/python-xyz.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 92566abfed..d26f1c109b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -28798,7 +28798,7 @@ (define-public jube
   (package
     ;; This is a command-line tool, so no "python-" prefix.
     (name "jube")
-    (version "2.2.2")
+    (version "2.6.1")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -28806,9 +28806,10 @@ (define-public jube
                     version))
               (sha256
                (base32
-                "0xq4k1q63s1p6swgyp61vahlrd1fqmgbm0gm5kpj8ikwy0yc0nqk"))
+                "0r5d2gdqa0f4c468q3k25ycw1k2g76gg8fyiln4ni98fvfsbx3il"))
               (file-name (string-append "jube-" version ".tar.gz"))))
     (build-system python-build-system)
+    (native-inputs (list python-pyyaml)) ; pyyaml is needed for tests
     (home-page "https://apps.fz-juelich.de/jsc/jube/jube2/docu/index.html")
     (synopsis "Benchmarking environment")
     (description
-- 
2.41.0





^ permalink raw reply related	[relevance 83%]

* [bug#70513] [PATCH] gnu: i3-autotiling: Update to 1.9.1.
@ 2024-04-22 10:14 65% Wilko Meyer
  0 siblings, 0 replies; 200+ results
From: Wilko Meyer @ 2024-04-22 10:14 UTC (permalink / raw)
  To: 70513
  Cc: Wilko Meyer, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (i3-autotiling): Update to 1.9.1.

Change-Id: I564e3c53d23830c94eb58465715b1b7809cc74f5
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index bac90b1e07..c30c6878c6 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -35771,7 +35771,7 @@ (define-public python-i3ipc
 (define-public i3-autotiling
   (package
     (name "i3-autotiling")
-    (version "1.8")
+    (version "1.9.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -35780,7 +35780,7 @@ (define-public i3-autotiling
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1nsm0gd45ys4ghlzrvjrf0lvcyhvpx58lz8gg325a762wn5a4a72"))))
+                "010sw3b2nx5cl578drd3xj58wlza76zkzh1jhsp44chg1vvhacrx"))))
     (build-system python-build-system)
     (arguments (list #:tests? #f))      ;no tests
     (native-inputs (list python-wheel))

base-commit: a1d711c92e119f6b5b8e99a620cdba92a4ca3bfb
prerequisite-patch-id: 0f9de37cc18b327c988be58ed9280e06b73172d3
prerequisite-patch-id: 4d61a1aafe2dab7537985b409f3d81336f311152
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70489] [PATCH 05/47] gnu: python-pytest-socket: Update to 0.7.0.
  @ 2024-04-20 23:21 63% ` Sharlatan Hellseher
  2024-04-20 23:21 65% ` [bug#70489] [PATCH 06/47] gnu: parfive: Update to 2.1.0 Sharlatan Hellseher
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-04-20 23:21 UTC (permalink / raw)
  To: 70489
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-check.scm (python-pytest-socket): Update to 0.7.0.

Change-Id: I879064eba2f4d93d2e2b519ebdf613685d5b5df9
---
 gnu/packages/python-check.scm | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index b39709d960..777791cb6c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -420,13 +420,17 @@ (define-public python-vcrpy
 (define-public python-pytest-socket
   (package
     (name "python-pytest-socket")
-    (version "0.5.1")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "pytest-socket" version))
-              (sha256
-               (base32
-                "1dkr86nxkxc0ka3rdnpmk335m8gl1zh1sy8i7w4w1jsidbf82jvw"))))
+    (version "0.7.0")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/miketheman/pytest-socket")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1m6s07gvljq82hiajzy1v123kpkciziiqdjqfnas169rmzg0bmnp"))))
     (build-system pyproject-build-system)
     (arguments
      (list
@@ -440,7 +444,18 @@ (define-public python-pytest-socket
                     " and not test_httpx_fails"
                     " and not test_disabled_urllib_fails"
                     " and not test_urllib_succeeds_by_default"
-                    " and not test_enabled_urllib_succeeds"))))
+                    " and not test_enabled_urllib_succeeds"
+                    " and not test_single_cli_arg_connect_disabled_hostname_resolved"))
+     #:phases
+       #~(modify-phases %standard-phases
+           ;; See <https://github.com/miketheman/pytest-socket/issues/308>
+         (add-after 'unpack 'fix-tests
+           (lambda _
+             (substitute* (list "tests/test_async.py"
+                                "tests/test_socket.py"
+                                "tests/test_precedence.py")
+               (("from tests.common import assert_socket_blocked")
+                "from common import assert_socket_blocked")))))))
     (native-inputs (list python-httpx
                          python-poetry-core
                          python-pypa-build
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#70489] [PATCH 30/47] gnu: Add python-assay.
                     ` (3 preceding siblings ...)
  2024-04-20 23:21 64% ` [bug#70489] [PATCH 09/47] gnu: Add python-supersmoother Sharlatan Hellseher
@ 2024-04-20 23:22 61% ` Sharlatan Hellseher
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-04-20 23:22 UTC (permalink / raw)
  To: 70489
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-check.scm (python-assay): New variable.

Change-Id: I0ec910d8c37000ff08119a33e3f42af2269fa494
---
 gnu/packages/python-check.scm | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 777791cb6c..6fdfaad6fb 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -9,7 +9,7 @@
 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
 ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Tanguy Le Carrour <tanguy@bioneland.org>
-;;; Copyright © 2021-2023 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2021-2024 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2021 Bonface Munyoki Kilyungi <me@bonfacemunyoki.com>
@@ -61,6 +61,38 @@ (define-module (gnu packages python-check)
   #:use-module (guix packages)
   #:use-module (guix utils))
 
+(define-public python-assay
+  ;; No release yet.
+  (let ((commit "74617d70e77afa09f58b3169cf496679ac5d5621")
+        (revision "0"))
+    (package
+      (name "python-assay")
+      (version (git-version "0.0.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/brandon-rhodes/assay")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1klxmamj88mn0q348r08zksccgsbch8sp0m4b04s3myrqnslp2nd"))))
+      (build-system pyproject-build-system)
+      (arguments
+       (list
+        #:test-flags #~(list "-m" "assay.tests")
+        #:phases
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? test-flags #:allow-other-keys)
+                (when tests?
+                  (apply invoke "python" test-flags)))))))
+      (home-page "https://github.com/brandon-rhodes/assay")
+      (synopsis "Python testing framework")
+      (description
+       "This package provides opiniotated Python test framework prototype.")
+      (license license:expat))))
+
 (define-public python-assertpy
   (package
     (name "python-assertpy")
-- 
2.41.0





^ permalink raw reply related	[relevance 61%]

* [bug#70489] [PATCH 06/47] gnu: parfive: Update to 2.1.0.
    2024-04-20 23:21 63% ` [bug#70489] [PATCH 05/47] gnu: python-pytest-socket: Update to 0.7.0 Sharlatan Hellseher
@ 2024-04-20 23:21 65% ` Sharlatan Hellseher
  2024-04-20 23:21 65% ` [bug#70489] [PATCH 07/47] gnu: python-exif-read: Update to 3.0.0 Sharlatan Hellseher
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-04-20 23:21 UTC (permalink / raw)
  To: 70489
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-web.scm (parfive): Update to 2.1.0.

Change-Id: I6207150e012c03943d4553854123831d1bba3e55
---
 gnu/packages/python-web.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 5a532f8460..fb6abb9d80 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -1378,13 +1378,13 @@ (define-public httpie
 (define-public parfive
   (package
     (name "parfive")
-    (version "2.0.2")
+    (version "2.1.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "parfive" version))
               (sha256
                (base32
-                "0pf8rzfwxpkn84xzb4v8m1fy3k7kjlh8f9ln4y5xqlnbqpwi30lh"))))
+                "13nw2y7wjzj6w049av6ff4d0zxgbhkrgck0xyh676c114hcv8v6d"))))
     (build-system pyproject-build-system)
     (arguments
      (list
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70489] [PATCH 09/47] gnu: Add python-supersmoother.
                     ` (2 preceding siblings ...)
  2024-04-20 23:21 65% ` [bug#70489] [PATCH 07/47] gnu: python-exif-read: Update to 3.0.0 Sharlatan Hellseher
@ 2024-04-20 23:21 64% ` Sharlatan Hellseher
  2024-04-20 23:22 61% ` [bug#70489] [PATCH 30/47] gnu: Add python-assay Sharlatan Hellseher
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-04-20 23:21 UTC (permalink / raw)
  To: 70489
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-science.scm (python-supersmoother): New variable.

Change-Id: I8fb43d746757014e3b773c07458b777b893adb4a
---
 gnu/packages/python-science.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 862e101f6a..b39dc5bc5b 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -2449,6 +2449,31 @@ (define-public python-simple-pid
 proportional-integral-derivative} controller.")
     (license license:expat)))
 
+(define-public python-supersmoother
+  (package
+    (name "python-supersmoother")
+    (version "0.4")
+    (source
+     (origin
+       (method git-fetch)        ; no package in PyPI
+       (uri (git-reference
+             (url "https://github.com/jakevdp/supersmoother")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1lkj8l2mpki6x2pxcwlrplx63lhi8h9v2rzxgjfb0cppsfr8m1wp"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-numpy))
+    (native-inputs (list python-scipy))
+    (home-page "http://github.com/jakevdp/supersmoother")
+    (synopsis "Python implementation of Friedman's Supersmoother")
+    (description
+     "This package provides an efficient implementation of
+@url{https://www.slac.stanford.edu/pubs/slacpubs/3250/slac-pub-3477.pdf,
+Friedman's SuperSmoother} based in Python.  It makes use of numpy for fast
+numerical computation.")
+    (license license:bsd-2)))
+
 (define-public python-opt-einsum
   (package
     (name "python-opt-einsum")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#70489] [PATCH 07/47] gnu: python-exif-read: Update to 3.0.0.
    2024-04-20 23:21 63% ` [bug#70489] [PATCH 05/47] gnu: python-pytest-socket: Update to 0.7.0 Sharlatan Hellseher
  2024-04-20 23:21 65% ` [bug#70489] [PATCH 06/47] gnu: parfive: Update to 2.1.0 Sharlatan Hellseher
@ 2024-04-20 23:21 65% ` Sharlatan Hellseher
  2024-04-20 23:21 64% ` [bug#70489] [PATCH 09/47] gnu: Add python-supersmoother Sharlatan Hellseher
  2024-04-20 23:22 61% ` [bug#70489] [PATCH 30/47] gnu: Add python-assay Sharlatan Hellseher
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-04-20 23:21 UTC (permalink / raw)
  To: 70489
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-exif-read): Update to 3.0.0.

Change-Id: I19e0a19041aa943a9f3ecf262077328d52ef4d1d
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index bac90b1e07..6011b4137f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5181,13 +5181,13 @@ (define-public python-pyrsistent
 (define-public python-exif-read
   (package
     (name "python-exif-read")
-    (version "2.1.2")
+    (version "3.0.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "ExifRead" version))
               (sha256
                (base32
-                "1b90jf6m9vxh9nanhpyvqdq7hmfx5iggw1l8kq10jrs6xgr49qkr"))))
+                "191c7sa0rca8wkspfq8nlfa6davh743mqkzrcayz5gcx2rja7i8a"))))
     (build-system python-build-system)
     (arguments `(#:tests? #f)) ; no tests
     (home-page "https://github.com/ianare/exif-py")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70483] [PATCH 1/1] gnu: Add python-robotframework-requests.
@ 2024-04-20  8:41 61% Markku Korkeala
  2024-04-23  8:54 60% ` [bug#70483] [PATCH v2 " Markku Korkeala
  0 siblings, 1 reply; 200+ results
From: Markku Korkeala @ 2024-04-20  8:41 UTC (permalink / raw)
  To: 70483
  Cc: Markku Korkeala, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-robotframework-requests): New variable.

Change-Id: I01d814d1a9e20d26e9bfa4a0a77ba91577da2bd8
---
 gnu/packages/python-xyz.scm | 38 +++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index bac90b1e07..ff85b3f2bf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -152,6 +152,7 @@
 ;;; Copyright © 2024 Adriel Dumas--Jondeau <leirda@disroot.org>
 ;;; Copyright © 2024 Navid Afkhami <navid.afkhami@mdc-berlin.de>
 ;;; Copyright © 2024 TakeV <takev@disroot.org>
+;;; Copyright © 2024 Markku Korkeala <markku.korkeala@iki.fi>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -7417,6 +7418,43 @@ (define-public python-robotframework-seleniumscreenshots
 or for visual regression testing purposes.")
     (license license:bsd-3)))
 
+(define-public python-robotframework-requests
+  (package
+    (name "python-robotframework-requests")
+    (version "0.9.7")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/MarketSquare/robotframework-requests")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "077j8p5k41v53slyv8h32fcmqfi7m6z3r4gmyqqaawm5szfmy61m"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+                      (when tests?
+                        (invoke "pytest" "-v" "utests/")))))))
+    (propagated-inputs (list python-requests python-robotframework))
+    (native-inputs (list python-flask
+                         python-flask
+                         python-coverage
+                         python-flake8
+                         python-mock
+                         python-flake8
+                         python-pytest
+                         python-pytest-cov))
+    (home-page "https://github.com/MarketSquare/robotframework-requests")
+    (synopsis "Robot Framework keyword library wrapper around requests")
+    (description
+     "RequestsLibrary is a Robot Framework library aimed to provide HTTP
+     api testing functionalities by wrapping the well known Python
+     Requests Library.")
+    (license license:expat)))
+
 (define-public python-rstr
   (package
    (name "python-rstr")

base-commit: ee9cf4f00bcb8966fa125787e8534580b270bb99
-- 
2.41.0





^ permalink raw reply related	[relevance 61%]

* [bug#70268] [PATCH v2 1/1] gnu: Add python-vdf.
  @ 2024-04-17  9:34 65%   ` Steve George
  0 siblings, 0 replies; 200+ results
From: Steve George @ 2024-04-17  9:34 UTC (permalink / raw)
  To: 70268; +Cc: steve

From: Giacomo Leidi via Guix-patches via <guix-patches@gnu.org>

* gnu/packages/python-xyz.scm (python-vdf): New variable.

Reviewed-by: Steve George <steve@futurile.net>

Change-Id: Ie8a14292b9c9937d22f011ac078562e81abd6b36
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index bac90b1e07..1637f2aa8e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6834,6 +6834,24 @@ (define-public python-pygments
      "Pygments is a syntax highlighting package written in Python.")
     (license license:bsd-2)))
 
+(define-public python-vdf
+  (package
+    (name "python-vdf")
+    (version "3.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "vdf" version))
+       (sha256
+        (base32
+         "1bz2gn04pl6rj2mawlzlirz1ygg4rdypq0pxbyg018873vs1jm7x"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/ValvePython/vdf")
+    (synopsis "Work with Valve's VDF text format")
+    (description "This package provides @code{python-vdf}, a library for
+working with Valve's VDF text format.")
+    (license license:expat)))
+
 (define-public python-pygments-github-lexers
   (package
     (name "python-pygments-github-lexers")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70431] [PATCH 1/2] gnu: contourpy: Correct dependencies.
  @ 2024-04-17  5:40 65% ` Nicolas Graves via Guix-patches via
  2024-04-17  5:40 65%   ` [bug#70431] [PATCH 2/2] gnu: python-seaborn: " Nicolas Graves via Guix-patches via
  0 siblings, 1 reply; 200+ results
From: Nicolas Graves via Guix-patches via @ 2024-04-17  5:40 UTC (permalink / raw)
  To: 70431; +Cc: ngraves

* gnu/packages/python-xyz.scm (contourpy): Correct dependencies.
  [propagated-inputs]: Move all except python-numpy from here...
  [native-inputs]: ...to here.

Change-Id: I99048270570689ed9ceab6e0ff6db9561193425e
---
 gnu/packages/python-xyz.scm | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 44c709a880..643c427392 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1144,17 +1144,19 @@ (define-public python-contourpy
              "--ignore=tests/test_filled.py"
              "--ignore=tests/test_lines.py"
              "--ignore=tests/test_renderer.py")))
-    (propagated-inputs (list python-mypy
-                             python-numpy
-                             python-pillow
-                             python-pytest
-                             python-pytest-cov
-                             python-pytest-xdist
-                             python-selenium
-                             python-sphinx
-                             python-sphinx-copybutton
-                             python-wurlitzer))
-    (native-inputs (list meson-python pybind11-2.10 pkg-config))
+    (propagated-inputs (list python-numpy))
+    (native-inputs (list meson-python
+                         pybind11-2.10
+                         pkg-config
+                         python-mypy
+                         python-pillow
+                         python-pytest
+                         python-pytest-cov
+                         python-pytest-xdist
+                         python-selenium
+                         python-sphinx
+                         python-sphinx-copybutton
+                         python-wurlitzer))
     (home-page "https://contourpy.readthedocs.io/")
     (synopsis
      "Python library for calculating contours of 2D quadrilateral grids")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70431] [PATCH 2/2] gnu: python-seaborn: Correct dependencies.
  2024-04-17  5:40 65% ` [bug#70431] [PATCH 1/2] gnu: contourpy: Correct dependencies Nicolas Graves via Guix-patches via
@ 2024-04-17  5:40 65%   ` Nicolas Graves via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Nicolas Graves via Guix-patches via @ 2024-04-17  5:40 UTC (permalink / raw)
  To: 70431; +Cc: ngraves

* gnu/packages/python-xyz.scm (python-seaborn): Correct dependencies.
  [propagated-inputs]: Move python-ipykernel, python-mypy,
  python-nbconvert, python-numpydoc, python-pyyaml from here...
  [native-inputs]: ... to here.

Change-Id: I94a28f0cb8ec7c2171007f2b635dc10d7a8fcc8c
---
 gnu/packages/python-xyz.scm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 643c427392..f6f90d9c7e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -13262,23 +13262,23 @@ (define-public python-seaborn
                 "0ycibcs6kvd3xi4zsxna81claqifyb9dn6z6jwc5x7lqqplnbbdz"))))
     (build-system pyproject-build-system)
     (propagated-inputs
-     (list python-ipykernel
-           python-matplotlib
-           python-mypy
-           python-nbconvert
+     (list python-matplotlib
            python-numpy
-           python-numpydoc
            python-pandas
-           python-pyyaml
            python-scipy
            python-statsmodels))
     (native-inputs
      (list python-flake8
            python-flit-core
            python-pre-commit
+           python-ipykernel
+           python-nbconvert
+           python-numpydoc
+           python-mypy
            python-pytest
            python-pytest-cov
-           python-pytest-xdist))
+           python-pytest-xdist
+           python-pyyaml))
     (home-page "https://seaborn.pydata.org/")
     (synopsis "Statistical data visualization")
     (description
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70416] [PATCH 9/9] gnu: python-mediapy: Remove python-pylint native-input.
  2024-04-16 12:59 65% ` [bug#70416] [PATCH 1/9] gnu: python-fastjsonschema: Remove python-pylint native-input Nicolas Graves via Guix-patches via
  2024-04-16 12:59 65%   ` [bug#70416] [PATCH 2/9] gnu: python-trio: " Nicolas Graves via Guix-patches via
@ 2024-04-16 12:59 65%   ` Nicolas Graves via Guix-patches via
  1 sibling, 0 replies; 200+ results
From: Nicolas Graves via Guix-patches via @ 2024-04-16 12:59 UTC (permalink / raw)
  To: 70416; +Cc: ngraves

* gnu/packages/python-xyz.scm (python-mediapy):
  [native-inputs]: Remove python-pylint.

Change-Id: Ia7146dfed5081aa356ef982bb9643b46c12a9eab
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1b9070b112..752d184494 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4231,7 +4231,6 @@ (define-public python-mediapy
                              python-pillow))
     (native-inputs
      (list python-flit-core
-           python-pylint
            python-pytest
            python-pytest-xdist))
     (home-page "https://github.com/google/mediapy")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70416] [PATCH 1/9] gnu: python-fastjsonschema: Remove python-pylint native-input.
  @ 2024-04-16 12:59 65% ` Nicolas Graves via Guix-patches via
  2024-04-16 12:59 65%   ` [bug#70416] [PATCH 2/9] gnu: python-trio: " Nicolas Graves via Guix-patches via
  2024-04-16 12:59 65%   ` [bug#70416] [PATCH 9/9] gnu: python-mediapy: " Nicolas Graves via Guix-patches via
  0 siblings, 2 replies; 200+ results
From: Nicolas Graves via Guix-patches via @ 2024-04-16 12:59 UTC (permalink / raw)
  To: 70416; +Cc: ngraves

* gnu/packages/python-xyz.scm (python-fastjsonschema):
  [native-inputs]: Remove python-pylint.

Change-Id: If6a20e0b790f7157013a6868bba9e4a8d7e5ba28
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 44c709a880..0f4ab26638 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16676,7 +16676,6 @@ (define-public python-fastjsonschema
      (list python-colorama
            python-json-spec
            python-jsonschema
-           python-pylint
            python-pytest
            python-pytest-benchmark
            python-pytest-cache))
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70416] [PATCH 2/9] gnu: python-trio: Remove python-pylint native-input.
  2024-04-16 12:59 65% ` [bug#70416] [PATCH 1/9] gnu: python-fastjsonschema: Remove python-pylint native-input Nicolas Graves via Guix-patches via
@ 2024-04-16 12:59 65%   ` Nicolas Graves via Guix-patches via
  2024-04-16 12:59 65%   ` [bug#70416] [PATCH 9/9] gnu: python-mediapy: " Nicolas Graves via Guix-patches via
  1 sibling, 0 replies; 200+ results
From: Nicolas Graves via Guix-patches via @ 2024-04-16 12:59 UTC (permalink / raw)
  To: 70416; +Cc: ngraves

* gnu/packages/python-xyz.scm (python-trio):
  [native-inputs]: Remove python-pylint.

Change-Id: Idd34db779b1f1bbc6ca277fedc01537e17205d50
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0f4ab26638..1b9070b112 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -28283,7 +28283,6 @@ (define-public python-trio
      (list python-astor
            python-ipython
            python-jedi
-           python-pylint
            python-pyopenssl
            python-pytest
            python-pytest-xdist
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69817] [PATCH v2] gnu: Add python-pynsee.
  2024-03-15 19:12 62% [bug#69817] [PATCH] gnu: Add python-pynsee Nicolas Graves via Guix-patches via
@ 2024-04-16 12:34 62% ` Nicolas Graves via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Nicolas Graves via Guix-patches via @ 2024-04-16 12:34 UTC (permalink / raw)
  To: 69817; +Cc: ngraves

* gnu/packages/python-science.scm (python-pynsee): New variable.

Change-Id: I4e93d26ad4b6be238b0e4cce82ea77030caf6e02
---
 gnu/packages/python-science.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 862e101f6a..1d902d23f2 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -24,6 +24,7 @@
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
 ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2649,6 +2650,37 @@ (define-public python-pynrrd
 and from numpy arrays.")
     (license license:expat)))
 
+(define-public python-pynsee
+  (package
+    (name "python-pynsee")
+    (version "0.1.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pynsee" version))
+       (sha256
+        (base32 "0wd1xhkjpll8mzrrhnqxrand32p338j2zfw3h1gxacf31iwxhips"))))
+    (build-system pyproject-build-system)
+    (arguments (list #:tests? #f))  ; XXX: Tests require network access.
+    (propagated-inputs (list python-appdirs
+                             python-pandas
+                             python-requests
+                             python-shapely
+                             python-tqdm
+                             python-unidecode
+                             python-urllib3))
+    (home-page "https://pynsee.readthedocs.io")
+    (synopsis
+     "Tools to Easily Search and Download French Data From INSEE and IGN APIs")
+    (description
+     "This package provides tools to easily search and download French data
+from INSEE and IGN APIs.  This data includes more than 150 000 macroeconomic
+series, a dozen datasets of local french data, numerous sources available on
+@url{insee.fr}, geographical limits of administrative areas taken from IGN as
+well as key metadata and SIRENE database containing data on all French
+compagnies.")
+    (license license:expat)))
+
 (define-public python-libneuroml
   (package
     (name "python-libneuroml")
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#70400] [PATCH 3/7] gnu: python-lsp-jsonrpc: Update to 1.1.2.
  2024-04-15 17:45 64% ` [bug#70400] [PATCH 1/7] gnu: Add python-docstring-to-markdown Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 61%   ` [bug#70400] [PATCH 2/7] gnu: Add python-pytoolconfig Jonathan Pieper via Guix-patches via
@ 2024-04-15 17:45 63%   ` Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 64%   ` [bug#70400] [PATCH 4/7] gnu: python-snowballstemmer: Update to 2.2.0 Jonathan Pieper via Guix-patches via
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Jonathan Pieper via Guix-patches via @ 2024-04-15 17:45 UTC (permalink / raw)
  To: 70400
  Cc: Jonathan Pieper, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-lsp-jsonrpc): Update to 1.1.2.
  [build-system]: Change to pyproject-build-system.
  [arguments]{set-version}: Set version explicitly to pass sanity-check.
  [native-inputs]: Add python-pytest-cov.

Change-Id: I3ffaf75ced25bd95d8f7486294364fb52b86b08b
---
 gnu/packages/python-xyz.scm | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 27107c3d8f..e0817e4c9d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7559,19 +7559,24 @@ (define-public python-feedgenerator
 (define-public python-lsp-jsonrpc
   (package
     (name "python-lsp-jsonrpc")
-    (version "1.0.0")
+    (version "1.1.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "python-lsp-jsonrpc" version))
        (sha256
-        (base32
-         "1gb0fsamxndhplx25v8m0b3k7aknzy454fpa0qsqsqnv6c3igv3v"))))
-    (build-system python-build-system)
-    (native-inputs
-     (list python-mock python-pytest))
-    (propagated-inputs
-     (list python-ujson))
+        (base32 "04n95h0cqnsrdyh1gv0abh2i5ynyrq2wfqpppx9djp7mxr9y9226"))))
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'set-version
+                    (lambda _
+                      (substitute* "pyproject.toml"
+                        (("dynamic = \\[\"version\"\\]")
+                         (string-append "version = \""
+                                        ,version "\""))))))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-mock python-pytest python-pytest-cov))
+    (propagated-inputs (list python-ujson))
     (home-page "https://github.com/python-lsp/python-lsp-jsonrpc")
     (synopsis "JSON RPC 2.0 server library")
     (description
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#70400] [PATCH 6/7] gnu: python-rope: Update to 1.13.0.
  2024-04-15 17:45 64% ` [bug#70400] [PATCH 1/7] gnu: Add python-docstring-to-markdown Jonathan Pieper via Guix-patches via
                     ` (3 preceding siblings ...)
  2024-04-15 17:45 65%   ` [bug#70400] [PATCH 5/7] gnu: python-pydocstyle: Update to 6.3.0 Jonathan Pieper via Guix-patches via
@ 2024-04-15 17:45 61%   ` Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 55%   ` [bug#70400] [PATCH 7/7] gnu: python-lsp-server: Update to 1.11.0 Jonathan Pieper via Guix-patches via
  5 siblings, 0 replies; 200+ results
From: Jonathan Pieper via Guix-patches via @ 2024-04-15 17:45 UTC (permalink / raw)
  To: 70400
  Cc: Jonathan Pieper, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-rope): Update to 1.13.0.
  [arguments]{disable-broken-tests}: Disable test_hint_or.
  [propagated-inputs]: Add python-pytoolconfig.

Change-Id: I0717c76631ca744a0f601734f707f45fa05b62c2
---
 gnu/packages/python-xyz.scm | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 33410c0a06..cead2adb44 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20057,31 +20057,33 @@ (define-public python-cysignals
 (define-public python-rope
   (package
     (name "python-rope")
-    (version "1.1.1")
+    (version "1.13.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "rope" version))
        (sha256
-        (base32
-         "0bkzwkllxxdxd3w70xiy137lqvnlmmaplsc2ya3s23ss4kq8y10k"))))
+        (base32 "1078mkzivz45my8x2y5gxisr0vba630xj7yxx7anr068xhnpshsi"))))
     (build-system python-build-system)
     (arguments
-     (list #:phases
-           `(modify-phases %standard-phases
-              (add-after 'unpack 'disable-broken-test
-                (lambda _
-                  (substitute* "ropetest/contrib/autoimporttest.py"
-                    (("def test_search_module")
-                     "def __notest_search_module")
-                    (("def test_search_submodule")
-                     "def __notest_search_submodule")))))))
-    (native-inputs
-     (list python-pytest-timeout
-           python-pytest))
+     (list
+      #:phases `(modify-phases %standard-phases
+                  (add-after 'unpack 'disable-broken-test
+                    (lambda _
+                      (substitute* "ropetest/contrib/autoimporttest.py"
+                        (("def test_search_module")
+                         "def __notest_search_module")
+                        (("def test_search_submodule")
+                         "def __notest_search_submodule"))
+                      (substitute* "ropetest/type_hinting_test.py"
+                        (("def test_hint_or")
+                         "def __notest_hint_or")))))))
+    (native-inputs (list python-pytest-timeout python-pytest))
+    (propagated-inputs (list python-pytoolconfig))
     (home-page "https://github.com/python-rope/rope")
     (synopsis "Refactoring library for Python")
-    (description "Rope is a refactoring library for Python.  It facilitates
+    (description
+     "Rope is a refactoring library for Python.  It facilitates
 the renaming, moving and extracting of attributes, functions, modules, fields
 and parameters in Python source code.  These refactorings can also be applied
 to occurrences in strings and comments.")
-- 
2.41.0





^ permalink raw reply related	[relevance 61%]

* [bug#70400] [PATCH 5/7] gnu: python-pydocstyle: Update to 6.3.0.
  2024-04-15 17:45 64% ` [bug#70400] [PATCH 1/7] gnu: Add python-docstring-to-markdown Jonathan Pieper via Guix-patches via
                     ` (2 preceding siblings ...)
  2024-04-15 17:45 64%   ` [bug#70400] [PATCH 4/7] gnu: python-snowballstemmer: Update to 2.2.0 Jonathan Pieper via Guix-patches via
@ 2024-04-15 17:45 65%   ` Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 61%   ` [bug#70400] [PATCH 6/7] gnu: python-rope: Update to 1.13.0 Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 55%   ` [bug#70400] [PATCH 7/7] gnu: python-lsp-server: Update to 1.11.0 Jonathan Pieper via Guix-patches via
  5 siblings, 0 replies; 200+ results
From: Jonathan Pieper via Guix-patches via @ 2024-04-15 17:45 UTC (permalink / raw)
  To: 70400
  Cc: Jonathan Pieper, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-pydocstyle): Update to 6.3.0.

Change-Id: I1c2bfcee80cbdac33adaf08968276954d72182dc
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 82833e876b..33410c0a06 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7852,14 +7852,14 @@ (define-public python-pydoc-markdown
 (define-public python-pydocstyle
   (package
     (name "python-pydocstyle")
-    (version "3.0.0")
+    (version "6.3.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pydocstyle" version))
        (sha256
         (base32
-         "1m1xv9clkg9lgzyza6dnj359z04vh5g0h49nhzghv7lg81gchhap"))))
+         "1qa4gqmwgvakdd6j0zw0fvr6ygmpq1ib9h5r9r4hfyy81863zr3w"))))
     (build-system python-build-system)
     (propagated-inputs
      (list python-six python-snowballstemmer))
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70400] [PATCH 7/7] gnu: python-lsp-server: Update to 1.11.0.
  2024-04-15 17:45 64% ` [bug#70400] [PATCH 1/7] gnu: Add python-docstring-to-markdown Jonathan Pieper via Guix-patches via
                     ` (4 preceding siblings ...)
  2024-04-15 17:45 61%   ` [bug#70400] [PATCH 6/7] gnu: python-rope: Update to 1.13.0 Jonathan Pieper via Guix-patches via
@ 2024-04-15 17:45 55%   ` Jonathan Pieper via Guix-patches via
  5 siblings, 0 replies; 200+ results
From: Jonathan Pieper via Guix-patches via @ 2024-04-15 17:45 UTC (permalink / raw)
  To: 70400
  Cc: Jonathan Pieper, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-lsp-server): Update to 1.11.0.
  [build-system]: Change to pyproject-build-system.
  [arguments]{set-version}: Set version explicitly to pass sanity-check.
  {check}: Do not replace it as test_pyqt_completion is no longer failing.
  [propagated-inputs]: Remove python-future and add python-docstring-to-markdown.
  [native-inputs]: Remove python-mock, python-versioneer and add python-whatthepatch, python-pyqt.

Change-Id: I937730caaae394141af13881a107157868b18bab
---
 gnu/packages/python-xyz.scm | 75 ++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 38 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index cead2adb44..586d83a8cb 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -152,6 +152,7 @@
 ;;; Copyright © 2024 Adriel Dumas--Jondeau <leirda@disroot.org>
 ;;; Copyright © 2024 Navid Afkhami <navid.afkhami@mdc-berlin.de>
 ;;; Copyright © 2024 TakeV <takev@disroot.org>
+;;; Copyright © 2024 Jonathan Pieper <jpieper@mailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -7874,53 +7875,51 @@ (define-public python-pydocstyle
 (define-public python-lsp-server
   (package
     (name "python-lsp-server")
-    (version "1.3.3")
+    (version "1.11.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "python-lsp-server" version))
        (sha256
-        (base32
-         "0h6wxzmm6qjfwkkn3mnzn1fpmcp23fpbk74bi8p540q1nzccqj0v"))))
-    (build-system python-build-system)
+        (base32 "11lf7c9dpf8jzz5y7dllz8l1lka887m9a79xbazy8lkq7zxxdvc9"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-before 'check 'set-HOME
-           (lambda _ (setenv "HOME" "/tmp")))
-         (replace 'check
-           (lambda _
-             ;; Disable failing test.
-             (invoke "python" "-m" "pytest" "-k"
-                     "not test_pyqt_completion"))))))
-    (propagated-inputs
-     (list python-autopep8
-           python-pydocstyle
-           python-flake8
-           python-future
-           python-jedi
-           python-lsp-jsonrpc
-           python-pluggy
-           python-pycodestyle
-           python-pyflakes
-           python-rope
-           python-ujson
-           python-yapf))
-    (native-inputs
-     (list python-coverage
-           python-flaky
-           python-matplotlib
-           python-mock
-           python-numpy
-           python-pandas
-           python-pylint
-           python-pytest
-           python-pytest-cov
-           python-versioneer))
+     `(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'set-version
+                    (lambda _
+                      (substitute* "pyproject.toml"
+                        (("dynamic = \\[\"version\"\\]")
+                         (string-append "version = \""
+                                        ,version "\"")))))
+                  (add-before 'check 'set-HOME
+                    (lambda _
+                      (setenv "HOME" "/tmp"))))))
+    (propagated-inputs (list python-autopep8
+                             python-docstring-to-markdown
+                             python-pydocstyle
+                             python-flake8
+                             python-jedi
+                             python-lsp-jsonrpc
+                             python-pluggy
+                             python-pycodestyle
+                             python-pyflakes
+                             python-rope
+                             python-ujson
+                             python-yapf))
+    (native-inputs (list python-coverage
+                         python-flaky
+                         python-matplotlib
+                         python-numpy
+                         python-pandas
+                         python-pylint
+                         python-pyqt
+                         python-pytest
+                         python-pytest-cov
+                         python-whatthepatch))
     (home-page "https://github.com/python-lsp/python-lsp-server")
     (synopsis "Python implementation of the Language Server Protocol")
     (description
-"The Python Language Server @command{pylsp} is an implementation of the
+     "The Python Language Server @command{pylsp} is an implementation of the
 Python 3 language specification for the Language Server Protocol (LSP).
 This tool is used in text editing environments to provide a complete
 and integrated feature-set for programming Python effectively.")
-- 
2.41.0





^ permalink raw reply related	[relevance 55%]

* [bug#70400] [PATCH 2/7] gnu: Add python-pytoolconfig.
  2024-04-15 17:45 64% ` [bug#70400] [PATCH 1/7] gnu: Add python-docstring-to-markdown Jonathan Pieper via Guix-patches via
@ 2024-04-15 17:45 61%   ` Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 63%   ` [bug#70400] [PATCH 3/7] gnu: python-lsp-jsonrpc: Update to 1.1.2 Jonathan Pieper via Guix-patches via
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Jonathan Pieper via Guix-patches via @ 2024-04-15 17:45 UTC (permalink / raw)
  To: 70400
  Cc: Jonathan Pieper, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9521119a84..27107c3d8f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -36309,6 +36309,58 @@ (define-public python-zeroc-ice-3.6
                (base32
                 "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2"))))))
 
+(define-public python-pytoolconfig
+  (package
+    (name "python-pytoolconfig")
+    (version "1.2.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytoolconfig" version))
+       (sha256
+        (base32 "18isxi4ijarl949d0zmf0b4606r6hihpi3p5yb7763m4c7ra24i5"))))
+    (build-system pyproject-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'update-license
+                    (lambda _
+                      (substitute* "pyproject.toml"
+                        (("license-expression = (\"[^\"]*\")" all license)
+                         (string-append "license = {text = " license "}")))))
+                  (add-after 'unpack 'remove-mypy
+                    (lambda _
+                      (substitute* "pyproject.toml"
+                        (("^.*mypy.*")
+                         "")
+                        (("strict = true")
+                         ""))))
+                  (add-after 'unpack 'use-pdm-backend-instead-of-pep517
+                    (lambda _
+                      (substitute* "pyproject.toml"
+                        (("pdm-pep517")
+                         "pdm-backend")
+                        (("pdm\\.pep517\\.api")
+                         "pdm.backend"))))
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        ;; Disable failing test.
+                        (invoke "python" "-m" "pytest" "-k"
+                                "not test_documentation")))))))
+    (native-inputs (list python-pdm-backend
+                         python-tomli
+                         python-pytest
+                         python-docutils
+                         python-sphinx
+                         python-tabulate))
+    (propagated-inputs (list python-appdirs))
+    (home-page "https://github.com/bagel897/pytoolconfig")
+    (synopsis "Python Tool Configuration")
+    (description
+     "This module manages configuration for python tools,
+such as rope and add support for a pyproject.toml configuration file.")
+    (license license:lgpl3+)))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar
-- 
2.41.0





^ permalink raw reply related	[relevance 61%]

* [bug#70400] [PATCH 1/7] gnu: Add python-docstring-to-markdown.
  @ 2024-04-15 17:45 64% ` Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 61%   ` [bug#70400] [PATCH 2/7] gnu: Add python-pytoolconfig Jonathan Pieper via Guix-patches via
                     ` (5 more replies)
  0 siblings, 6 replies; 200+ results
From: Jonathan Pieper via Guix-patches via @ 2024-04-15 17:45 UTC (permalink / raw)
  To: 70400
  Cc: Jonathan Pieper, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-docstring-to-markdown): New variable.
---
 gnu/packages/python-xyz.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 92566abfed..9521119a84 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1376,6 +1376,25 @@ (define-public python-mkdocs-markdownextradata-plugin
 variables into the markdown template")
     (license license:expat)))
 
+(define-public python-docstring-to-markdown
+  (package
+    (name "python-docstring-to-markdown")
+    (version "0.15")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "docstring-to-markdown" version))
+       (sha256
+        (base32 "0gdpabnyl1kyy0cjrnph6xl4fyhgim50a1amsaqq3hahki6i2ip1"))))
+    (build-system python-build-system)
+    (home-page "https://github.com/python-lsp/docstring-to-markdown")
+    (synopsis "On the fly conversion of Python docstrings to markdown")
+    (description
+     "This module can convert Python docstrings to Markdown.
+It can recognise reStructuredText inside docstrings and convert multiple of its
+features to Markdown. It also includes initial support for Google-formatted docstrings.")
+    (license license:lgpl2.1+)))
+
 (define-public python-mysql-connector-python
   (package
     (name "python-mysql-connector-python")

base-commit: 6b3c90f638292f9604a221ac6dbf22234f6e4c4b
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#70400] [PATCH 4/7] gnu: python-snowballstemmer: Update to 2.2.0.
  2024-04-15 17:45 64% ` [bug#70400] [PATCH 1/7] gnu: Add python-docstring-to-markdown Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 61%   ` [bug#70400] [PATCH 2/7] gnu: Add python-pytoolconfig Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 63%   ` [bug#70400] [PATCH 3/7] gnu: python-lsp-jsonrpc: Update to 1.1.2 Jonathan Pieper via Guix-patches via
@ 2024-04-15 17:45 64%   ` Jonathan Pieper via Guix-patches via
  2024-04-15 17:45 65%   ` [bug#70400] [PATCH 5/7] gnu: python-pydocstyle: Update to 6.3.0 Jonathan Pieper via Guix-patches via
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Jonathan Pieper via Guix-patches via @ 2024-04-15 17:45 UTC (permalink / raw)
  To: 70400
  Cc: Jonathan Pieper, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-snowballstemmer): Update to 2.2.0.
---
 gnu/packages/python-xyz.scm | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e0817e4c9d..82833e876b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -22562,20 +22562,21 @@ (define-public python-random2
 (define-public python-snowballstemmer
   (package
     (name "python-snowballstemmer")
-    (version "2.0.0")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "snowballstemmer" version))
-              (sha256
-               (base32
-                "0ligk61idlz8kkgd5hpip5whm172riwglb6xydii7h62yhysqfyz"))))
+    (version "2.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "snowballstemmer" version))
+       (sha256
+        (base32 "1ccwy75i0f5yi1vy6fyvr1gf43ydhjani45mswm43ls7hpmnvc89"))))
     (build-system python-build-system)
     (arguments
-     `(;; No tests exist
-       #:tests? #f))
+     `( ;No tests exist
+        #:tests? #f))
     (home-page "https://github.com/shibukawa/snowball_py")
     (synopsis "Snowball stemming library collection for Python")
-    (description "This package provides 16 word stemmer algorithms generated
+    (description
+     "This package provides 16 word stemmer algorithms generated
      from Snowball algorithms.  It includes the 15 original ones plus the Poerter
      English stemmer.")
     (license license:bsd-3)))
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#70393] [PATCH] gnu: python-pydevd: Use gdb/pinned.
@ 2024-04-15  8:25 65% Christopher Baines
  0 siblings, 0 replies; 200+ results
From: Christopher Baines @ 2024-04-15  8:25 UTC (permalink / raw)
  To: 70393
  Cc: Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

To allow gdb to be updated more easily.

* gnu/packages/python-xyz.scm (python-pydevd)[inputs]: Use gdb/pinned.

Change-Id: Icf417f89933bc190bf4c0d869c199cfe50d463ef
---
 gnu/packages/python-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 92566abfed..a19422aa4a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16471,7 +16471,7 @@ (define-public python-pydevd
              python-pytest-xdist
              python-trio
              python-untangle))
-      (inputs (list coreutils gdb procps))
+      (inputs (list coreutils gdb/pinned procps))
       (home-page "https://github.com/fabioz/PyDev.Debugger/")
       (synopsis "Python debugger")
       (description "PyDev.Debugger is a capable Python debugger used in PyDev

base-commit: 4e7337536ba41e888a601c92fada8a4adca9d2c6
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70305] [PATCH 1/5] gnu: coin3D: Rename to coin3d.
  @ 2024-04-09 10:22 58% ` Jean-Pierre De Jesus DIAZ
  0 siblings, 0 replies; 200+ results
From: Jean-Pierre De Jesus DIAZ @ 2024-04-09 10:22 UTC (permalink / raw)
  To: 70305
  Cc: Jean-Pierre De Jesus DIAZ, Lars-Dominik Braun, Marius Bakke,
	Maxim Cournoyer, Munyoki Kilyungi, Sharlatan Hellseher,
	Tanguy Le Carrour, jgart, 宋文武

* gnu/packages/graphics.scm (coin3d): New Variable.
(coin3D): Define as deprecated.
(coin3D-4): Point to coin3d.
* gnu/packages/engineering.scm (freecad): Use coin3d instead of coin3D.
* gnu/packages/python-xyz.scm (python-pivy): Ditto.
* gnu/packages/qt.scm (soqt): Ditto.

Change-Id: I4e83e25e80c512350f38024847891eac14723f26
---
 gnu/packages/engineering.scm | 2 +-
 gnu/packages/graphics.scm    | 9 ++++++---
 gnu/packages/python-xyz.scm  | 2 +-
 gnu/packages/qt.scm          | 2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 6f42d674e5..7a60036c28 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -2816,7 +2816,7 @@ (define-public freecad
            swig))
     (inputs
      (list boost
-           coin3D
+           coin3d
            double-conversion
            eigen
            fmt
diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm
index a63629823a..ebbc705cfc 100644
--- a/gnu/packages/graphics.scm
+++ b/gnu/packages/graphics.scm
@@ -1951,9 +1951,9 @@ (define-public opencsg
       (home-page "https://www.opencsg.org/")
       (license license:gpl2))))
 
-(define-public coin3D
+(define-public coin3d
   (package
-    (name "coin3D")
+    (name "coin3d")
     (version "4.0.0")
     (source
      (origin
@@ -2001,7 +2001,10 @@ (define-public coin3D
 and engineering community.")
     (license license:bsd-3)))
 
-(define-deprecated coin3D-4 coin3D)
+(define-deprecated coin3D coin3d)
+(export coin3D)
+
+(define-deprecated coin3D-4 coin3d)
 (export coin3D-4)
 
 (define-public skia
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 92566abfed..44c709a880 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32421,7 +32421,7 @@ (define-public python-pivy
             libice
             soqt
             glew
-            coin3D))
+            coin3d))
     (home-page "https://github.com/coin3d/pivy")
     (synopsis "Python bindings to Coin3D")
     (description
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index dcc9bfeb62..2f23e292e8 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -5115,7 +5115,7 @@ (define-public soqt
     (native-inputs
       (list pkg-config cmake))
     (inputs
-      (list qtbase-5 coin3D))
+      (list qtbase-5 coin3d))
     (home-page "https://github.com/coin3d/soqt")
     (synopsis "Qt GUI component toolkit library for Coin")
     (description "SoQt is a Qt GUI component toolkit library for Coin.  It is
-- 
2.41.0





^ permalink raw reply related	[relevance 58%]

* [bug#70269] [PATCH] gnu: Add python-pybadges.
@ 2024-04-07 22:13 63% Giacomo Leidi via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Giacomo Leidi via Guix-patches via @ 2024-04-07 22:13 UTC (permalink / raw)
  To: 70269
  Cc: Giacomo Leidi, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-web.scm (python-pybadges): New variable.

Change-Id: Idd53ddf94b24112015c0a0b82396cf366920417e
---
 gnu/packages/python-web.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 9ad081beb1..da4f019476 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -9123,6 +9123,40 @@ (define-public python-whatthepatch
      "This package provides a library to parse and apply patches.")
     (license license:expat)))
 
+(define-public python-pybadges
+  (package
+    (name "python-pybadges")
+    (version "3.0.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/google/pybadges")
+                    (commit (string-append version))))
+              (file-name (git-file-name name version))
+              (sha256
+               "1zgb9idz7m3mzf8wvik0gwmyrxp753axqjv2pab326cr5myj1s4b")))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      #~'("-k"
+          ;; Disable network dependent tests.
+          "not test_changes and not test_not_image_url and not test_http_url")))
+    (propagated-inputs (list python-jinja2 python-requests))
+    (native-inputs (list python-flask
+                         python-fonttools
+                         python-nox
+                         python-pillow
+                         python-pytest
+                         python-xmldiff))
+    (home-page "https://github.com/google/pybadges")
+    (synopsis
+     "Libbrary and command-line tool for generating Github-style badges")
+    (description
+     "This package provides @code{python-pybadges}: a library and command-line
+tool for generating Github-style badges.")
+    (license license:asl2.0)))
+
 (define-public python-grid5000
   (package
     (name "python-grid5000")

base-commit: 69951a61a1d8f1f2135ea2dc836738be282b97bc
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#70268] [PATCH] gnu: Add python-vdf.
@ 2024-04-07 21:49 65% Giacomo Leidi via Guix-patches via
    0 siblings, 1 reply; 200+ results
From: Giacomo Leidi via Guix-patches via @ 2024-04-07 21:49 UTC (permalink / raw)
  To: 70268
  Cc: Giacomo Leidi, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-vdf): New variable.

Change-Id: Ie8a14292b9c9937d22f011ac078562e81abd6b36
---
 gnu/packages/python-xyz.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0ac9d669d3..2326aa4323 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6761,6 +6761,23 @@ (define-public python-pygments
      "Pygments is a syntax highlighting package written in Python.")
     (license license:bsd-2)))
 
+(define-public python-vdf
+  (package
+    (name "python-vdf")
+    (version "3.4")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "vdf" version))
+              (sha256
+               (base32
+                "1bz2gn04pl6rj2mawlzlirz1ygg4rdypq0pxbyg018873vs1jm7x"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/ValvePython/vdf")
+    (synopsis "Work with Valve's VDF text format")
+    (description "This packages provides @code{python-vdf}, a library for
+working with Valve's VDF text format.")
+    (license license:expat)))
+
 (define-public python-pygments-github-lexers
   (package
     (name "python-pygments-github-lexers")

base-commit: 69951a61a1d8f1f2135ea2dc836738be282b97bc
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#66208] [PATCH v2 1/1] gnu: Add python-shshsh.
  @ 2024-04-04 21:46 64%   ` Steve George
  0 siblings, 0 replies; 200+ results
From: Steve George @ 2024-04-04 21:46 UTC (permalink / raw)
  To: 66208; +Cc: arnav.jose, steve, lars, marius, me, sharlatanus, tanguy, jgart

From: Andrew Jose <arnav.jose@gmail.com>

* gnu/packages/python-xyz.scm (python-shshsh): New variable.

Reviewed-by: Steve George <steve@futurile.net>
Change-Id: Iadd75c769a4391195b32789590f94fd8afbe21b6
---
 gnu/packages/python-xyz.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index cd10f304c83..f201b3ec31e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20738,6 +20738,35 @@ (define-public python-shellingham
 running in.")
     (license license:isc)))
 
+(define-public python-shshsh
+  (package
+   (name "python-shshsh")
+   (version "1.0.5")
+   (source
+    (origin
+     (method git-fetch)
+     (uri
+       (git-reference
+         (url "https://github.com/zqqqqz2000/shshsh")
+         (commit
+           "fd21c8696aebaae04507760c16cb45979291fef5")))
+       (file-name (git-file-name name version))
+       (sha256
+         (base32
+           "1wzqyj1a6jj6cyv5ymzy834qm2lyq80yy1kfz0q0zayq9gm1cj7f"))))
+   (build-system pyproject-build-system)
+   (native-inputs
+     (list python-poetry-core
+           python-pytest
+           python-tox))
+   (home-page "https://github.com/zqqqqz2000/shshsh")
+   (synopsis "Write Shell commands simply and safely within Python")
+   (description "This package provides a way to write Shell commands from
+within Python.  Python functions can be chained together to process input
+Bash control characters are escapted so that parameters can be passed
+without worrying about command injection.")
+   (license license:expat)))
+
 (define-public python-memcached
   (package
     (name "python-memcached")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#70179] [PATCH v2 1/3] gnu: python-certifi: Use system SSL certificates.
  @ 2024-04-04  5:56 62% ` Efraim Flashner
  2024-04-04  5:56 62% ` [bug#70179] [PATCH v2 2/3] gnu: python-pip: " Efraim Flashner
  2024-04-04  5:56 55% ` [bug#70179] [PATCH v2 3/3] gnu: python: " Efraim Flashner
  2 siblings, 0 replies; 200+ results
From: Efraim Flashner @ 2024-04-04  5:56 UTC (permalink / raw)
  To: 70179; +Cc: Efraim Flashner

* gnu/packages/python-crypto.scm (python-certifi)[replacement]: New
field.
(python-certifi/fixed): Provide a python-certifi which only offers to
use the system's SSL certificates.

Change-Id: Ie1871be42988dff3cccfe24bca626149fee0f371
---
 gnu/packages/python-crypto.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index 3e1472a6c9..05b6c82fd9 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -469,6 +469,7 @@ (define-public python-certifi
   (package
     (name "python-certifi")
     (version "2022.6.15")
+    (replacement python-certifi/fixed)
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "certifi" version))
@@ -484,6 +485,39 @@ (define-public python-certifi
 is used by the Requests library to verify HTTPS requests.")
     (license license:asl2.0)))
 
+(define python-certifi/fixed
+  (package
+    (inherit python-certifi)
+    (source (origin
+              (inherit (package-source python-certifi))
+              (snippet
+               #~(begin
+                   (delete-file "certifi/cacert.pem")
+                   (delete-file "certifi/core.py")
+                   (with-output-to-file "certifi/core.py"
+                     (lambda _
+                       (display "\"\"\"
+certifi.py
+~~~~~~~~~~
+This module returns the installation location of SSL_CERT_FILE or
+/etc/ssl/certs/ca-certificates.crt, or its contents.
+\"\"\"
+import os
+
+_CA_CERTS = None
+
+try:
+    _CA_CERTS = os.environ [\"SSL_CERT_FILE\"]
+except:
+    _CA_CERTS = os.path.join(\"/etc\", \"ssl\", \"certs\", \"ca-certificates.crt\")
+
+def where() -> str:
+    return _CA_CERTS
+
+def contents() -> str:
+    with open(where(), \"r\", encoding=\"ascii\") as data:
+        return data.read()")))))))))
+
 (define-public python-cryptography-vectors
   (package
     (name "python-cryptography-vectors")
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





^ permalink raw reply related	[relevance 62%]

* [bug#70179] [PATCH v2 2/3] gnu: python-pip: Use system SSL certificates.
    2024-04-04  5:56 62% ` [bug#70179] [PATCH v2 1/3] gnu: python-certifi: Use system SSL certificates Efraim Flashner
@ 2024-04-04  5:56 62% ` Efraim Flashner
  2024-04-04  5:56 55% ` [bug#70179] [PATCH v2 3/3] gnu: python: " Efraim Flashner
  2 siblings, 0 replies; 200+ results
From: Efraim Flashner @ 2024-04-04  5:56 UTC (permalink / raw)
  To: 70179; +Cc: Efraim Flashner

* gnu/packages/python-build.scm (python-pip)[replacement]: New
field.
(python-pip/fixed): Provide a python-pip with a patched python-certifi
which only offers to use the system's SSL certificates.

Change-Id: Icea0769b881dc8d760562f0405fa8ea8167a4bd4
---
 gnu/packages/python-build.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 2ea457cdba..5b71d1502e 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -260,6 +260,7 @@ (define-public python-pip
   (package
     (name "python-pip")
     (version "23.1")
+    (replacement python-pip/fixed)
     (source
      (origin
        (method url-fetch)
@@ -277,6 +278,39 @@ (define-public python-pip
 Python Package Index (PyPI).")
     (license license:expat)))
 
+(define python-pip/fixed
+  (package
+    (inherit python-pip)
+    (source (origin
+              (inherit (package-source python-pip))
+              (snippet
+               #~(begin
+                   (delete-file "src/pip/_vendor/certifi/cacert.pem")
+                   (delete-file "src/pip/_vendor/certifi/core.py")
+                   (with-output-to-file "src/pip/_vendor/certifi/core.py"
+                     (lambda _
+                       (display "\"\"\"
+certifi.py
+~~~~~~~~~~
+This module returns the installation location of SSL_CERT_FILE or
+/etc/ssl/certs/ca-certificates.crt, or its contents.
+\"\"\"
+import os
+
+_CA_CERTS = None
+
+try:
+    _CA_CERTS = os.environ [\"SSL_CERT_FILE\"]
+except:
+    _CA_CERTS = os.path.join(\"/etc\", \"ssl\", \"certs\", \"ca-certificates.crt\")
+
+def where() -> str:
+    return _CA_CERTS
+
+def contents() -> str:
+    with open(where(), \"r\", encoding=\"ascii\") as data:
+        return data.read()")))))))))
+
 (define-public python-setuptools
   (package
     (name "python-setuptools")
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





^ permalink raw reply related	[relevance 62%]

* [bug#70179] [PATCH v2 3/3] gnu: python: Use system SSL certificates.
    2024-04-04  5:56 62% ` [bug#70179] [PATCH v2 1/3] gnu: python-certifi: Use system SSL certificates Efraim Flashner
  2024-04-04  5:56 62% ` [bug#70179] [PATCH v2 2/3] gnu: python-pip: " Efraim Flashner
@ 2024-04-04  5:56 55% ` Efraim Flashner
  2 siblings, 0 replies; 200+ results
From: Efraim Flashner @ 2024-04-04  5:56 UTC (permalink / raw)
  To: 70179; +Cc: Efraim Flashner

* gnu/packages/python.scm (python)[replacement]: New field.
(python/fixed): Provide a python with a patched python-certifi which
only offers to use the system's SSL certificates.

Change-Id: Ic5bcfb6b32282a7e0628232b1dc4cd60f3f2da52
---
 gnu/packages/python.scm | 67 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 12a5148cb1..3ad4c5d5e7 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -96,6 +96,7 @@ (define-module (gnu packages python)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix search-paths)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
@@ -424,6 +425,7 @@ (define-public python-3.10
     (inherit python-2)
     (name "python")
     (version "3.10.7")
+    (replacement python-3.10/fixed)
     (source (origin
               (method url-fetch)
               (uri (string-append "https://www.python.org/ftp/python/"
@@ -590,6 +592,7 @@ (define-public python-3.10
            inputs)))
     (native-search-paths
      (list (guix-pythonpath-search-path version)
+           $SSL_CERT_FILE
            ;; Used to locate tzdata by the zoneinfo module introduced in
            ;; Python 3.9.
            (search-path-specification
@@ -982,6 +985,70 @@ (define-public python-3.12
     (properties '((cpe-name . "python")))
     (license license:psfl)))
 
+(define python-3.10/fixed
+  (package
+    (inherit python-3.10)
+    (arguments
+     (substitute-keyword-arguments (package-arguments python-3.10)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            ;; Also remove the bundled CA certificates.
+            ;; TODO: Rename this phase when merging back into python.
+            (replace 'remove-windows-binaries
+              (lambda _
+                ;; Delete .exe from embedded .whl (zip) files
+                (for-each
+                 (lambda (whl)
+                   (let ((dir "whl-content")
+                         (circa-1980 (* 10 366 24 60 60)))
+                     (mkdir-p dir)
+                     (with-directory-excursion dir
+                       (let ((whl (string-append "../" whl)))
+                         (invoke "unzip" whl)
+                         (for-each delete-file
+                                   (find-files "." "\\.exe$"))
+                         (delete-file whl)
+
+                         ;; Search for cacert.pem, delete it, and rewrite the
+                         ;; file which directs python to look for it.
+                         (let ((cacert (find-files "." "cacert\\.pem")))
+                           (unless (null? cacert)
+                             (let ((certifi (dirname (car cacert))))
+                               (delete-file (string-append certifi "/cacert.pem"))
+                               (delete-file (string-append certifi "/core.py"))
+                               (with-output-to-file (string-append certifi "/core.py")
+                                 (lambda _
+                                   (display "\"\"\"
+certifi.py
+~~~~~~~~~~
+This module returns the installation location of SSL_CERT_FILE or
+/etc/ssl/certs/ca-certificates.crt, or its contents.
+\"\"\"
+import os
+
+_CA_CERTS = None
+
+try:
+    _CA_CERTS = os.environ [\"SSL_CERT_FILE\"]
+except:
+    _CA_CERTS = os.path.join(\"/etc\", \"ssl\", \"certs\", \"ca-certificates.crt\")
+
+def where() -> str:
+    return _CA_CERTS
+
+def contents() -> str:
+    with open(where(), \"r\", encoding=\"ascii\") as data:
+        return data.read()"))))))
+
+                         ;; Reset timestamps to prevent them from ending
+                         ;; up in the Zip archive.
+                         (ftw "." (lambda (file stat flag)
+                                    (utime file circa-1980 circa-1980)
+                                    #t))
+                         (apply invoke "zip" "-X" whl
+                                (find-files "." #:directories? #t))))
+                     (delete-file-recursively dir)))
+                 (find-files "Lib/ensurepip" "\\.whl$"))))))))))
 
 ;; Next 3.x version.
 (define-public python-next python-3.12)
-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





^ permalink raw reply related	[relevance 55%]

* [bug#70171] [PATCH 2/3] gnu: Add python-zipstream-ng.
    2024-04-03 22:21 65% ` [bug#70171] [PATCH 1/3] gnu: Add python-iterable-io TakeV via Guix-patches via
@ 2024-04-03 22:21 64% ` TakeV via Guix-patches via
  1 sibling, 0 replies; 200+ results
From: TakeV via Guix-patches via @ 2024-04-03 22:21 UTC (permalink / raw)
  To: 70171
  Cc: TakeV, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-zipstream-ng): New variable.

Change-Id: Idf0c0d471aa1eda45cf649874f6a79b6b9a7937b
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9487b1fac9..e2afdc9024 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -36236,6 +36236,24 @@ (define-public python-zeroc-ice-3.6
                (base32
                 "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2"))))))
 
+(define-public python-zipstream-ng
+  (package
+    (name "python-zipstream-ng")
+    (version "1.7.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "zipstream-ng" version))
+       (sha256
+        (base32 "1z4zdqqs2rg3z36khgj96bpggv34av337isfv7yxg32prawj687r"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-pytest python-pytest-cov))
+    (home-page "https://github.com/pR0Ps/zipstream-ng")
+    (synopsis "A modern and easy to use streamable zip file generator")
+    (description
+     "This package provides a modern and easy to use streamable zip file generator")
+    (license license:lgpl3)))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#70171] [PATCH 1/3] gnu: Add python-iterable-io.
  @ 2024-04-03 22:21 65% ` TakeV via Guix-patches via
  2024-04-03 22:21 64% ` [bug#70171] [PATCH 2/3] gnu: Add python-zipstream-ng TakeV via Guix-patches via
  1 sibling, 0 replies; 200+ results
From: TakeV via Guix-patches via @ 2024-04-03 22:21 UTC (permalink / raw)
  To: 70171
  Cc: TakeV, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-iterable-io): New variable.

Change-Id: Icd4b10e27b5f4963fd3e3ea516676e84b3c5ecd4
---
 gnu/packages/python-xyz.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index cd10f304c8..9487b1fac9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -34979,6 +34979,23 @@ (define-public python-itemloaders
 parsing rules in a single place.")
     (license license:bsd-3)))
 
+(define-public python-iterable-io
+  (package
+    (name "python-iterable-io")
+    (version "1.0.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "iterable-io" version))
+       (sha256
+        (base32 "0g4cn522n4dv6ly8pwf97dc62rr4f7my38v0bh6vmac7jmrip7pv"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/pR0Ps/iterable-io")
+    (synopsis "Adapt generators and other iterables to a file-like interface")
+    (description
+     "Adapt generators and other iterables to a file-like interface")
+    (license license:lgpl3)))
+
 (define-public python-iteround
   (package
     (name "python-iteround")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70107] [PATCH 1/3] gnu: Add python-colorthief.
  @ 2024-03-31 14:48 65% ` Liliana Marie Prikler
  0 siblings, 0 replies; 200+ results
From: Liliana Marie Prikler @ 2024-03-31 14:48 UTC (permalink / raw)
  To: 70107; +Cc: liliana.prikler, maxim.cournoyer, rg, vivien

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index cd10f304c8..ae984c493b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1078,6 +1078,25 @@ (define-public python-colorful
 as functions or string constants to form colored terminal output.")
     (license license:expat)))
 
+(define-public python-colorthief
+  (package
+    (name "python-colorthief")
+    (version "0.2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "colorthief" version))
+       (sha256
+        (base32 "08bjsmmkihyksms2vgndslln02rvw56lkxz28d39qrnxbg4v1707"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-pillow))
+    (home-page "https://github.com/fengsp/color-thief-py")
+    (synopsis "Grab the color palette from an image.")
+    (description
+     "This package provides a module for grabbing the color palette from an
+image.")
+    (license license:bsd-3)))
+
 (define-public python-construct-classes
   (package
     (name "python-construct-classes")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70089] [PATCH] gnu: python-scikit-optimize: Update to 0.10.1.
@ 2024-03-30 12:30 58% Vinicius Monego
  0 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-30 12:30 UTC (permalink / raw)
  To: 70089; +Cc: Vinicius Monego

* gnu/packages/python-science.scm (python-scikit-optimize): Update to 0.10.1.
[source]: Switch to maintained repository. Remove compatibility patches and
snippet.
* gnu/packages/patches/python-scikit-optimize-1148.patch,
gnu/packages/patches/python-scikit-optimize-1148.patch: Remove files.
* gnu/local.mk (dist_patch_DATA): Remove them.

Change-Id: I6c23c93d3c256b0b97166f80eaeab7f2c7282c5f
---
scikit-optimize was archived by upstream without explanation. One of the (ex) maintainers forked the project and is updating it, seems to be a one man project, but again no annoucement. I noticed that the PyPI page for this package is now held by this new repo. Is it safe to merge?

 gnu/local.mk                                  |   2 -
 .../patches/python-scikit-optimize-1148.patch |  32 --
 .../patches/python-scikit-optimize-1150.patch | 275 ------------------
 gnu/packages/python-science.scm               |  19 +-
 4 files changed, 3 insertions(+), 325 deletions(-)
 delete mode 100644 gnu/packages/patches/python-scikit-optimize-1148.patch
 delete mode 100644 gnu/packages/patches/python-scikit-optimize-1150.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f2b480bded..3d45b8f573 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1947,8 +1947,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-robotframework-source-date-epoch.patch \
   %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
   %D%/packages/patches/python-scikit-bio-1887.patch		\
-  %D%/packages/patches/python-scikit-optimize-1148.patch	\
-  %D%/packages/patches/python-scikit-optimize-1150.patch	\
   %D%/packages/patches/python-typing-inspect-fix.patch		\
   %D%/packages/patches/python-unittest2-python3-compat.patch	\
   %D%/packages/patches/python-unittest2-remove-argparse.patch	\
diff --git a/gnu/packages/patches/python-scikit-optimize-1148.patch b/gnu/packages/patches/python-scikit-optimize-1148.patch
deleted file mode 100644
index 6ad854ab1e..0000000000
--- a/gnu/packages/patches/python-scikit-optimize-1148.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 3a5d5eb90ec9d8d4905c05387748486157cadbbb Mon Sep 17 00:00:00 2001
-From: valtron <valtron2000@gmail.com>
-Date: Tue, 14 Feb 2023 09:56:10 -0700
-Subject: [PATCH] `np.int` -> `int`
-
-`np.int is int` and it was deprecated in numpy 1.20: https://numpy.org/doc/1.20/release/1.20.0-notes.html#deprecations
----
- skopt/space/transformers.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/skopt/space/transformers.py b/skopt/space/transformers.py
-index 68892952..f2dfb164 100644
---- a/skopt/space/transformers.py
-+++ b/skopt/space/transformers.py
-@@ -259,7 +259,7 @@ def transform(self, X):
-         if (self.high - self.low) == 0.:
-             return X * 0.
-         if self.is_int:
--            return (np.round(X).astype(np.int) - self.low) /\
-+            return (np.round(X).astype(int) - self.low) /\
-                    (self.high - self.low)
-         else:
-             return (X - self.low) / (self.high - self.low)
-@@ -272,7 +272,7 @@ def inverse_transform(self, X):
-             raise ValueError("All values should be greater than 0.0")
-         X_orig = X * (self.high - self.low) + self.low
-         if self.is_int:
--            return np.round(X_orig).astype(np.int)
-+            return np.round(X_orig).astype(int)
-         return X_orig
- 
- 
diff --git a/gnu/packages/patches/python-scikit-optimize-1150.patch b/gnu/packages/patches/python-scikit-optimize-1150.patch
deleted file mode 100644
index 0cdf361a80..0000000000
--- a/gnu/packages/patches/python-scikit-optimize-1150.patch
+++ /dev/null
@@ -1,275 +0,0 @@
-From cd74e00d0e4f435d548444e1a5edc20155e371d7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jonas=20T=C3=B8rnes?= <jonas.tornes@gmail.com>
-Date: Wed, 15 Feb 2023 18:47:52 +0100
-Subject: [PATCH 1/5] Update RandomForesetRegressor criterion to be inline with
- scikit-learn change from mse to squared error this has the same funcitonality
-
----
- requirements.txt         |  6 +++---
- setup.py                 |  6 +++---
- skopt/learning/forest.py | 30 +++++++++++++++---------------
- 3 files changed, 21 insertions(+), 21 deletions(-)
-
-diff --git a/requirements.txt b/requirements.txt
-index 1eaa3083a..23ab3d856 100644
---- a/requirements.txt
-+++ b/requirements.txt
-@@ -1,6 +1,6 @@
--numpy>=1.13.3
--scipy>=0.19.1
--scikit-learn>=0.20
-+numpy>=1.23.2
-+scipy>=1.10.0
-+scikit-learn>=1.2.1
- matplotlib>=2.0.0
- pytest
- pyaml>=16.9
-diff --git a/setup.py b/setup.py
-index 8879da880..e7f921765 100644
---- a/setup.py
-+++ b/setup.py
-@@ -42,9 +42,9 @@
-       classifiers=CLASSIFIERS,
-       packages=['skopt', 'skopt.learning', 'skopt.optimizer', 'skopt.space',
-                 'skopt.learning.gaussian_process', 'skopt.sampler'],
--      install_requires=['joblib>=0.11', 'pyaml>=16.9', 'numpy>=1.13.3',
--                        'scipy>=0.19.1',
--                        'scikit-learn>=0.20.0'],
-+      install_requires=['joblib>=0.11', 'pyaml>=16.9', 'numpy>=1.23.2',
-+                        'scipy>=1.10.0',
-+                        'scikit-learn>=1.2.1'],
-       extras_require={
-         'plots':  ["matplotlib>=2.0.0"]
-         }
-diff --git a/skopt/learning/forest.py b/skopt/learning/forest.py
-index 096770c1d..ebde568f5 100644
---- a/skopt/learning/forest.py
-+++ b/skopt/learning/forest.py
-@@ -27,7 +27,7 @@ def _return_std(X, trees, predictions, min_variance):
-     -------
-     std : array-like, shape=(n_samples,)
-         Standard deviation of `y` at `X`. If criterion
--        is set to "mse", then `std[i] ~= std(y | X[i])`.
-+        is set to "squared_error", then `std[i] ~= std(y | X[i])`.
- 
-     """
-     # This derives std(y | x) as described in 4.3.2 of arXiv:1211.0906
-@@ -61,9 +61,9 @@ class RandomForestRegressor(_sk_RandomForestRegressor):
-     n_estimators : integer, optional (default=10)
-         The number of trees in the forest.
- 
--    criterion : string, optional (default="mse")
-+    criterion : string, optional (default="squared_error")
-         The function to measure the quality of a split. Supported criteria
--        are "mse" for the mean squared error, which is equal to variance
-+        are "squared_error" for the mean squared error, which is equal to variance
-         reduction as feature selection criterion, and "mae" for the mean
-         absolute error.
- 
-@@ -194,7 +194,7 @@ class RandomForestRegressor(_sk_RandomForestRegressor):
-     .. [1] L. Breiman, "Random Forests", Machine Learning, 45(1), 5-32, 2001.
- 
-     """
--    def __init__(self, n_estimators=10, criterion='mse', max_depth=None,
-+    def __init__(self, n_estimators=10, criterion='squared_error', max_depth=None,
-                  min_samples_split=2, min_samples_leaf=1,
-                  min_weight_fraction_leaf=0.0, max_features='auto',
-                  max_leaf_nodes=None, min_impurity_decrease=0.,
-@@ -228,20 +228,20 @@ def predict(self, X, return_std=False):
-         Returns
-         -------
-         predictions : array-like of shape = (n_samples,)
--            Predicted values for X. If criterion is set to "mse",
-+            Predicted values for X. If criterion is set to "squared_error",
-             then `predictions[i] ~= mean(y | X[i])`.
- 
-         std : array-like of shape=(n_samples,)
-             Standard deviation of `y` at `X`. If criterion
--            is set to "mse", then `std[i] ~= std(y | X[i])`.
-+            is set to "squared_error", then `std[i] ~= std(y | X[i])`.
- 
-         """
-         mean = super(RandomForestRegressor, self).predict(X)
- 
-         if return_std:
--            if self.criterion != "mse":
-+            if self.criterion != "squared_error":
-                 raise ValueError(
--                    "Expected impurity to be 'mse', got %s instead"
-+                    "Expected impurity to be 'squared_error', got %s instead"
-                     % self.criterion)
-             std = _return_std(X, self.estimators_, mean, self.min_variance)
-             return mean, std
-@@ -257,9 +257,9 @@ class ExtraTreesRegressor(_sk_ExtraTreesRegressor):
-     n_estimators : integer, optional (default=10)
-         The number of trees in the forest.
- 
--    criterion : string, optional (default="mse")
-+    criterion : string, optional (default="squared_error")
-         The function to measure the quality of a split. Supported criteria
--        are "mse" for the mean squared error, which is equal to variance
-+        are "squared_error" for the mean squared error, which is equal to variance
-         reduction as feature selection criterion, and "mae" for the mean
-         absolute error.
- 
-@@ -390,7 +390,7 @@ class ExtraTreesRegressor(_sk_ExtraTreesRegressor):
-     .. [1] L. Breiman, "Random Forests", Machine Learning, 45(1), 5-32, 2001.
- 
-     """
--    def __init__(self, n_estimators=10, criterion='mse', max_depth=None,
-+    def __init__(self, n_estimators=10, criterion='squared_error', max_depth=None,
-                  min_samples_split=2, min_samples_leaf=1,
-                  min_weight_fraction_leaf=0.0, max_features='auto',
-                  max_leaf_nodes=None, min_impurity_decrease=0.,
-@@ -425,19 +425,19 @@ def predict(self, X, return_std=False):
-         Returns
-         -------
-         predictions : array-like of shape=(n_samples,)
--            Predicted values for X. If criterion is set to "mse",
-+            Predicted values for X. If criterion is set to "squared_error",
-             then `predictions[i] ~= mean(y | X[i])`.
- 
-         std : array-like of shape=(n_samples,)
-             Standard deviation of `y` at `X`. If criterion
--            is set to "mse", then `std[i] ~= std(y | X[i])`.
-+            is set to "squared_error", then `std[i] ~= std(y | X[i])`.
-         """
-         mean = super(ExtraTreesRegressor, self).predict(X)
- 
-         if return_std:
--            if self.criterion != "mse":
-+            if self.criterion != "squared_error":
-                 raise ValueError(
--                    "Expected impurity to be 'mse', got %s instead"
-+                    "Expected impurity to be 'squared_error', got %s instead"
-                     % self.criterion)
-             std = _return_std(X, self.estimators_, mean, self.min_variance)
-             return mean, std
-
-From 6eb2d4ddaa299ae47d9a69ffb31ebc4ed366d1c1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jonas=20T=C3=B8rnes?= <jonas.tornes@gmail.com>
-Date: Thu, 16 Feb 2023 11:34:58 +0100
-Subject: [PATCH 2/5] Change test to be consistent with code changes.
-
----
- skopt/learning/tests/test_forest.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/skopt/learning/tests/test_forest.py b/skopt/learning/tests/test_forest.py
-index 0711cde9d..c6ed610f3 100644
---- a/skopt/learning/tests/test_forest.py
-+++ b/skopt/learning/tests/test_forest.py
-@@ -35,7 +35,7 @@ def test_random_forest():
-     assert_array_equal(clf.predict(T), true_result)
-     assert 10 == len(clf)
- 
--    clf = RandomForestRegressor(n_estimators=10, criterion="mse",
-+    clf = RandomForestRegressor(n_estimators=10, criterion="squared_error",
-                                 max_depth=None, min_samples_split=2,
-                                 min_samples_leaf=1,
-                                 min_weight_fraction_leaf=0.,
-@@ -80,7 +80,7 @@ def test_extra_forest():
-     assert_array_equal(clf.predict(T), true_result)
-     assert 10 == len(clf)
- 
--    clf = ExtraTreesRegressor(n_estimators=10, criterion="mse",
-+    clf = ExtraTreesRegressor(n_estimators=10, criterion="squared_error",
-                               max_depth=None, min_samples_split=2,
-                               min_samples_leaf=1, min_weight_fraction_leaf=0.,
-                               max_features="auto", max_leaf_nodes=None,
-
-From 52c620add07d845debbaff2ce2b1c5faf3eae79b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jonas=20T=C3=B8rnes?= <jonas.tornes@gmail.com>
-Date: Wed, 22 Feb 2023 16:59:03 +0100
-Subject: [PATCH 3/5] Update skopt/learning/forest.py
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fix max line width
-
-Co-authored-by: Roland Laurès <roland@laures-valdivia.net>
----
- skopt/learning/forest.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/skopt/learning/forest.py b/skopt/learning/forest.py
-index ebde568f5..07dc42664 100644
---- a/skopt/learning/forest.py
-+++ b/skopt/learning/forest.py
-@@ -194,8 +194,8 @@ class RandomForestRegressor(_sk_RandomForestRegressor):
-     .. [1] L. Breiman, "Random Forests", Machine Learning, 45(1), 5-32, 2001.
- 
-     """
--    def __init__(self, n_estimators=10, criterion='squared_error', max_depth=None,
--                 min_samples_split=2, min_samples_leaf=1,
-+    def __init__(self, n_estimators=10, criterion='squared_error',
-+                 max_depth=None, min_samples_split=2, min_samples_leaf=1,
-                  min_weight_fraction_leaf=0.0, max_features='auto',
-                  max_leaf_nodes=None, min_impurity_decrease=0.,
-                  bootstrap=True, oob_score=False,
-
-From 52a7db95cb567186fb4e9003139fea4592bdbf05 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jonas=20T=C3=B8rnes?= <jonas.tornes@gmail.com>
-Date: Wed, 22 Feb 2023 17:03:25 +0100
-Subject: [PATCH 4/5] Fix line widht issues
-
----
- skopt/learning/forest.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/skopt/learning/forest.py b/skopt/learning/forest.py
-index 07dc42664..d4c24456b 100644
---- a/skopt/learning/forest.py
-+++ b/skopt/learning/forest.py
-@@ -390,8 +390,8 @@ class ExtraTreesRegressor(_sk_ExtraTreesRegressor):
-     .. [1] L. Breiman, "Random Forests", Machine Learning, 45(1), 5-32, 2001.
- 
-     """
--    def __init__(self, n_estimators=10, criterion='squared_error', max_depth=None,
--                 min_samples_split=2, min_samples_leaf=1,
-+    def __init__(self, n_estimators=10, criterion='squared_error',
-+                 max_depth=None, min_samples_split=2, min_samples_leaf=1,
-                  min_weight_fraction_leaf=0.0, max_features='auto',
-                  max_leaf_nodes=None, min_impurity_decrease=0.,
-                  bootstrap=False, oob_score=False,
-
-From 6b185e489fb4a56625e8505292a20c80434f0633 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jonas=20T=C3=B8rnes?= <jonas.tornes@gmail.com>
-Date: Wed, 22 Feb 2023 18:37:11 +0100
-Subject: [PATCH 5/5] Fix lin width issues for comments.
-
----
- skopt/learning/forest.py | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/skopt/learning/forest.py b/skopt/learning/forest.py
-index d4c24456b..eb3bd6648 100644
---- a/skopt/learning/forest.py
-+++ b/skopt/learning/forest.py
-@@ -63,9 +63,9 @@ class RandomForestRegressor(_sk_RandomForestRegressor):
- 
-     criterion : string, optional (default="squared_error")
-         The function to measure the quality of a split. Supported criteria
--        are "squared_error" for the mean squared error, which is equal to variance
--        reduction as feature selection criterion, and "mae" for the mean
--        absolute error.
-+        are "squared_error" for the mean squared error, which is equal to
-+        variance reduction as feature selection criterion, and "mae" for the
-+        mean absolute error.
- 
-     max_features : int, float, string or None, optional (default="auto")
-         The number of features to consider when looking for the best split:
-@@ -259,9 +259,9 @@ class ExtraTreesRegressor(_sk_ExtraTreesRegressor):
- 
-     criterion : string, optional (default="squared_error")
-         The function to measure the quality of a split. Supported criteria
--        are "squared_error" for the mean squared error, which is equal to variance
--        reduction as feature selection criterion, and "mae" for the mean
--        absolute error.
-+        are "squared_error" for the mean squared error, which is equal to
-+        variance reduction as feature selection criterion, and "mae" for the
-+        mean absolute error.
- 
-     max_features : int, float, string or None, optional (default="auto")
-         The number of features to consider when looking for the best split:
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 93d3b25272..762e8c98e5 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -364,29 +364,16 @@ (define-public python-scikit-opt
 (define-public python-scikit-optimize
   (package
     (name "python-scikit-optimize")
-    (version "0.9.0")
+    (version "0.10.1")
     (source (origin
               (method git-fetch)
               (uri (git-reference
-                    (url "https://github.com/scikit-optimize/scikit-optimize")
+                    (url "https://github.com/holgern/scikit-optimize")
                     (commit (string-append "v" version))))
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0hsq6pmryimxc275yrcy4bv217bx7ma6rz0q6m4138bv4zgq18d1"))
-              (patches
-               ;; These are for compatibility with more recent versions of
-               ;; numpy and scikit-learn.
-               (search-patches "python-scikit-optimize-1148.patch"
-                               "python-scikit-optimize-1150.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               ;; Since scikit-learn 1.3 max_features no longer supports
-               ;; 'auto', which is identical to 'sqrt'
-               '(substitute* '("skopt/learning/forest.py"
-                               "skopt/learning/tests/test_forest.py")
-                  (("max_features=['\"]auto['\"]")
-                   "max_features='sqrt'")))))
+                "1c9b7g3v9ajaq78nzv6gy3xqlfjlcqqhsq87d7gfc4pdswvfv1ns"))))
     (build-system pyproject-build-system)
     (propagated-inputs
      (list python-joblib

base-commit: a17976e975001d3e95c998f1196a39bbb432de4f
prerequisite-patch-id: 35b1bce8404aa9b122774f343fbde6b1accb6a33
prerequisite-patch-id: c0c840125378b58dddfeb89491c36a0ffcd34d90
prerequisite-patch-id: 6307ea85cee71834b4e3b8d362025c19d5144177
prerequisite-patch-id: e49db0ce706076aafa11c84cbe27a017531f7a98
prerequisite-patch-id: dc8571a1261a53ba90ae37dcebe79bc99630e661
prerequisite-patch-id: 1462b7d670025fea8e66ed6290a994e62035ef5d
prerequisite-patch-id: 3e713b03abf25cc015c33e810b179af1c0b42804
prerequisite-patch-id: 920528da46d1621c15c5a6f10464c7ae5cde4003
prerequisite-patch-id: 7a94347b316fc5e4f20f51fe2ddeb097c3cae79f
prerequisite-patch-id: 098696bf90a9e1b3e6237ae8c647b63d3bed8c6e
prerequisite-patch-id: 84cc8b92fa6e1e0491a5f7ca020d13c662d3d3be
prerequisite-patch-id: c56fb6c601a1014b6ba876b8d601449e535ea7b5
prerequisite-patch-id: 5971911f2fe36d93c11c11ec878495033dec14cf
prerequisite-patch-id: 6e1fecd20a532eca97a9ea044765186159f6551e
prerequisite-patch-id: 1ad8cb8f6e5ccfb35b32ea20a1c2f0b25de08b6b
prerequisite-patch-id: 9a72f1e2eda3506da18d209bd83c0a45adeadfe3
-- 
2.39.2





^ permalink raw reply related	[relevance 58%]

* [bug#70067] [PATCH] gnu: Add python-find-libpython.
@ 2024-03-29  8:57 65% Cayetano Santos via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Cayetano Santos via Guix-patches via @ 2024-03-29  8:57 UTC (permalink / raw)
  To: 70067; +Cc: Cayetano Santos

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8a6ef23b58..7008ee6ae9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20886,6 +20886,29 @@ (define-public python-lark-parser
 some degree most natural languages too.")
     (license license:expat)))
 
+(define-public python-find-libpython
+  (package
+    (name "python-find-libpython")
+    (version "0.4.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ktbarrett/find_libpython")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1z1r9nix2z75sv41j97pnl6jgj2lk6k8la23vavxjpprsc9ld1dd"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-pytest))
+    (home-page "https://github.com/ktbarrett/find_libpython")
+    (synopsis "Find the path to the @code{libpython} dynamic library")
+    (description "@code{find_libpython} helps find the path to the
+@code{libpython} dynamic library for the current Python environment.  It is
+both a script and a Python package.")
+    (license license:expat)))
+
 (define-public python-libcst
   (package
     (name "python-libcst")

base-commit: 0ff72d105ca03a82de6bb5193266fd05fce72daf
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#70057] [PATCH] gnu: Add python-apprise.
@ 2024-03-28 16:15 59% Fabio Natali via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Fabio Natali via Guix-patches via @ 2024-03-28 16:15 UTC (permalink / raw)
  To: 70057
  Cc: Fabio Natali, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-apprise): New variable.

Change-Id: I55b8c7b558ce34835cff31b9fac6ff3b81ff5fec
---
Hi! 👋

This is to add Apprise, a push notification Python library.

It seems that Apprise is required if we want to upgrade borgmatic from 1.7.12 to 1.8.9.

I hope the patch looks alright but all feedback is welcome.

Thanks, cheers, Fabio.

 gnu/packages/python-xyz.scm | 46 +++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8a6ef23b58..2cdcc5e51c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -231,6 +231,7 @@ (define-module (gnu packages python-xyz)
   #:use-module (gnu packages man)
   #:use-module (gnu packages markup)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages messaging)
   #:use-module (gnu packages monitoring)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
@@ -293,6 +294,51 @@ (define-module (gnu packages python-xyz)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26))
 
+(define-public python-apprise
+  (package
+    (name "python-apprise")
+    (version "1.7.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "apprise" version))
+       (sha256
+        (base32 "0wvs1k71fipn617y9wsdcvwcgg2pd0nvriarlwl4438la4086ppg"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-certifi
+                             python-click
+                             python-dataclasses
+                             python-markdown
+                             python-pyyaml
+                             python-requests
+                             python-requests-oauthlib))
+    (native-inputs (list python-babel
+                         python-coverage
+                         python-cryptography
+                         python-flake8
+                         python-paho-mqtt
+                         python-pytest
+                         python-pytest-cov
+                         python-pytest-mock
+                         python-pytest-xdist
+                         python-wheel))
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (replace 'check
+                     (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+                       (when tests?
+                         (delete-file "test/test_plugin_macosx.py")
+                         (invoke "pytest")))))))
+    (home-page "https://github.com/caronc/apprise")
+    (synopsis
+     "Push notification Python library that works with many platforms")
+    (description
+     "Apprise is a Python library that allows sending push notifications to a broad
+range of notification services, such as Telegram, Discord, Slack, Amazon SNS,
+Gotify, etc.")
+    (license license:bsd-2)))
+
 (define-public python-xmldiff
   (package
     (name "python-xmldiff")

base-commit: fb9549164520ad993c2fbbaedc899844d57baabc
-- 
2.41.0





^ permalink raw reply related	[relevance 59%]

* [bug#70052] [PATCH] Updated the package from 0.6.0 to 0.9.0
@ 2024-03-28 12:29 65% nafkhamdc
  0 siblings, 0 replies; 200+ results
From: nafkhamdc @ 2024-03-28 12:29 UTC (permalink / raw)
  To: 70052; +Cc: nafkhamdc

Change-Id: I68bcd6840577a12594e491e9fd5e114f9261f6c7
---
 gnu/packages/python-science.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index b6a116f16b..55868e300d 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -1435,14 +1435,14 @@ (define-public python-unyt
 (define-public python-upsetplot
   (package
     (name "python-upsetplot")
-    (version "0.6.0")
+    (version "0.9.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "UpSetPlot" version))
        (sha256
         (base32
-         "11zrykwnb00w5spx4mnsnm0f9gwrphdczainpmwkyyi50vipaa2l"))
+         "14l5gcj88cclkj1mf74bcy1pxq1hgsiy27fa3vxrsk32ik1nmdwm"))
        (modules '((guix build utils)))
        (snippet
         ;; Patch for compatibility with newer setuptools:

base-commit: 0e8f7ee3a95011dd9ebdc99e0f3b754160524b5d
prerequisite-patch-id: d26b189d1487d0d6a234a8197c5892f1e179e5f5
prerequisite-patch-id: 3cb34404c868aab6f273aa4342ac7266fc82457f
prerequisite-patch-id: 26c6975580ae7feb5100f84e6c123d908a303fca
-- 
2.34.1





^ permalink raw reply related	[relevance 65%]

* [bug#70050] [PATCH] gnu: Add python-pytest-testmon.
@ 2024-03-28 11:04 65% nafkhamdc
  0 siblings, 0 replies; 200+ results
From: nafkhamdc @ 2024-03-28 11:04 UTC (permalink / raw)
  To: 70050; +Cc: nafkhamdc

* gnu/packages/python-check.scm (python-pytest-testmon): New variable.

Change-Id: Ia2e6034781898c04bd766145e0352060a975d479
---
 gnu/packages/python-check.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 51a38bbcbe..4f710f13c5 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -1093,6 +1093,26 @@ (define-public python-re-assert
 simpler.")
     (license license:expat)))
 
+(define-public python-pytest-testmon
+  (package
+    (name "python-pytest-testmon")
+    (version "2.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-testmon" version))
+       (sha256
+        (base32 "166snmcqv3mi0jlhshjlm5387i0gxmpm7m2cwmp3169dwhyjrglf"))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:tests? #f)) ;No tests in PyPi tarball.
+    (native-inputs (list python-coverage python-pytest))
+    (home-page "https://github.com/tarpas/pytest-testmon")
+    (synopsis "Selects tests affected by changed files and methods")
+    (description
+     "This plug-in auto-selects and reruns tests impacted by recent changes.")
+    (license license:expat)))
+
 (define-public python-pytest-trio
   (package
     (name "python-pytest-trio")

base-commit: 0e8f7ee3a95011dd9ebdc99e0f3b754160524b5d
prerequisite-patch-id: d26b189d1487d0d6a234a8197c5892f1e179e5f5
prerequisite-patch-id: 3cb34404c868aab6f273aa4342ac7266fc82457f
-- 
2.34.1





^ permalink raw reply related	[relevance 65%]

* [bug#70045] [PATCH] Updated the package from version 1.4.0 to version 1.5.0
@ 2024-03-28  6:54 65% nafkhamdc
  0 siblings, 0 replies; 200+ results
From: nafkhamdc @ 2024-03-28  6:54 UTC (permalink / raw)
  To: 70045; +Cc: nafkhamdc

Change-Id: Iadf81b8d67a5d4fa08fbcb9937afa86de33385dc
---
 gnu/packages/python-crypto.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index ff6b3a3e1a..374724e8a4 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -774,7 +774,7 @@ (define-public python-asn1crypto
 (define-public python-pynacl
   (package
     (name "python-pynacl")
-    (version "1.4.0")
+    (version "1.5.0")
     (source
      (origin
        (method url-fetch)
@@ -790,7 +790,7 @@ (define-public python-pynacl
            (delete-file-recursively "src/libsodium")))
        (sha256
         (base32
-         "01b56hxrbif3hx8l6rwz5kljrgvlbj7shmmd2rjh0hn7974a5sal"))))
+         "1fi0jbxhh3svajzldlb6gj5sr5a48v11xlmx0wb831db167l9iwa"))))
     (build-system python-build-system)
     (arguments
      `(#:phases

base-commit: 517c13624a9643c4f47b8e5bc623b39e68db8027
-- 
2.34.1





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 06/13] gnu: python-lazy-loader: Remove pre-commit from native-inputs.
                     ` (4 preceding siblings ...)
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 05/13] gnu: python-rich-click: " Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 07/13] gnu: python-jupytext: " Vinicius Monego
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-lazy-loader)[native-inputs]: Remove
python-pre-commit.

Change-Id: Id360c7c6a34457d95084227805fcd0bad1b30e12
---
 gnu/packages/python-xyz.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d8056bc127..77c29edb45 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20981,8 +20981,7 @@ (define-public python-lazy-loader
                 "0dwghffnsjjf4pi4gwbl43rx04jmap375hdamafs5cpm6j78js1v"))))
     (build-system pyproject-build-system)
     (native-inputs
-     (list python-pre-commit
-           python-pytest
+     (list python-pytest
            python-pytest-cov))
     (propagated-inputs
      (list python-flit-core))
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 02/13] gnu: python-jsonargparse: Remove pre-commit from native-inputs.
    2024-03-24 13:40 65% ` [bug#69980] [PATCH 01/13] gnu: python-loguru: Remove pre-commit from native-inputs Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 03/13] gnu: python-traitlets: " Vinicius Monego
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-jsonargparse)[native-inputs]: Remove
python-pre-commit.

Change-Id: Iac844f4521f985cb07ef407b999dfc7f61605bca
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7b7e56a538..2aec657662 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4241,7 +4241,6 @@ (define-public python-jsonargparse
     (native-inputs
      (list python-attrs
            python-coverage
-           python-pre-commit
            python-pycodestyle
            python-pydantic
            python-pytest
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 03/13] gnu: python-traitlets: Remove pre-commit from native-inputs.
    2024-03-24 13:40 65% ` [bug#69980] [PATCH 01/13] gnu: python-loguru: Remove pre-commit from native-inputs Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 02/13] gnu: python-jsonargparse: " Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 04/13] gnu: python-seaborn: " Vinicius Monego
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-traitlets)[native-inputs]: Remove
python-pre-commit.

Change-Id: I3d36f47e8955c648282bc707fafa57ba00cda933
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2aec657662..261dde03a2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11708,7 +11708,6 @@ (define-public python-traitlets
     (build-system pyproject-build-system)
     (native-inputs
      (list python-hatchling
-           python-pre-commit
            python-pytest
            python-pytest-mock))
     (home-page "https://ipython.org")
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 04/13] gnu: python-seaborn: Remove pre-commit from native-inputs.
                     ` (2 preceding siblings ...)
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 03/13] gnu: python-traitlets: " Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 05/13] gnu: python-rich-click: " Vinicius Monego
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-seaborn)[native-inputs]: Remove
python-pre-commit.

Change-Id: I8b7016f1d8103dd9297626b7ec74a120fa1c848b
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 261dde03a2..898c884fa5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -13133,7 +13133,6 @@ (define-public python-seaborn
     (native-inputs
      (list python-flake8
            python-flit-core
-           python-pre-commit
            python-pytest
            python-pytest-cov
            python-pytest-xdist))
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 11/13] gnu: python-identify: Update to 2.5.35.
                     ` (9 preceding siblings ...)
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 10/13] gnu: Add python-ukkonen Vinicius Monego
@ 2024-03-24 13:40 64% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 12/13] gnu: python-nodeenv: Update to 1.8.0 Vinicius Monego
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-identify): Update to 2.5.35.
[build-system]: Use pyproject-build-system.
[arguments]: Use G-Expressions. Do not override the check phase.
[native-inputs]: Add python-ukkonen.

Change-Id: I970507dc358029b4e2cc0a295d19db4b28202544
---
 gnu/packages/python-xyz.scm | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 03fdccba78..d7af0646fc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26717,7 +26717,7 @@ (define-public python-ukkonen
 (define-public python-identify
   (package
     (name "python-identify")
-    (version "1.4.25")
+    (version "2.5.35")
     (source
      (origin
        ;; There are no tests in the PyPI tarball.
@@ -26727,19 +26727,15 @@ (define-public python-identify
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1fqgci6skckcq0x5pnxh6k2qjzn1ndsrgha1j6wwv1ld4g9bd3hz"))))
-    (build-system python-build-system)
+        (base32 "0w1wnh4y6xll3980m555k5g4iwwk31pwjx4j0b5x88bdvfml0h4i"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         ;; system-error "utime" "~A" ("No such file or directory")
-         (delete 'ensure-no-mtimes-pre-1980)
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (invoke "pytest" "-vv")))))))
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   ;; system-error "utime" "~A" ("No such file or directory")
+                   (delete 'ensure-no-mtimes-pre-1980))))
     (native-inputs
-     (list python-coverage python-pytest))
+     (list python-coverage python-pytest python-ukkonen))
     (propagated-inputs
      (list python-editdistance))
     (home-page "https://github.com/chriskuehl/identify")
-- 
2.39.2





^ permalink raw reply related	[relevance 64%]

* [bug#69980] [PATCH 01/13] gnu: python-loguru: Remove pre-commit from native-inputs.
  @ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 02/13] gnu: python-jsonargparse: " Vinicius Monego
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-loguru)[native-inputs]: Remove
python-pre-commit.

Change-Id: Id14b518c310c47c19d5911f694248cab22f50d8d
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index aad89d251e..7b7e56a538 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31941,7 +31941,6 @@ (define-public python-loguru
     (native-inputs (list python-colorama
                          python-freezegun
                          python-mypy
-                         python-pre-commit
                          python-pytest
                          python-pytest-cov
                          python-pytest-mypy-plugins
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 09/13] gnu: python-cfgv: Update to 3.4.0.
                     ` (7 preceding siblings ...)
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 08/13] gnu: python-omnipath: " Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 10/13] gnu: Add python-ukkonen Vinicius Monego
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-cfgv): Update to 3.4.0.
[build-system]: Use pyproject-build-system.
[arguments]: Do not override the check phase.

Change-Id: Id666a57e4d619697ffa272893930f1c94d5c283e
---
 gnu/packages/python-xyz.scm | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 23a6490154..cead8ece1d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26902,7 +26902,7 @@ (define-public python-dns-lexicon
 (define-public python-cfgv
   (package
     (name "python-cfgv")
-    (version "3.3.1")
+    (version "3.4.0")
     (source
      (origin
        ;; There are no tests in the PyPI tarball.
@@ -26912,15 +26912,8 @@ (define-public python-cfgv
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1pci97cmn3v45sfch9s3lshidrl0309ls9byidic0l8drkwnkwcj"))))
-    (build-system python-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (invoke "pytest" "-vv")))))))
+        (base32 "0g7jg6dssyax6k85lk8afs8qdzgq138g6ij0jmmhgdv5fzks6k9z"))))
+    (build-system pyproject-build-system)
     (native-inputs
      (list python-pytest))
     (home-page "https://github.com/asottile/cfgv")
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 07/13] gnu: python-jupytext: Remove pre-commit from native-inputs.
                     ` (5 preceding siblings ...)
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 06/13] gnu: python-lazy-loader: " Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 08/13] gnu: python-omnipath: " Vinicius Monego
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-jupytext)[native-inputs]: Remove
pre-commit.

Change-Id: I9e43aa760ef11ffabd0d374593e2e1ea77e9b086
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 77c29edb45..23a6490154 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -375,7 +375,6 @@ (define-public python-jupytext
                                                       " and not "))))))))))
     (native-inputs
      (list git-minimal
-           pre-commit
            python-autopep8
            python-black
            python-flake8
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 12/13] gnu: python-nodeenv: Update to 1.8.0.
                     ` (10 preceding siblings ...)
  2024-03-24 13:40 64% ` [bug#69980] [PATCH 11/13] gnu: python-identify: Update to 2.5.35 Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-nodeenv): Update to 1.8.0.
[build-system]: Use pyproject-build-system.
[arguments]: Do not override the check phase, skip tests in #:test-flags
instead.

Change-Id: I01ca1948c30327827d6f76697b471a4d90cd6530
---
 gnu/packages/python-xyz.scm | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d7af0646fc..b8abe5fd75 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26813,7 +26813,7 @@ (define-public python-tldr
 (define-public python-nodeenv
   (package
     (name "python-nodeenv")
-    (version "1.4.0")
+    (version "1.8.0")
     (source
      (origin
        ;; There's no tarball in PyPI.
@@ -26823,15 +26823,13 @@ (define-public python-nodeenv
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0y443icx0w7jlzmxmmcm4q8dqfiwgafbb9cp8jpm68mbqxbz40a7"))))
-    (build-system python-build-system)
+        (base32 "0g8zp8zw5nnfc14ml0sil9yh7lnpz3xrdkazdkwg6pf5jqsxlvv9"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             ;; This test fails. It tries to open a network socket.
-             (invoke "pytest" "-vv" "-k" "not test_smoke"))))))
+     (list #:test-flags
+           #~(list "-k" (string-append
+                         "not test_smoke"
+                         " and not test_smoke_n_system_special_chars"))))
     (native-inputs
      (list python-coverage python-mock python-pytest))
     (home-page "https://ekalinin.github.io/nodeenv/")
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 10/13] gnu: Add python-ukkonen.
                     ` (8 preceding siblings ...)
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 09/13] gnu: python-cfgv: Update to 3.4.0 Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 64% ` [bug#69980] [PATCH 11/13] gnu: python-identify: Update to 2.5.35 Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 12/13] gnu: python-nodeenv: Update to 1.8.0 Vinicius Monego
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-ukkonen): New variable.

Change-Id: I826b003f1c22e5bf28829d9f2adc5f467d17ed45
---
 gnu/packages/python-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index cead8ece1d..03fdccba78 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26691,6 +26691,29 @@ (define-public python-requests-file
 library to allow local file system access via @code{file://} URLs.")
     (license license:asl2.0)))
 
+(define-public python-ukkonen
+  (package
+    (name "python-ukkonen")
+    (version "1.0.1")
+    (source
+     (origin
+       ;; There are no tests in the PyPI tarball.
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/asottile/ukkonen")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "17gspl2dsykg000275svvyam4k7wz9ypi9xrfrmsgcgryczravlc"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-pytest))
+    (propagated-inputs (list python-cffi))
+    (home-page "https://github.com/asottile/ukkonen")
+    (synopsis "Implementation of bounded Levenshtein distance (Ukkonen)")
+    (description "This package is an implementation of of bounded Levenshtein
+distance (Ukkonen).")
+    (license license:expat)))
+
 (define-public python-identify
   (package
     (name "python-identify")
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 05/13] gnu: python-rich-click: Remove pre-commit from native-inputs.
                     ` (3 preceding siblings ...)
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 04/13] gnu: python-seaborn: " Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 06/13] gnu: python-lazy-loader: " Vinicius Monego
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-rich-click)[native-inputs]: Remove
python-pre-commit.

Change-Id: I7a1de6166e4fe9f255cff8819b4779e76d7a4537
---
 gnu/packages/python-xyz.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 898c884fa5..d8056bc127 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19588,7 +19588,6 @@ (define-public python-rich-click
     (build-system python-build-system)
     (propagated-inputs
      (list python-click python-importlib-metadata python-rich))
-    (native-inputs (list python-pre-commit))
     (home-page "https://github.com/ewels/rich-click")
     (synopsis "Format click help output nicely with rich")
     (description "Click is a \"Python package for creating beautiful command
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69980] [PATCH 08/13] gnu: python-omnipath: Remove pre-commit from native-inputs.
                     ` (6 preceding siblings ...)
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 07/13] gnu: python-jupytext: " Vinicius Monego
@ 2024-03-24 13:40 65% ` Vinicius Monego
  2024-03-24 13:40 65% ` [bug#69980] [PATCH 09/13] gnu: python-cfgv: Update to 3.4.0 Vinicius Monego
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 13:40 UTC (permalink / raw)
  To: 69980; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-omnipath)[native-inputs]: Remove
python-pre-commit.

Change-Id: Idfdf978df55e2c3cb3c8447aa18456cc9de4c4c2
---
 gnu/packages/python-web.scm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index fc01fc4b83..bbe4ddd788 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -2101,7 +2101,6 @@ (define-public python-omnipath
            python-wrapt))
     (native-inputs
      (list python-bump2version
-           python-pre-commit
            python-pytest
            python-pytest-mock
            python-requests-mock
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69978] [PATCH 4/4] gnu: python-celery: Update to 5.3.6.
                     ` (2 preceding siblings ...)
  2024-03-24 11:20 65% ` [bug#69978] [PATCH 3/4] gnu: python-vine: Update to 5.1.0 Vinicius Monego
@ 2024-03-24 11:20 59% ` Vinicius Monego
  3 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 11:20 UTC (permalink / raw)
  To: 69978; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-celery): Update to 5.3.6.
[build-system]: Use pyproject-build-system.
[arguments]: Replace pytz with tzdata in the relax-requirements phase. Do not
override the check phase, skip tests in #:test-flags instead.
[native-inputs]: Add python-pytest-click.
[propagated-inputs]: Add python-tzdata. Remove python-pytz.

Change-Id: I4cb6a1c6712d5b54f4d9a6731447e9459e8ff81a
---
 gnu/packages/python-xyz.scm | 43 +++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 9021b9d9db..37f952e54e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18972,34 +18972,30 @@ (define-public python-billiard
 (define-public python-celery
   (package
     (name "python-celery")
-    (version "5.2.6")
+    (version "5.3.6")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "celery" version))
        (sha256
-        (base32 "109lcqarrbmh95sk1dm4yxayq1h3i27f4w23ndk64mqgyfnqqffi"))))
-    (build-system python-build-system)
+        (base32 "1fdacw13ij94s59l6lspl09iv6fc8h1p6399jz1h00kwfcfwf347"))))
+    (build-system pyproject-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'relax-requirements
-           (lambda _
-             (substitute* "requirements/default.txt"
-               (("pytz.*")
-                "pytz\n"))))
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (invoke "python" "-m" "pytest" "t"
-                       "--ignore" "t/integration" ;hangs tests
-                       ;; The MongoDB backend test appears to expect an older
-                       ;; version of MongoDB which provided its own bson
-                       ;; module, fails with " AttributeError: module 'bson'
-                       ;; has no attribute 'encode'".
-                       "--ignore" "t/unit/backends/test_mongodb.py"
-                       ;; AssertionErrors
-                       "-k" "not test_check_privileges_no_fchown ")))))))
+     (list
+      ;; The MongoDB backend test appears to expect an older
+      ;; version of MongoDB which provided its own bson
+      ;; module, fails with " AttributeError: module 'bson'
+      ;; has no attribute 'encode'".
+      #:test-flags #~(list "--ignore" "t/unit/backends/test_mongodb.py"
+                           ;; AssertionError.
+                           "-k" "not test_check_privileges_no_fchown")
+      #:phases #~(modify-phases %standard-phases
+                   ;; Celery requires tzdata >= 2022.7, we have 2022.1.
+                   (add-after 'unpack 'relax-requirements
+                     (lambda _
+                       (substitute* "requirements/default.txt"
+                         (("tzdata.*")
+                          "tzdata\n")))))))
     (native-inputs
      (list python-case
            python-dnspython
@@ -19009,6 +19005,7 @@ (define-public python-celery
            python-msgpack
            python-pytest                ;for pytest-subtests
            python-pytest-celery
+           python-pytest-click
            python-pytest-subtests
            python-pytest-timeout
            python-toml))
@@ -19019,7 +19016,7 @@ (define-public python-celery
            python-click-plugins
            python-click-repl
            python-kombu
-           python-pytz
+           python-tzdata
            python-vine))
     (home-page "https://celeryproject.org")
     (synopsis "Distributed Task Queue")
-- 
2.39.2





^ permalink raw reply related	[relevance 59%]

* [bug#69978] [PATCH 3/4] gnu: python-vine: Update to 5.1.0.
    2024-03-24 11:20 65% ` [bug#69978] [PATCH 1/4] gnu: python-billiard: Update to 4.2.0 Vinicius Monego
  2024-03-24 11:20 62% ` [bug#69978] [PATCH 2/4] gnu: python-kombu: Update to 5.3.5 Vinicius Monego
@ 2024-03-24 11:20 65% ` Vinicius Monego
  2024-03-24 11:20 59% ` [bug#69978] [PATCH 4/4] gnu: python-celery: Update to 5.3.6 Vinicius Monego
  3 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 11:20 UTC (permalink / raw)
  To: 69978; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-vine): Update to 5.1.0.
[build-system]: Use pyproject-build-system.

Change-Id: I2621eb21deb516d16e9cc50ff9237aed1b6b46b8
---
 gnu/packages/python-xyz.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3240aa2c40..9021b9d9db 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5786,14 +5786,14 @@ (define-public python-pyyaml-5
 (define-public python-vine
   (package
     (name "python-vine")
-    (version "5.0.0")
+    (version "5.1.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "vine" version))
        (sha256
-        (base32 "0zk3pm0g7s4qfn0gk28lfmsyplvisaxi6826cgpq5njkm4j1cfvx"))))
-    (build-system python-build-system)
+        (base32 "1q31krwxdvwawdn1kfqmpplix31d4jhs0qng26908hawsf0yjqlb"))))
+    (build-system pyproject-build-system)
     (native-inputs
      (list python-pytest python-case))
     (home-page "https://github.com/celery/vine")
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69978] [PATCH 2/4] gnu: python-kombu: Update to 5.3.5.
    2024-03-24 11:20 65% ` [bug#69978] [PATCH 1/4] gnu: python-billiard: Update to 4.2.0 Vinicius Monego
@ 2024-03-24 11:20 62% ` Vinicius Monego
  2024-03-24 11:20 65% ` [bug#69978] [PATCH 3/4] gnu: python-vine: Update to 5.1.0 Vinicius Monego
  2024-03-24 11:20 59% ` [bug#69978] [PATCH 4/4] gnu: python-celery: Update to 5.3.6 Vinicius Monego
  3 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 11:20 UTC (permalink / raw)
  To: 69978; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-kombu): Update to 5.3.5.
[build-system]: Use pyproject-build-system.
[arguments]: Do not override the check phase. Ignore a file in #:test-flags.
[native-inputs]: Add python-botocore, python-tzdata. Remove python-pytz.
[propagated-inputs]: Add python-typing-extensions. Remove
python-cached-property.

Change-Id: I4b36effff8b17af388d56c90bf8983954adf4333
---
 gnu/packages/python-xyz.scm | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f9835edff4..3240aa2c40 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18909,30 +18909,27 @@ (define-public python-txamqp
 (define-public python-kombu
   (package
     (name "python-kombu")
-    (version "5.2.4")
+    (version "5.3.5")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "kombu" version))
        (sha256
-        (base32 "044ng79gj04668kf5fmy7fjkw8302xyapskkn65ym52zfbpf7kip"))))
-    (build-system python-build-system)
+        (base32 "14sbr1gkhiansnybdkk9qjk8l5sfrkjc64vddzf7175llvqp1r1h"))))
+    (build-system pyproject-build-system)
     (arguments
-     (list
-      #:phases
-      #~(modify-phases %standard-phases
-          (replace 'check
-            (lambda* (#:key tests? #:allow-other-keys)
-              (when tests?
-                (invoke "pytest" "-vv"
-                        ;; The transport tests attempt to pass messages to
-                        ;; many different databases.
-                        "--ignore" "t/unit/transport")))))))
+     (list #:test-flags
+           ;; TODO: Package azure-identity (required for this file)
+           #~(list "--ignore" "t/unit/transport/test_azurestoragequeues.py")))
     (native-inputs
-     (list python-case python-pyro4 python-pytest-sugar
-           python-pytest python-pytz))
+     (list python-botocore
+           python-case
+           python-pyro4
+           python-pytest
+           python-pytest-sugar
+           python-tzdata))
     (propagated-inputs
-     (list python-amqp python-cached-property python-vine))
+     (list python-amqp python-typing-extensions python-vine))
     (home-page "https://kombu.readthedocs.io")
     (synopsis "Message passing library for Python")
     (description "The aim of Kombu is to make messaging in Python as easy as
-- 
2.39.2





^ permalink raw reply related	[relevance 62%]

* [bug#69978] [PATCH 1/4] gnu: python-billiard: Update to 4.2.0.
  @ 2024-03-24 11:20 65% ` Vinicius Monego
  2024-03-24 11:20 62% ` [bug#69978] [PATCH 2/4] gnu: python-kombu: Update to 5.3.5 Vinicius Monego
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 200+ results
From: Vinicius Monego @ 2024-03-24 11:20 UTC (permalink / raw)
  To: 69978; +Cc: Vinicius Monego

* gnu/packages/python-xyz.scm (python-billiard): Update to 4.2.0.
[build-system]: Use pyproject-build-system.
[arguments]: Use G-Expressions. Do not delete test files.

Change-Id: I69ec62c0c28e9c7ff6ce65f722b250f50dbb33da
---
 gnu/packages/python-xyz.scm | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index aad89d251e..f9835edff4 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18946,25 +18946,21 @@ (define-public python-kombu
 (define-public python-billiard
   (package
     (name "python-billiard")
-    (version "3.6.4.0")
+    (version "4.2.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "billiard" version))
        (sha256
-        (base32 "0ismj2p8c66ykpss94rs0bfra5agxxmljz8r3gaq79r8valfb799"))))
-    (build-system python-build-system)
+        (base32 "0b2svqx81511m0k2swjkybcx69f541dzd4rgfdxa2ni7rf232g4s"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'remove-win-files
-           (lambda _
-             (for-each delete-file-recursively
-                       ;; test_multiprocessing seem to be written in Python2.
-                       '("t/integration/tests/test_multiprocessing.py"
-                         "t/unit/test_win32.py"
-                         "billiard/popen_spawn_win32.py"
-                         "billiard/_win.py")))))))
+     (list #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'remove-win-files
+                          (lambda _
+                            (for-each delete-file-recursively
+                                      '("billiard/popen_spawn_win32.py"
+                                        "billiard/_win.py")))))))
     (native-inputs
      (list python-case python-psutil python-pytest))
     (home-page "https://github.com/celery/billiard")
-- 
2.39.2





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v4 06/32] gnu: Add python-expecttest.
                     ` (3 preceding siblings ...)
  2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 05/32] gnu: Add python-pytest-shard David Elsing
@ 2024-03-23 22:04 64% ` David Elsing
  2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 07/32] gnu: Add python-pytest-rerunfailures-13 David Elsing
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-23 22:04 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-expecttest): New variable.
---
 gnu/packages/python-check.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index f876088488..dbca80652c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2078,6 +2078,41 @@ (define-public python-eradicate
 valid Python syntax that are likely to be commented out code.")
     (license license:expat)))
 
+(define-public python-expecttest
+  (let ((commit "683b09a352cc426851adc2e3a9f46e0ab25e4dee")
+        (revision "0"))
+    (package
+      (name "python-expecttest")
+      (version (git-version "0.2.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ezyang/expecttest")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1djwxp9x1hczzxbimv1b1bmd083am88v27l82nmlkhvzyg2cmpvv"))))
+      (build-system pyproject-build-system)
+      (arguments
+       (list
+        #:phases
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  ;; The test runs tests expected to fail, so the output is
+                  ;; confusing
+                  (invoke "python3" "test_expecttest.py")))))))
+      (native-inputs (list python-hypothesis poetry))
+      (home-page "https://github.com/ezyang/expecttest")
+      (synopsis "Python module for expect tests")
+      (description "@code{expecttest} is a Python module for expect tests, where
+the initial expected value of a test can be automatically set by running the
+test itself.")
+      (license license:expat))))
+
 (define-public python-robber
   (package
     (name "python-robber")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69591] [PATCH v4 05/32] gnu: Add python-pytest-shard.
                     ` (2 preceding siblings ...)
  2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 04/32] gnu: Add python-pytest-flakefinder David Elsing
@ 2024-03-23 22:04 65% ` David Elsing
  2024-03-23 22:04 64% ` [bug#69591] [PATCH v4 06/32] gnu: Add python-expecttest David Elsing
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-23 22:04 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-shard): New variable.
---
 gnu/packages/python-check.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 247f8af98b..f876088488 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -210,6 +210,30 @@ (define-public python-pytest-flakefinder
 times and detect flakyness.")
     (license license:asl2.0)))
 
+(define-public python-pytest-shard
+  (let ((commit "64610a08dac6b0511b6d51cf895d0e1040d162ad")
+        (revision "0"))
+    (package
+      (name "python-pytest-shard")
+      (version (git-version "0.1.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/AdamGleave/pytest-shard")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1h31m68igz670bzl307hazjrfbr8pk14mxflllar18ydmlrnl677"))))
+      (build-system pyproject-build-system)
+      (propagated-inputs (list python-pytest))
+      (home-page "https://github.com/AdamGleave/pytest-shard")
+      (synopsis "Pytest plugin for sharding tests")
+      (description "This package provides a Pytest extension for sharding
+tests at the granularity of individual test cases, which can be run in
+parallel and on multiple machines.")
+      (license license:expat))))
+
 (define-public python-testfixtures
   (package
     (name "python-testfixtures")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v4 04/32] gnu: Add python-pytest-flakefinder.
    2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 02/32] gnu: Add python-typing-extensions-4.10 David Elsing
  2024-03-23 22:04 63% ` [bug#69591] [PATCH v4 03/32] gnu: Add python-optree David Elsing
@ 2024-03-23 22:04 65% ` David Elsing
  2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 05/32] gnu: Add python-pytest-shard David Elsing
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-23 22:04 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-flakefinder): New variable.
---
 gnu/packages/python-check.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 51a38bbcbe..247f8af98b 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -191,6 +192,24 @@ (define-public python-pytest-csv
 it adds to the Pytest command line interface (CLI).")
     (license license:gpl3+)))
 
+(define-public python-pytest-flakefinder
+  (package
+    (name "python-pytest-flakefinder")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-flakefinder" version))
+       (sha256
+        (base32 "03iy80xlkpgzjs2kxa9rrj8dbnp9awyhpcl3hy8fgf5x40cjlhg2"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-pytest))
+    (home-page "https://github.com/dropbox/pytest-flakefinder")
+    (synopsis "Pytest plugin for finding flaky tests")
+    (description "This package provides a Pytest plugin to run tests multiple
+times and detect flakyness.")
+    (license license:asl2.0)))
+
 (define-public python-testfixtures
   (package
     (name "python-testfixtures")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v4 26/32] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies.
                     ` (5 preceding siblings ...)
  2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 07/32] gnu: Add python-pytest-rerunfailures-13 David Elsing
@ 2024-03-23 22:05 46% ` David Elsing
  2024-03-23 22:05 43% ` [bug#69591] [PATCH v4 32/32] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-23 22:05 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

Autogenerated files are also regenerated. The tests can be run, but are
disabled, as they require a long time.

* gnu/packages/machine-learning.scm (python-pytorch): Update to 2.2.1.
[version]: Use %python-pytorch-version.
[source]: Use %python-pytorch-src.
[arguments]: Remove 'make-things-writable phase.  Add 'cmake-patches,
'disable-avx-dependencies, 'set-max-jobs, 'codegen1, 'codegen2, 'build2,
'install2 phases. Adjust 'use-system-libraries and 'check phases.
[native-inputs]: Add doxygen, ideep-pytorch, pocketfft-cpp, python-expecttest,
python-pytest-flakefinder, python-pytest-rerunfailures-13,
python-pytest-shard, python-pytest-xdist, python-hypothesis,
python-types-dataclasses, python-typing-extensions-4.10 and valgrind.
[inputs]: Add asmjit, clog, flatbuffers-next, foxi, fxdiv, libuv,
miniz-for-pytorch, qnnpack, qnnpack-pytorch and oneapi-dnnl. Use nnpack,
oneapi-dnnl, qnnpack, qnnpack-pytorch and xnnpack only for supported systems.
[propagated-inputs]: Add python-filelock, python-fsspec, python-jinja2,
python-networkx, python-opt-einsum, python-optree, python-packaging,
python-psutil and python-sympy. Remove python-cffi and python-six. Use cpuinfo
only for supported systems.
(%python-pytorch-src)[source]: Add patches.
(python-pytorch2): Remove variable.
* gnu/packages/patches/python-pytorch-runpath.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-system-libraries.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch: Remove file.
* gnu/packages/patches/python-pytorch-fix-codegen.patch: New file.
* gnu/packages/patches/python-pytorch-without-kineto: New file.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                  |   3 +-
 gnu/packages/machine-learning.scm             | 427 ++++++++++--------
 ...ython-pytorch-1.9.0-system-libraries.patch | 139 ------
 .../patches/python-pytorch-fix-codegen.patch  | 167 +++++++
 .../patches/python-pytorch-runpath.patch      |  19 +-
 .../python-pytorch-system-libraries.patch     | 317 +++++++++++--
 .../python-pytorch-without-kineto.patch       |  60 +++
 7 files changed, 772 insertions(+), 360 deletions(-)
 delete mode 100644 gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
 create mode 100644 gnu/packages/patches/python-pytorch-fix-codegen.patch
 create mode 100644 gnu/packages/patches/python-pytorch-without-kineto.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index adcb1be9b7..c7dfe1b873 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1930,9 +1930,10 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyan3-fix-absolute-path-bug.patch \
   %D%/packages/patches/python-pyan3-fix-positional-arguments.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch	\
+  %D%/packages/patches/python-pytorch-fix-codegen.patch		\
   %D%/packages/patches/python-pytorch-runpath.patch		\
   %D%/packages/patches/python-pytorch-system-libraries.patch	\
-  %D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
+  %D%/packages/patches/python-pytorch-without-kineto.patch	\
   %D%/packages/patches/python-robotframework-atest.patch	\
   %D%/packages/patches/python-robotframework-source-date-epoch.patch \
   %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 1be598e1e7..bcd1c26838 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -105,6 +105,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages parallel)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -123,6 +124,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages vulkan)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
@@ -4325,6 +4327,13 @@ (define %python-pytorch-src
     (sha256
      (base32
       "03mm0pwwb5lxdsmmiw3cch9fijgjw81kmmc4ln9rlyazkm7l1r48"))
+    (patches (search-patches "python-pytorch-system-libraries.patch"
+                             "python-pytorch-runpath.patch"
+                             "python-pytorch-without-kineto.patch"
+                             ;; Some autogeneration scripts depend on the
+                             ;; compile PyTorch library. Therefore, we create
+                             ;; dummy versions which are regenerated later.
+                             "python-pytorch-fix-codegen.patch"))
     (modules '((guix build utils)))
     (snippet
      '(begin
@@ -4444,135 +4453,250 @@ (define-public qnnpack-pytorch
 (define-public python-pytorch
   (package
     (name "python-pytorch")
-    (version "1.13.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "17yxjzwp4zp75fz7czgz9acijzw7dpyqcza50v8y1x7hfg2gw369"))
-              (patches (search-patches "python-pytorch-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-enum" "python-peachpy"
-                              "python-six" "tbb" "XNNPACK" "zstd"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
+    (version %python-pytorch-version)
+    (source %python-pytorch-src)
     (build-system python-build-system)
     (arguments
-     '(#:phases (modify-phases %standard-phases
-                  (add-before 'build 'use-system-libraries
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
-                      ;; want to use "system libraries" instead of the bundled
-                      ;; ones.
-                      (setenv "USE_SYSTEM_LIBS" "1")
-
-                      (substitute* "cmake/Dependencies.cmake"
-                        (("if\\(USE_SYSTEM_BIND11\\)")
-                         "if(TRUE)"))
-
-                      ;; XXX: Disable that for simplicity for now.
-                      (setenv "USE_FBGEMM" "0")))
-                  (add-before 'build 'make-things-writable
-                    (lambda _
-                      ;; The 'build_caffe2' function in
-                      ;; 'tools/build_pytorch_libs.py', called from the
-                      ;; top-level 'setup.py', needs write access to this
-                      ;; directory.
-                      (for-each make-file-writable
-                                (find-files "caffe2/proto" "."
-                                            #:directories? #t))))
-                  (replace 'check
-                    (lambda* (#:key inputs outputs tests? #:allow-other-keys)
-                      ;; Run the test suite following the instructions in
-                      ;; 'CONTRIBUTING.md'.  XXX: Unfortunately this doesn't
-                      ;; work, unless you set GUIX_PYTHONPATH presumably.
-                      (when tests?
-                        (add-installed-pythonpath inputs outputs)
-                        (invoke "python" "test/run_test.py"))))
-                  (add-after 'install 'remove-test-executables
-                    (lambda* (#:key inputs outputs #:allow-other-keys)
-                      ;; Remove test executables, but keep other executables
-                      ;; such as 'torch_shm_manager' and and .so files such as
-                      ;; 'libtorch_global_deps.so'.
-                      (let ((python-site (site-packages inputs outputs)))
-                        (for-each delete-file
-                                  (find-files python-site
-                                              "(^test_cpp_rpc|_test)$")))))
-                  (add-after 'install 'remove-caffe2-onnx-scripts
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let* ((out (assoc-ref outputs "out"))
-                             (bin (string-append out "/bin")))
-                        ;; Remove 'convert-caffe2-to-onnx' and
-                        ;; 'convert-onnx-to-caffe2': they seem to be
-                        ;; deprecated and they cause a failure of the
-                        ;; 'sanity-check' phase:
-                        ;;
-                        ;; ImportError: cannot import name 'metanet_pb2' from partially initialized module 'caffe2.proto' (most likely due to a circular import)
-                        (for-each delete-file
-                                  (find-files bin "^convert-.*caffe2"))
-
-                        (substitute* (find-files out "^entry_points\\.txt$")
-                          (("^convert-.*" all)
-                           (string-append "# " all "\n")))))))
-
-       ;; XXX: Tests attempt to download data such as
-       ;; <https://raw.githubusercontent.com/pytorch/test-infra/master/stats/slow-tests.json>.
-       ;; We're also missing some Python modules, such as expecttest.
-       #:tests? #f))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'cmake-patches
+            (lambda _
+              (substitute* "cmake/Dependencies.cmake"
+                (("#POCKETFFT_INCLUDE_DIR")
+                 (string-append
+                  #$(this-package-native-input "pocketfft-cpp") "/include"))
+                (("#FP16_INCLUDE_DIR")
+                 (string-append
+                  #$(this-package-input "fp16") "/include")))))
+          (add-before 'build 'use-system-libraries
+            (lambda _
+              (substitute* '("caffe2/serialize/crc.cc"
+                             "caffe2/serialize/inline_container.cc")
+                (("\"miniz\\.h\"") "<miniz/miniz.h>"))
+              (substitute* "aten/src/ATen/native/vulkan/api/Allocator.h"
+                (("<include/vk_mem_alloc.h>")
+                 "<vk_mem_alloc.h>"))
+              ;; For Vulkan
+              (substitute* "CMakeLists.txt"
+                (("append_cxx_flag.*-Werror=(return-type|range-loop-construct).*") ""))
+              (substitute*
+                  (cons*
+                   "torch/csrc/Module.cpp"
+                   (map
+                    (lambda (name)
+                      (string-append
+                       "torch/utils/benchmark/utils/valgrind_wrapper/"
+                       name))
+                    '("compat_bindings.cpp" "timer_callgrind_template.cpp")))
+                (("<callgrind.h>") "<valgrind/callgrind.h>"))
+              (setenv "USE_FFMPEG" "1")
+              (setenv "USE_VULKAN" "1")
+              (setenv "USE_OPENCV" "1")
+              ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
+              ;; want to use "system libraries" instead of the bundled
+              ;; ones.
+              (setenv "USE_SYSTEM_LIBS" "1")
+              ;; For oneDNN
+              (setenv "USE_MKLDNN" "1")
+              ;; Only works with CUPTI
+              (setenv "USE_KINETO" "0")
+              ;; Prevent CMake error by disabling explicitely
+              (setenv "USE_ITT" "0")
+              ;; Disable on unsupported systems
+              (if #$(not (member
+                          (or (%current-target-system)
+                              (%current-system))
+                          (package-transitive-supported-systems qnnpack)))
+                  (setenv "USE_QNNPACK" "0")
+                  (setenv "USE_PYTORCH_QNNPACK" "0"))))
+          ;; PyTorch is still built with AVX2 and AVX-512 support selected at
+          ;; runtime, but these dependencies require it (nnpack only for
+          ;; x86_64).
+          (add-before 'build 'disable-avx-dependencies
+            (lambda _
+              (setenv "USE_FBGEMM" "0")
+              (if #$(not
+                     (member (or (%current-target-system)
+                                 (%current-system))
+                             '("armhf-linux" "aarch64-linux")))
+                  (setenv "USE_NNPACK" "0"))))
+          (add-after 'use-system-libraries 'set-max-jobs
+            (lambda _
+              (setenv "MAX_JOBS" (number->string (parallel-job-count)))))
+          (add-after 'set-max-jobs 'codegen1
+            (lambda _
+              (with-directory-excursion "torch/csrc/jit/tensorexpr"
+                (setenv "PYTHONPATH" "../../../..")
+                (invoke "python3" "codegen_external.py")
+                (setenv "PYTHONPATH" #f))
+
+              (invoke "python3" "aten/src/ATen/nnapi/codegen.py")
+
+              (invoke "bash" "tools/gen_flatbuffers.sh")
+
+              ;; Generate dummy files as the generation depends on the compiled
+              ;; library. They are regenerated later.
+              (setenv "PYTHONPATH" ".")
+              (invoke "python3"
+                      "torchgen/operator_versions/gen_mobile_upgraders.py"
+                      "dummy")
+              (setenv "PYTHONPATH" #f)
+
+              (invoke "python3"
+                      "torchgen/shape_functions/gen_jit_shape_functions.py"
+                      "dummy")
+
+              (invoke "python3"
+                      "torchgen/decompositions/gen_jit_decompositions.py"
+                      "dummy")))
+          ;; Properly generate autogenerated files ...
+          (add-after 'install 'codegen2
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (add-installed-pythonpath inputs outputs)
+              (invoke "python3"
+                      "torchgen/operator_versions/gen_mobile_upgraders.py")
+              (invoke "python3"
+                      "torchgen/shape_functions/gen_jit_shape_functions.py")
+              (invoke "python3"
+                      "torchgen/decompositions/gen_jit_decompositions.py")))
+          ;; ... rebuild their dependencies ...
+          (add-after 'codegen2 'build2
+            (lambda _
+              (invoke "python3" "setup.py" "build")))
+          ;; ... and install again.
+          (add-after 'build2 'install2
+            (lambda _
+              (invoke "python3" "setup.py" "install" (string-append "--prefix=" #$output)
+                      "--no-compile" "--single-version-externally-managed" "--root=/")
+              (invoke "python" "-m" "compileall"
+                      "--invalidation-mode=unchecked-hash" #$output)))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              ;; Run the test suite following the instructions in
+              ;; 'CONTRIBUTING.md'. Unfortunately this doesn't work, unless
+              ;; you set PYTHONPATH or GUIX_PYTHONPATH, but this is done in
+              ;; the codegen2 phase already.
+              (when tests?
+                (invoke "python3" "test/run_test.py" "--core"))))
+          (add-after 'install2 'remove-test-executables
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              ;; Remove test executables, but keep other executables
+              ;; such as 'torch_shm_manager' and and .so files such as
+              ;; 'libtorch_global_deps.so'.
+              (let ((python-site (site-packages inputs outputs)))
+                (for-each delete-file
+                          (find-files python-site
+                                      "(^test_cpp_rpc|_test)$")))))
+          (add-after 'install2 'remove-caffe2-onnx-scripts
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (bin (string-append out "/bin")))
+                ;; Remove 'convert-caffe2-to-onnx' and
+                ;; 'convert-onnx-to-caffe2': they seem to be
+                ;; deprecated and they cause a failure of the
+                ;; 'sanity-check' phase:
+                ;;
+                ;; ImportError: cannot import name 'metanet_pb2' from
+                ;; partially initialized module 'caffe2.proto' (most likely
+                ;; due to a circular import)
+                (for-each delete-file
+                          (find-files bin "^convert-.*caffe2"))
+
+                (substitute* (find-files out "^entry_points\\.txt$")
+                  (("^convert-.*" all)
+                   (string-append "# " all "\n")))))))
+
+      ;; Even only the core tests take a very long time to run.
+      #:tests? #f))
     (native-inputs
-     (list cmake ninja))
+     (list cmake
+           doxygen
+           ideep-pytorch
+           ninja
+           pocketfft-cpp
+           python-expecttest
+           python-pytest-flakefinder
+           python-pytest-rerunfailures-13
+           python-pytest-shard
+           python-pytest-xdist
+           python-hypothesis
+           python-types-dataclasses
+           python-typing-extensions-4.10
+           shaderc
+           valgrind))
     (inputs
-     (list eigen
-           ;; ("fmt" ,fmt)
-           fp16
-           gemmlowp
-           googletest
-           googlebenchmark
-           gloo
-           nnpack
-           openblas
-           openmpi
-           pthreadpool
-           protobuf
-           pybind11
-           sleef
-           xnnpack
-           zstd))
+     (append
+      (list asmjit
+            clog
+            eigen
+            ffmpeg
+            flatbuffers-next
+            fmt
+            foxi
+            fp16
+            fxdiv
+            gemmlowp
+            gloo
+            googletest
+            googlebenchmark
+            libuv
+            miniz-for-pytorch
+            openblas
+            opencv
+            openmpi
+            pthreadpool
+            protobuf
+            pybind11
+            sleef
+            tensorpipe
+            vulkan-headers
+            vulkan-loader
+            vulkan-memory-allocator
+            zstd)
+      ;; TODO: fix build on 32 bit systems once Rust is available.
+      (filter
+       (lambda (pkg)
+         (member (or (%current-target-system)
+                     (%current-system))
+                 (package-transitive-supported-systems pkg)))
+       (list oneapi-dnnl
+             qnnpack
+             qnnpack-pytorch
+             xnnpack))
+      ;; nnpack requires AVX2 for x86_64-linux
+      (filter
+       (lambda (pkg)
+         (member (or (%current-target-system)
+                     (%current-system))
+                 '("armhf-linux" "aarch64-linux")))
+       (list nnpack))))
     (propagated-inputs
-     (list python-astunparse
-           python-click
-           python-numpy
-           python-pyyaml
-           python-cffi
-           python-typing-extensions
-           python-future
-           python-six
-           python-requests
-           onnx                             ;propagated for its Python modules
-           onnx-optimizer
-           cpuinfo))
+     (append
+      (list onnx ;propagated for its Python modules
+            onnx-optimizer
+            python-astunparse
+            python-click
+            python-filelock
+            python-fsspec
+            python-future
+            python-jinja2
+            python-networkx
+            python-numpy
+            python-opt-einsum
+            python-optree
+            python-packaging
+            python-psutil
+            python-pyyaml
+            python-requests
+            python-sympy
+            python-typing-extensions)
+      (filter
+       (lambda (pkg)
+         (member (or (%current-target-system)
+                     (%current-system))
+                 (package-transitive-supported-systems pkg)))
+       (list cpuinfo))))
     (home-page "https://pytorch.org/")
     (synopsis "Python library for tensor computation and deep neural networks")
     (description
@@ -4589,61 +4713,6 @@ (define-public python-pytorch
 Note: currently this package does not provide GPU support.")
     (license license:bsd-3)))
 
-(define-public python-pytorch2
-  (package
-    (inherit python-pytorch)
-    (name "python-pytorch")
-    (version "2.2.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "0hdr0d6n072qd0nq2dkxhc9pva6vggj9hpzc0glpc60vfgk0cgzb"))
-              (patches (search-patches "python-pytorch2-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-peachpy"
-                              "tbb" "XNNPACK" "zstd"))
-                  (substitute* "caffe2/CMakeLists.txt"
-                    (("target_link_libraries\\(\\$\\{test_name\\}_\\$\\{CPU_CAPABILITY\\} c10 sleef gtest_main\\)")
-                     "target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest gtest_main)"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
-    (inputs
-     (modify-inputs (package-inputs python-pytorch)
-       (replace "xnnpack" xnnpack-for-torch2)))
-    (propagated-inputs
-     (modify-inputs (package-propagated-inputs python-pytorch)
-       (append python-filelock
-               python-fsspec
-               python-jinja2
-               python-networkx
-               python-opt-einsum
-               python-sympy)
-       (replace "onnx" onnx-for-torch2)
-       (replace "onnx-optimizer" onnx-optimizer-for-torch2)))))
-
 (define-public python-pytorch-for-r-torch
   (package
     (inherit python-pytorch)
diff --git a/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch b/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
deleted file mode 100644
index 76c06520f0..0000000000
--- a/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
-
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 5d57b9ca78..620cca4e60 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -644,11 +644,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1485,7 +1480,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 50ebb224ce..5953d9ddf7 100644
---- a/caffe2/CMakeLists.txt
-+++ b/caffe2/CMakeLists.txt
-@@ -1632,7 +1632,7 @@ if(BUILD_TEST)
-         if(NOT MSVC)
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
-           # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
--          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
-+          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
-           if(USE_FBGEMM)
-             target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
-           endif()
-@@ -1655,7 +1655,7 @@ if(BUILD_TEST)
-   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1673,7 +1673,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_GPU_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       cuda_add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1691,7 +1691,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1709,7 +1709,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_HIP_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
-       target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
-
-diff --git a/torch/lib/c10d/test/CMakeLists.txt b/torch/lib/c10d/test/CMakeLists.txt
-index b74d4b65f7..fc7c207505 100644
---- a/torch/lib/c10d/test/CMakeLists.txt
-+++ b/torch/lib/c10d/test/CMakeLists.txt
-@@ -16,24 +16,24 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp c10d gtest_main)
--c10d_add_test(TCPStoreTest.cpp c10d gtest_main)
-+c10d_add_test(FileStoreTest.cpp c10d gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp c10d gtest_main gtest)
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp c10d gtest_main)
-+  c10d_add_test(HashStoreTest.cpp c10d gtest_main gtest)
- endif()
- 
- if(USE_CUDA)
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main)
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main gtest)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_C10D_NCCL)
--    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main gtest)
-     c10d_add_test(ProcessGroupNCCLErrorsTest.cpp c10d c10d_cuda_test
--        gtest_main)
-+        gtest_main gtest)
-   endif()
- else()
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main gtest)
-   endif()
- endif()
-
-diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cbb5..6075bdd0a4 100644
---- a/cmake/External/nnpack.cmake
-+++ b/cmake/External/nnpack.cmake
-@@ -40,7 +40,7 @@ endif()
- # (3) Android, iOS, Linux, macOS - supported
- ##############################################################################
- 
--if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-+if(FALSE)
-   message(STATUS "Brace yourself, we are building NNPACK")
-   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
- 
-@@ -114,6 +114,5 @@ endif()
- # (4) Catch-all: not supported.
- ##############################################################################
- 
--message(WARNING "Unknown platform - I don't know how to build NNPACK. "
--                "See cmake/External/nnpack.cmake for details.")
--set(USE_NNPACK OFF)
-+set(NNPACK_FOUND TRUE)
-+set(USE_NNPACK ON)
diff --git a/gnu/packages/patches/python-pytorch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-fix-codegen.patch
new file mode 100644
index 0000000000..cb246b25de
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-fix-codegen.patch
@@ -0,0 +1,167 @@
+This patch fixes some scripts for generating source files.  For
+gen_jit_decompositions.py, gen_mobile_upgraders.py and
+gen_jit_shape_functions.py, which depend on the compiled PyTorch library, the
+option to generate "dummy" source files is added for the initial build, which
+is later corrected.  codegen_external.py is patched to avoid duplicate
+functions and add the static keyword as in the existing generated file.
+
+diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
+index cc0263dbbf..ac34e84b82 100644
+--- a/tools/gen_flatbuffers.sh
++++ b/tools/gen_flatbuffers.sh
+@@ -1,13 +1,13 @@
+ #!/bin/bash
+ ROOT=$(pwd)
+-FF_LOCATION="$ROOT/third_party/flatbuffers"
+-cd "$FF_LOCATION" || exit
+-mkdir build
+-cd build || exit
+-cmake ..
+-cmake --build . --target flatc
+-mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
+-./flatc --cpp --gen-mutable --scoped-enums \
++#FF_LOCATION="$ROOT/third_party/flatbuffers"
++#cd "$FF_LOCATION" || exit
++#mkdir build
++#cd build || exit
++#cmake ..
++#cmake --build . --target flatc
++#mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
++flatc --cpp --gen-mutable --scoped-enums \
+      -o "$ROOT/torch/csrc/jit/serialization" \
+      -c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
+ echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
+diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
+index bc69b05162..0f8df81de3 100644
+--- a/torch/csrc/jit/tensorexpr/codegen_external.py
++++ b/torch/csrc/jit/tensorexpr/codegen_external.py
+@@ -20,9 +20,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+     native_functions = parse_native_yaml(native_functions_path, tags_path)
+     func_decls = []
+     func_registrations = []
+-    for func in native_functions:
++    done_names = set()
++    for func in native_functions[0]:
+         schema = func.func
+         name = schema.name.name.base
++        if name in done_names:
++            continue
++        else:
++            done_names.add(name)
+         args = schema.arguments
+         # Only supports extern calls for functions with out variants
+         if not schema.is_out_fn():
+@@ -62,7 +67,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+ 
+         # print(tensor_decls, name, arg_names)
+         func_decl = f"""\
+-void nnc_aten_{name}(
++static void nnc_aten_{name}(
+     int64_t bufs_num,
+     void** buf_data,
+     int64_t* buf_ranks,
+diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
+index 7cfbb803f9..2e69bb1868 100644
+--- a/torchgen/decompositions/gen_jit_decompositions.py
++++ b/torchgen/decompositions/gen_jit_decompositions.py
+@@ -1,8 +1,12 @@
+ #!/usr/bin/env python3
+ import os
+ from pathlib import Path
++import sys
+ 
+-from torch.jit._decompositions import decomposition_table
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    from torch.jit._decompositions import decomposition_table
++else:
++    decomposition_table = {}
+ 
+ # from torchgen.code_template import CodeTemplate
+ 
+@@ -85,7 +89,7 @@ def write_decomposition_util_file(path: str) -> None:
+ 
+ 
+ def main() -> None:
+-    pytorch_dir = Path(__file__).resolve().parents[3]
++    pytorch_dir = Path(__file__).resolve().parents[2]
+     upgrader_path = pytorch_dir / "torch" / "csrc" / "jit" / "runtime"
+     write_decomposition_util_file(str(upgrader_path))
+ 
+diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
+index dab1568580..55c58715fc 100644
+--- a/torchgen/operator_versions/gen_mobile_upgraders.py
++++ b/torchgen/operator_versions/gen_mobile_upgraders.py
+@@ -2,10 +2,12 @@
+ import os
+ from enum import Enum
+ from pathlib import Path
++import sys
+ from typing import Any, Dict, List
+ 
+-import torch
+-from torch.jit.generate_bytecode import generate_upgraders_bytecode
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    import torch
++    from torch.jit.generate_bytecode import generate_upgraders_bytecode
+ 
+ from torchgen.code_template import CodeTemplate
+ from torchgen.operator_versions.gen_mobile_upgraders_constant import (
+@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+ def construct_version_maps(
+     upgrader_bytecode_function_to_index_map: Dict[str, Any]
+ ) -> str:
+-    version_map = torch._C._get_operator_version_map()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        version_map = torch._C._get_operator_version_map()
++    else:
++        version_map = {}
+     sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0])  # type: ignore[no-any-return]
+     sorted_version_map = dict(sorted_version_map_)
+ 
+@@ -378,7 +383,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ 
+ 
+ def main() -> None:
+-    upgrader_list = generate_upgraders_bytecode()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        upgrader_list = generate_upgraders_bytecode()
++    else:
++        upgrader_list = []
+     sorted_upgrader_list = sort_upgrader(upgrader_list)
+     for up in sorted_upgrader_list:
+         print("after sort upgrader : ", next(iter(up)))
+diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
+index c6336a6951..34e394d818 100644
+--- a/torchgen/shape_functions/gen_jit_shape_functions.py
++++ b/torchgen/shape_functions/gen_jit_shape_functions.py
+@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
+ if not file_path.exists():
+     raise Exception(err_msg)
+ 
+-spec = importlib.util.spec_from_file_location(module_name, file_path)
+-assert spec is not None
+-module = importlib.util.module_from_spec(spec)
+-sys.modules[module_name] = module
+-assert spec.loader is not None
+-assert module is not None
+-spec.loader.exec_module(module)
+-
+-bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
+-shape_compute_graph_mapping = module.shape_compute_graph_mapping
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    spec = importlib.util.spec_from_file_location(module_name, file_path)
++    assert spec is not None
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[module_name] = module
++    assert spec.loader is not None
++    assert module is not None
++    spec.loader.exec_module(module)
++
++    bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
++    shape_compute_graph_mapping = module.shape_compute_graph_mapping
++else:
++    bounded_compute_graph_mapping = {}
++    shape_compute_graph_mapping = {}
+ 
+ 
+ SHAPE_HEADER = r"""
diff --git a/gnu/packages/patches/python-pytorch-runpath.patch b/gnu/packages/patches/python-pytorch-runpath.patch
index 7f95b88a2b..2c1724cdb0 100644
--- a/gnu/packages/patches/python-pytorch-runpath.patch
+++ b/gnu/packages/patches/python-pytorch-runpath.patch
@@ -3,10 +3,10 @@ get installed, quite surprisingly, to 'lib/python3.8/site-packages/{bin,lib}'.
 Make sure RUNPATH matches that.
 
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 5b5622f0..30d27e57 100644
+index 74836372..c8eb69d1 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1909,7 +1909,7 @@ if(BUILD_PYTHON)
+@@ -1910,7 +1910,7 @@ if(BUILD_PYTHON)
    if(${BUILDING_WITH_TORCH_LIBS})
      # site-packages/caffe2/python/caffe2_pybind11_state
      # site-packages/torch/lib
@@ -16,7 +16,7 @@ index 5b5622f0..30d27e57 100644
  
    # Must also include `CMAKE_SHARED_LINKER_FLAGS` in linker flags for
 diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index ee9cf410..f190e69b 100644
+index acc95842..8f8fb7d7 100644
 --- a/cmake/Dependencies.cmake
 +++ b/cmake/Dependencies.cmake
 @@ -4,7 +4,7 @@ if(APPLE)
@@ -28,3 +28,16 @@ index ee9cf410..f190e69b 100644
  endif(APPLE)
  # Use separate rpaths during build and install phases
  set(CMAKE_SKIP_BUILD_RPATH  FALSE)
+diff --git a/functorch/CMakeLists.txt b/functorch/CMakeLists.txt
+index f2f32745..db21b656 100644
+--- a/functorch/CMakeLists.txt
++++ b/functorch/CMakeLists.txt
+@@ -21,7 +21,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE pybind::pybind11)
+ 
+ set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
+       ${CMAKE_BINARY_DIR}/functorch)
+-set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${_rpath_portable_origin}/../torch/lib")
++set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/../torch/lib")
+ 
+ # Copy-pasted prefix/suffix logic for Python extensions from
+ # https://github.com/pytorch/pytorch/blob/33bb8ae350611760139457b85842b1d7edf9aa11/caffe2/CMakeLists.txt#L1975
diff --git a/gnu/packages/patches/python-pytorch-system-libraries.patch b/gnu/packages/patches/python-pytorch-system-libraries.patch
index fd849fd9e2..99f999f32f 100644
--- a/gnu/packages/patches/python-pytorch-system-libraries.patch
+++ b/gnu/packages/patches/python-pytorch-system-libraries.patch
@@ -1,38 +1,104 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
+Patch build files to also system libraries instead of bundled ones for the
+libraries not supported or working only by specifying USE_SYSTEM_LIBS.  This
+includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
+ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
+For QNNPACK, two versions were bundled and are required: The upstream one and
+an internal fork (now in the package qnnpack-pytorch).
 
+diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
+index 2c2b967..5ac5fa6 100644
+--- a/aten/src/ATen/CMakeLists.txt
++++ b/aten/src/ATen/CMakeLists.txt
+@@ -371,9 +371,9 @@ if(AT_NNPACK_ENABLED)
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
+ endif()
+ 
+-if(MKLDNN_FOUND)
+-  list(APPEND ATen_CPU_DEPENDENCY_LIBS ${MKLDNN_LIBRARIES})
+-endif(MKLDNN_FOUND)
++if(USE_MKLDNN)
++  list(APPEND ATen_CPU_DEPENDENCY_LIBS DNNL::dnnl)
++endif(USE_MKLDNN)
+ 
+ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x|ppc64le)$")
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index d57d7ebb..5b5622f0 100644
+index 7483637..093de40 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1736,7 +1736,7 @@ if(BUILD_TEST)
+@@ -111,9 +111,6 @@ if(NOT MSVC AND USE_XNNPACK)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+-    add_subdirectory(
+-      "${FXDIV_SOURCE_DIR}"
+-      "${CMAKE_BINARY_DIR}/FXdiv")
+   endif()
+ endif()
+ 
+@@ -1055,7 +1052,6 @@ elseif(USE_CUDA)
+ endif()
+ 
+ if(NOT MSVC AND USE_XNNPACK)
+-  TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 
+ # ==========================================================
+@@ -1396,6 +1392,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+ target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
++target_link_libraries(torch_cpu PRIVATE miniz clog)
+ if(USE_MPI)
+   target_link_libraries(torch_cpu PRIVATE MPI::MPI_CXX)
+ endif()
+@@ -1653,7 +1650,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
+   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
+   target_link_libraries(static_runtime_bench torch_library benchmark)
+-  target_link_libraries(static_runtime_test torch_library gtest_main)
++  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
+ endif()
+ 
+ if(BUILD_TENSOREXPR_BENCHMARK)
+@@ -1680,7 +1677,7 @@ if(BUILD_MOBILE_TEST)
+   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
+@@ -1701,7 +1698,7 @@ if(BUILD_TEST)
          if(NOT MSVC)
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
            # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
 -          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
 +          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
            if(USE_FBGEMM)
              target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
            endif()
-@@ -1759,7 +1759,7 @@ if(BUILD_TEST)
+@@ -1715,7 +1712,7 @@ if(BUILD_TEST)
+           endif()
+         else()
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
+         endif()
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+@@ -1732,7 +1729,7 @@ if(BUILD_TEST)
    foreach(test_src ${Caffe2_CPU_TEST_SRCS})
      get_filename_component(test_name ${test_src} NAME_WE)
      add_executable(${test_name} "${test_src}")
 -    target_link_libraries(${test_name} torch_library gtest_main)
 +    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     if(USE_OPENMP)
-       # -fopenmp is a compile time flag and as result not guaranteed
-       # to link executable against OpenMP runtime library
-@@ -1785,7 +1785,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_GPU_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1803,7 +1803,7 @@ if(BUILD_TEST)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+@@ -1795,7 +1792,7 @@ if(BUILD_TEST)
      foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
        get_filename_component(test_name ${test_src} NAME_WE)
        add_executable(${test_name} "${test_src}")
@@ -41,20 +107,66 @@ index d57d7ebb..5b5622f0 100644
        target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
        target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
        add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1821,7 +1821,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_HIP_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
-       target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
+diff --git a/caffe2/serialize/CMakeLists.txt b/caffe2/serialize/CMakeLists.txt
+index 1552b59..67e1a9a 100644
+--- a/caffe2/serialize/CMakeLists.txt
++++ b/caffe2/serialize/CMakeLists.txt
+@@ -2,7 +2,6 @@ file(GLOB tmp *_test.cc)
+ 
+ set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
+ list(APPEND Caffe2_CPU_SRCS
+-  ${PROJECT_SOURCE_DIR}/third_party/miniz-2.1.0/miniz.c
+   ${CMAKE_CURRENT_SOURCE_DIR}/inline_container.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/istream_adapter.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/file_adapter.cc
 diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 557ab649..ee9cf410 100644
+index acc9584..97275bf 100644
 --- a/cmake/Dependencies.cmake
 +++ b/cmake/Dependencies.cmake
-@@ -732,11 +732,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+@@ -283,7 +283,7 @@ endif()
+ # --- [ PocketFFT
+ set(AT_POCKETFFT_ENABLED 0)
+ if(NOT AT_MKL_ENABLED)
+-  set(POCKETFFT_INCLUDE_DIR "${Torch_SOURCE_DIR}/third_party/pocketfft/")
++  set(POCKETFFT_INCLUDE_DIR "#POCKETFFT_INCLUDE_DIR")
+   if(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}")
+     message(FATAL_ERROR "pocketfft directory not found, expected ${POCKETFFT_INCLUDE_DIR}")
+   elif(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}/pocketfft_hdronly.h")
+@@ -489,19 +489,6 @@ if(USE_QNNPACK)
+     set(QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+     set(QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+     set(QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-    add_subdirectory(
+-      "${QNNPACK_SOURCE_DIR}"
+-      "${CONFU_DEPENDENCIES_BINARY_DIR}/QNNPACK")
+-
+-    # TODO: See https://github.com/pytorch/pytorch/issues/56285
+-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+-      target_compile_options(qnnpack PRIVATE -Wno-deprecated-declarations)
+-    endif()
+-
+-    # We build static versions of QNNPACK and pthreadpool but link
+-    # them into a shared library for Caffe2, so they need PIC.
+-    set_property(TARGET qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+     if(QNNPACK_CUSTOM_THREADPOOL)
+       target_compile_definitions(
+@@ -550,13 +537,6 @@ if(USE_PYTORCH_QNNPACK)
+       set(PYTORCH_QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-      add_subdirectory(
+-        "${PYTORCH_QNNPACK_SOURCE_DIR}"
+-        "${CONFU_DEPENDENCIES_BINARY_DIR}/pytorch_qnnpack")
+-      # We build static versions of QNNPACK and pthreadpool but link
+-      # them into a shared library for Caffe2, so they need PIC.
+-      set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-      set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+       if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
+         target_compile_definitions(
+@@ -728,11 +708,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
    # this shouldn't be necessary anymore.
    get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
    set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
@@ -66,7 +178,49 @@ index 557ab649..ee9cf410 100644
  
    # We will not need to test benchmark lib itself.
    set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1543,7 +1538,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+@@ -810,16 +785,6 @@ if(USE_FBGEMM)
+     if(USE_ASAN)
+       set(USE_SANITIZER "address,undefined" CACHE STRING "-fsanitize options for FBGEMM")
+     endif()
+-    add_subdirectory("${FBGEMM_SOURCE_DIR}")
+-    set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
+-      # See https://github.com/pytorch/pytorch/issues/74352
+-      target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
+-      target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
+-    endif()
+   endif()
+ 
+   if(USE_FBGEMM)
+@@ -979,7 +944,7 @@ if(NOT TARGET fp16 AND NOT USE_SYSTEM_FP16)
+     "${FP16_SOURCE_DIR}"
+     "${CONFU_DEPENDENCIES_BINARY_DIR}/FP16")
+ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
+-  add_library(fp16 STATIC "/usr/include/fp16.h")
++  add_library(fp16 STATIC "#FP16_INCLUDE_DIR")
+   set_target_properties(fp16 PROPERTIES LINKER_LANGUAGE C)
+ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
+@@ -1362,7 +1327,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ 
+     # Tensorpipe uses cuda_add_library
+     torch_update_find_cuda_flags()
+-    add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
+ 
+     list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
+     if(USE_CUDA)
+@@ -1529,7 +1493,6 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+       set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
+     endif()
+   endif()
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+ 
+   add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+   if(NOT USE_SYSTEM_ONNX)
+@@ -1560,7 +1523,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
      endif()
      set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
      message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
@@ -75,8 +229,36 @@ index 557ab649..ee9cf410 100644
    endif()
    include_directories(${FOXI_INCLUDE_DIRS})
    list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
+@@ -1739,9 +1702,8 @@ if(NOT INTERN_BUILD_MOBILE)
+   endif()
+   if(USE_MKLDNN)
+     include(${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake)
+-    if(MKLDNN_FOUND)
++    if(DNNL_FOUND)
+       set(AT_MKLDNN_ENABLED 1)
+-      include_directories(AFTER SYSTEM ${MKLDNN_INCLUDE_DIR})
+       if(BUILD_CAFFE2_OPS)
+         list(APPEND Caffe2_DEPENDENCY_LIBS caffe2::mkldnn)
+       endif(BUILD_CAFFE2_OPS)
+@@ -1796,7 +1758,7 @@ endif()
+ #
+ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
+-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
++find_package(fmt)
+ 
+ # Disable compiler feature checks for `fmt`.
+ #
+@@ -1805,7 +1767,6 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
+ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
+ # `fmt` is compatible with a superset of the compilers that PyTorch is, it
+ # shouldn't be too bad to just disable the checks.
+-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "")
+ 
+ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
+ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
 diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cb..6075bdd0 100644
+index 9d5f064..c3624e5 100644
 --- a/cmake/External/nnpack.cmake
 +++ b/cmake/External/nnpack.cmake
 @@ -40,7 +40,7 @@ endif()
@@ -88,7 +270,7 @@ index a41343cb..6075bdd0 100644
    message(STATUS "Brace yourself, we are building NNPACK")
    set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
  
-@@ -114,6 +114,5 @@ endif()
+@@ -112,6 +112,5 @@ endif()
  # (4) Catch-all: not supported.
  ##############################################################################
  
@@ -97,8 +279,45 @@ index a41343cb..6075bdd0 100644
 -set(USE_NNPACK OFF)
 +set(NNPACK_FOUND TRUE)
 +set(USE_NNPACK ON)
+diff --git a/cmake/public/mkldnn.cmake b/cmake/public/mkldnn.cmake
+index 8793562..9f8fa3d 100644
+--- a/cmake/public/mkldnn.cmake
++++ b/cmake/public/mkldnn.cmake
+@@ -4,7 +4,7 @@ if(CPU_AARCH64)
+   include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake)
+ endif()
+ 
+-find_package(MKLDNN QUIET)
++find_package(DNNL REQUIRED)
+ 
+ if(NOT TARGET caffe2::mkldnn)
+   add_library(caffe2::mkldnn INTERFACE IMPORTED)
+@@ -15,4 +15,4 @@ set_property(
+   ${MKLDNN_INCLUDE_DIR})
+ set_property(
+   TARGET caffe2::mkldnn PROPERTY INTERFACE_LINK_LIBRARIES
+-  ${MKLDNN_LIBRARIES})
++  DNNL::dnnl)
+diff --git a/setup.py b/setup.py
+index 81f3c6c..3251cab 100644
+--- a/setup.py
++++ b/setup.py
+@@ -482,13 +482,9 @@ def build_deps():
+     # Windows has very poor support for them.
+     sym_files = [
+         "tools/shared/_utils_internal.py",
+-        "torch/utils/benchmark/utils/valgrind_wrapper/callgrind.h",
+-        "torch/utils/benchmark/utils/valgrind_wrapper/valgrind.h",
+     ]
+     orig_files = [
+         "torch/_utils_internal.py",
+-        "third_party/valgrind-headers/callgrind.h",
+-        "third_party/valgrind-headers/valgrind.h",
+     ]
+     for sym_file, orig_file in zip(sym_files, orig_files):
+         same = False
 diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
-index bf91460c..ef56948f 100644
+index 5c89748..ef84c57 100644
 --- a/test/cpp/c10d/CMakeLists.txt
 +++ b/test/cpp/c10d/CMakeLists.txt
 @@ -16,14 +16,14 @@ function(c10d_add_test test_src)
@@ -133,7 +352,29 @@ index bf91460c..ef56948f 100644
    endif()
    if(USE_NCCL AND USE_C10D_NCCL)
      # NCCL is a private dependency of libtorch, but the tests include some
-@@ -56,7 +56,7 @@ if(USE_CUDA)
+@@ -44,10 +44,10 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupNCCLTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     c10d_add_test(
+       ProcessGroupNCCLErrorsTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+       install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+@@ -61,7 +61,7 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupUCCTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_ucc)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_ucc)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupUCCTest DESTINATION bin)
+       install(TARGETS c10d_cuda_test DESTINATION lib)
+@@ -69,7 +69,7 @@ if(USE_CUDA)
    endif()
  else()
    if(USE_GLOO AND USE_C10D_GLOO)
@@ -143,10 +384,10 @@ index bf91460c..ef56948f 100644
  endif()
  
 diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
-index 8fc5a0a1..643202f6 100644
+index 012471d..d39b625 100644
 --- a/test/cpp/tensorexpr/CMakeLists.txt
 +++ b/test/cpp/tensorexpr/CMakeLists.txt
-@@ -53,7 +53,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+@@ -54,7 +54,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
  # pthreadpool header. For some build environment we need add the dependency
  # explicitly.
  if(USE_PTHREADPOOL)
@@ -154,4 +395,4 @@ index 8fc5a0a1..643202f6 100644
 +  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
  endif()
  if(USE_CUDA)
-   target_link_libraries(test_tensorexpr PRIVATE
+   target_compile_definitions(test_tensorexpr PRIVATE USE_CUDA)
diff --git a/gnu/packages/patches/python-pytorch-without-kineto.patch b/gnu/packages/patches/python-pytorch-without-kineto.patch
new file mode 100644
index 0000000000..f956316866
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-without-kineto.patch
@@ -0,0 +1,60 @@
+Even when building without Kineto, the <ActivityType.h> header is still
+imported and the ActivityType type is used. This patch was copied from
+https://github.com/pytorch/pytorch/pull/111048.
+
+diff --git a/torch/csrc/profiler/kineto_shim.h b/torch/csrc/profiler/kineto_shim.h
+index e92cbf00..68985ab7 100644
+--- a/torch/csrc/profiler/kineto_shim.h
++++ b/torch/csrc/profiler/kineto_shim.h
+@@ -12,7 +12,51 @@
+ #undef USE_KINETO
+ #endif
+ 
++#ifdef USE_KINETO
+ #include <ActivityType.h>
++#else
++namespace libkineto {
++// copied from header
++/*
++ * Copyright (c) Meta Platforms, Inc. and affiliates.
++ * All rights reserved.
++ *
++ * This source code is licensed under the BSD-style license found in the
++ * LICENSE file in the root directory of this source tree.
++ */
++
++// Note : All activity types are not enabled by default. Please add them
++// at correct position in the enum
++enum class ActivityType {
++    // Activity types enabled by default
++    CPU_OP = 0, // cpu side ops
++    USER_ANNOTATION,
++    GPU_USER_ANNOTATION,
++    GPU_MEMCPY,
++    GPU_MEMSET,
++    CONCURRENT_KERNEL, // on-device kernels
++    EXTERNAL_CORRELATION,
++    CUDA_RUNTIME, // host side cuda runtime events
++    CUDA_DRIVER, // host side cuda driver events
++    CPU_INSTANT_EVENT, // host side point-like events
++    PYTHON_FUNCTION,
++    OVERHEAD, // CUPTI induced overhead events sampled from its overhead API.
++
++    // Optional Activity types
++    CUDA_SYNC, // synchronization events between runtime and kernels
++    GLOW_RUNTIME, // host side glow runtime events
++    MTIA_RUNTIME, // host side MTIA runtime events
++    CUDA_PROFILER_RANGE, // CUPTI Profiler range for performance metrics
++    MTIA_CCP_EVENTS, // MTIA ondevice CCP events
++    HPU_OP, // HPU host side runtime event
++    XPU_RUNTIME, // host side xpu runtime events
++
++    ENUM_COUNT, // This is to add buffer and not used for any profiling logic. Add your new type before it.
++    OPTIONAL_ACTIVITY_TYPE_START = CUDA_SYNC,
++};
++}
++
++#endif
+ 
+ #include <torch/csrc/Export.h>
+ #include <torch/csrc/profiler/api.h>
-- 
2.41.0





^ permalink raw reply related	[relevance 46%]

* [bug#69591] [PATCH v4 03/32] gnu: Add python-optree.
    2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 02/32] gnu: Add python-typing-extensions-4.10 David Elsing
@ 2024-03-23 22:04 63% ` David Elsing
  2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 04/32] gnu: Add python-pytest-flakefinder David Elsing
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-23 22:04 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-xyz.scm (python-optree): New variable.
---
 .../patches/python-optree-fix-32-bit.patch    | 122 ++++++++++++++++++
 gnu/packages/python-xyz.scm                   |  30 +++++
 2 files changed, 152 insertions(+)
 create mode 100644 gnu/packages/patches/python-optree-fix-32-bit.patch

diff --git a/gnu/packages/patches/python-optree-fix-32-bit.patch b/gnu/packages/patches/python-optree-fix-32-bit.patch
new file mode 100644
index 0000000000..6a32c39bd8
--- /dev/null
+++ b/gnu/packages/patches/python-optree-fix-32-bit.patch
@@ -0,0 +1,122 @@
+In include/utils.h, ssize_t is an alias for py::ssize_t, which is an alias for
+Py_ssize_t in Python, which is an alias for the system ssize_t.
+The latter is defined in glibc as int if __WORDSIZE == 32 and as long int if
+__WORDSIZE == 64.  Therefore, we need to remove the explicit template
+specialization for int in the first case.
+
+diff --git a/include/utils.h b/include/utils.h
+index 950a02b..82a9591 100644
+--- a/include/utils.h
++++ b/include/utils.h
+@@ -141,10 +141,12 @@ template <>
+ inline py::handle GET_ITEM_HANDLE<py::tuple>(const py::handle& container, const size_t& item) {
+     return PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::tuple>(const py::handle& container, const int& item) {
+     return PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#endif
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const ssize_t& item) {
+     return PyList_GET_ITEM(container.ptr(), item);
+@@ -153,10 +155,12 @@ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const size_t& item) {
+     return PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const int& item) {
+     return PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline py::object GET_ITEM_BORROW(const py::handle& container, const Item& item) {
+@@ -171,11 +175,13 @@ inline py::object GET_ITEM_BORROW<py::tuple>(const py::handle& container, const
+     return py::reinterpret_borrow<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_BORROW<py::tuple>(const py::handle& container, const int& item) {
+     return py::reinterpret_borrow<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ template <>
+ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const ssize_t& item) {
+     return py::reinterpret_borrow<py::object>(PyList_GET_ITEM(container.ptr(), item));
+@@ -185,11 +191,13 @@ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const s
+     return py::reinterpret_borrow<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const int& item) {
+     return py::reinterpret_borrow<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline py::object GET_ITEM_STEAL(const py::handle& container, const Item& item) {
+@@ -204,11 +212,13 @@ inline py::object GET_ITEM_STEAL<py::tuple>(const py::handle& container, const s
+     return py::reinterpret_steal<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_STEAL<py::tuple>(const py::handle& container, const int& item) {
+     return py::reinterpret_steal<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ template <>
+ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const ssize_t& item) {
+     return py::reinterpret_steal<py::object>(PyList_GET_ITEM(container.ptr(), item));
+@@ -218,11 +228,13 @@ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const si
+     return py::reinterpret_steal<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const int& item) {
+     return py::reinterpret_steal<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline void SET_ITEM(const py::handle& container, const Item& item, const py::handle& value) {
+@@ -240,12 +252,14 @@ inline void SET_ITEM<py::tuple>(const py::handle& container,
+                                 const py::handle& value) {
+     PyTuple_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline void SET_ITEM<py::tuple>(const py::handle& container,
+                                 const int& item,
+                                 const py::handle& value) {
+     PyTuple_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#endif
+ template <>
+ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const ssize_t& item,
+@@ -258,12 +272,14 @@ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const py::handle& value) {
+     PyList_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const int& item,
+                                const py::handle& value) {
+     PyList_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#endif
+ 
+ template <typename PyType>
+ inline void AssertExact(const py::handle& object) {
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index aad89d251e..5357c94b8c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -150,6 +150,7 @@
 ;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
 ;;; Copyright © 2024 Ian Eure <ian@retrospec.tv>
 ;;; Copyright © 2024 Adriel Dumas--Jondeau <leirda@disroot.org>
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -11741,6 +11742,35 @@ (define-public python-treelib
      "This package provides a Python implementation of a tree structure.")
     (license license:asl2.0)))
 
+(define-public python-optree
+  (package
+    (name "python-optree")
+    (version "0.10.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/metaopt/optree")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1q3wljk7cyl5rsam02sfsj8zjrqx4c3x9vic8j6xx13p8czpsisg"))
+       (patches (search-patches "python-optree-fix-32-bit.patch"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-typing-extensions))
+    (native-inputs
+     (list python-pytest
+           python-pytest-cov
+           python-pytest-xdist
+           cmake
+           pybind11))
+    (home-page "https://github.com/metaopt/optree")
+    (synopsis "Optimized PyTree Utilities")
+    (description "This package contains operations on PyTrees (a tree made of
+container data structures in Python).")
+    (license license:asl2.0)))
+
 (define-public python-jupyter-core
   (package
     (name "python-jupyter-core")
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#69591] [PATCH v4 02/32] gnu: Add python-typing-extensions-4.10.
  @ 2024-03-23 22:04 65% ` David Elsing
  2024-03-23 22:04 63% ` [bug#69591] [PATCH v4 03/32] gnu: Add python-optree David Elsing
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-23 22:04 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-build.scm (python-typing-extensions-4.10): New variable.
---
 gnu/packages/python-build.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 2ea457cdba..dfd59d5e25 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2022 Garek Dyszel <garekdyszel@disroot.org>
 ;;; Copyright © 2022 Greg Hogan <code@greghogan.com>
-
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -252,6 +252,18 @@ (define-public python-typing-extensions
 @end enumerate\n")
     (license license:psfl)))
 
+(define-public python-typing-extensions-4.10
+  (package
+    (inherit python-typing-extensions)
+    (version "4.10.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "typing_extensions" version))
+       (sha256
+        (base32
+         "1jxkj4pni8pdyrn79sq441lsp40xzw363n0qvfc6zfcgkv4dgaxh"))))))
+
 \f
 ;;;
 ;;; Python builder packages.
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v4 32/32] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch.
                     ` (6 preceding siblings ...)
  2024-03-23 22:05 46% ` [bug#69591] [PATCH v4 26/32] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
@ 2024-03-23 22:05 43% ` David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-23 22:05 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/machine-learning.scm (%python-pytorch-for-r-torch-src): Add
patches.
(python-pytorch-for-r-torch)[version]: Use
%python-pytorch-for-r-torch-version.
[source]: Use %python-pytorch-for-r-torch-src.
[native-inputs]: Use 'modify-inputs'.
[inputs]: Don't replace xnnpack. Replace qnnpack-pytorch with
qnnpack-pytorch-for-r-torch and oneapi-dnnl with oneapi-dnnl-for-r-torch.
[propagated-inputs]: Don't replace onnx and onnx-optimizer.
* gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen: New file.
* gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch: New file.
* gnu/packages/patches/python-pytorch2-system-libraries.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                  |   1 -
 gnu/packages/machine-learning.scm             |  61 +--
 ...thon-pytorch-for-r-torch-fix-codegen.patch | 167 ++++++++
 ...pytorch-for-r-torch-system-libraries.patch | 399 ++++++++++++++++++
 .../python-pytorch2-system-libraries.patch    | 156 -------
 5 files changed, 586 insertions(+), 198 deletions(-)
 create mode 100644 gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
 create mode 100644 gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
 delete mode 100644 gnu/packages/patches/python-pytorch2-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c7dfe1b873..a9fae2052d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1813,7 +1813,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyreadstat-link-libiconv.patch	\
   %D%/packages/patches/python-pyls-black-41.patch		\
   %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch	\
-  %D%/packages/patches/python-pytorch2-system-libraries.patch	\
   %D%/packages/patches/python-sip-include-dirs.patch	\
   %D%/packages/patches/python-sgmllib3k-assertions.patch	\
   %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch	\
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 834de52fa1..c3014ced14 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4755,7 +4755,15 @@ (define %python-pytorch-for-r-torch-src
                               %python-pytorch-for-r-torch-version))
     (sha256
      (base32
-      "0iirrn687i7sfv0p0i7dn89x3rf13a7l8y1y5h190h51yjxpxqxa"))))
+      "0iirrn687i7sfv0p0i7dn89x3rf13a7l8y1y5h190h51yjxpxqxa"))
+    (patches (search-patches
+              "python-pytorch-for-r-torch-system-libraries.patch"
+              "python-pytorch-runpath.patch"
+              "python-pytorch-without-kineto.patch"
+              ;; Some autogeneration scripts depend on the
+              ;; compile PyTorch library. Therefore, we create
+              ;; dummy versions which are regenerated later.
+              "python-pytorch-for-r-torch-fix-codegen.patch"))))
 
 (define-public qnnpack-pytorch-for-r-torch
   (package
@@ -4771,56 +4779,27 @@ (define-public qnnpack-pytorch-for-r-torch
        (snippet
         (origin-snippet (package-source qnnpack-pytorch)))))))
 
+;; Keep in sync with r-torch
 (define-public python-pytorch-for-r-torch
   (package
     (inherit python-pytorch)
     (name "python-pytorch")
-    (version "2.0.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "14m7v54zyd2qg2xk9mqdpbf4ps7091mdzinzh4vq9p5k4bpznj65"))
-              (patches (search-patches "python-pytorch2-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-enum" "python-peachpy"
-                              "python-six" "tbb" "XNNPACK" "zstd"))
-                  (substitute* "caffe2/CMakeLists.txt"
-                    (("target_link_libraries\\(\\$\\{test_name\\}_\\$\\{CPU_CAPABILITY\\} c10 sleef gtest_main\\)")
-                     "target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest gtest_main)"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
+    (version %python-pytorch-for-r-torch-version)
+    (source %python-pytorch-for-r-torch-src)
+    (native-inputs
+     (modify-inputs (package-native-inputs python-pytorch)
+       (replace "ideep-pytorch" ideep-pytorch-for-r-torch)))
+    (inputs
+     (modify-inputs (package-inputs python-pytorch)
+       (replace "qnnpack-pytorch" qnnpack-pytorch-for-r-torch)
+       (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch)))
     (propagated-inputs
      (modify-inputs (package-propagated-inputs python-pytorch)
        (append python-filelock
                python-jinja2
                python-networkx
                python-opt-einsum
-               python-sympy)
-       (replace "onnx" onnx-for-torch2)
-       (replace "onnx-optimizer" onnx-optimizer-for-torch2)))))
+               python-sympy)))))
 
 (define-public python-pytorch-geometric
   (package
diff --git a/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
new file mode 100644
index 0000000000..8515e5ab13
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
@@ -0,0 +1,167 @@
+This patch fixes some scripts for generating source files.  For
+gen_jit_decompositions.py, gen_mobile_upgraders.py and
+gen_jit_shape_functions.py, which depend on the compiled PyTorch library, the
+option to generate "dummy" source files is added for the initial build, which
+is later corrected.  codegen_external.py is patched to avoid duplicate
+functions and add the static keyword as in the existing generated file.
+
+diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
+index cc0263dbbf..ac34e84b82 100644
+--- a/tools/gen_flatbuffers.sh
++++ b/tools/gen_flatbuffers.sh
+@@ -1,13 +1,13 @@
+ #!/bin/bash
+ ROOT=$(pwd)
+-FF_LOCATION="$ROOT/third_party/flatbuffers"
+-cd "$FF_LOCATION" || exit
+-mkdir build
+-cd build || exit
+-cmake ..
+-cmake --build . --target flatc
+-mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
+-./flatc --cpp --gen-mutable --scoped-enums \
++#FF_LOCATION="$ROOT/third_party/flatbuffers"
++#cd "$FF_LOCATION" || exit
++#mkdir build
++#cd build || exit
++#cmake ..
++#cmake --build . --target flatc
++#mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
++flatc --cpp --gen-mutable --scoped-enums \
+      -o "$ROOT/torch/csrc/jit/serialization" \
+      -c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
+ echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
+diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
+index 120520b139..0c8587f02d 100644
+--- a/torch/csrc/jit/tensorexpr/codegen_external.py
++++ b/torch/csrc/jit/tensorexpr/codegen_external.py
+@@ -16,9 +16,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+     native_functions = parse_native_yaml(native_functions_path, tags_path)
+     func_decls = []
+     func_registrations = []
+-    for func in native_functions:
++    done_names = set()
++    for func in native_functions[0]:
+         schema = func.func
+         name = schema.name.name.base
++        if name in done_names:
++            continue
++        else:
++            done_names.add(name)
+         args = schema.arguments
+         # Only supports extern calls for functions with out variants
+         if not schema.is_out_fn():
+@@ -48,7 +53,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+ 
+         # print(tensor_decls, name, arg_names)
+         func_decl = f"""\
+-void nnc_aten_{name}(
++static void nnc_aten_{name}(
+     int64_t bufs_num,
+     void** buf_data,
+     int64_t* buf_ranks,
+diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
+index 7cfbb803f9..2e69bb1868 100644
+--- a/torchgen/decompositions/gen_jit_decompositions.py
++++ b/torchgen/decompositions/gen_jit_decompositions.py
+@@ -1,8 +1,12 @@
+ #!/usr/bin/env python3
+ import os
+ from pathlib import Path
++import sys
+ 
+-from torch.jit._decompositions import decomposition_table
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    from torch.jit._decompositions import decomposition_table
++else:
++    decomposition_table = {}
+ 
+ # from torchgen.code_template import CodeTemplate
+ 
+@@ -85,7 +89,7 @@ def write_decomposition_util_file(path: str) -> None:
+ 
+ 
+ def main() -> None:
+-    pytorch_dir = Path(__file__).resolve().parents[3]
++    pytorch_dir = Path(__file__).resolve().parents[2]
+     upgrader_path = pytorch_dir / "torch" / "csrc" / "jit" / "runtime"
+     write_decomposition_util_file(str(upgrader_path))
+ 
+diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
+index e5287cffc5..57f3c38096 100644
+--- a/torchgen/operator_versions/gen_mobile_upgraders.py
++++ b/torchgen/operator_versions/gen_mobile_upgraders.py
+@@ -2,10 +2,12 @@
+ import os
+ from enum import Enum
+ from pathlib import Path
++import sys
+ from typing import Any, Dict, List
+ 
+-import torch
+-from torch.jit.generate_bytecode import generate_upgraders_bytecode
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    import torch
++    from torch.jit.generate_bytecode import generate_upgraders_bytecode
+ 
+ from torchgen.code_template import CodeTemplate
+ from torchgen.operator_versions.gen_mobile_upgraders_constant import (
+@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+ def construct_version_maps(
+     upgrader_bytecode_function_to_index_map: Dict[str, Any]
+ ) -> str:
+-    version_map = torch._C._get_operator_version_map()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        version_map = torch._C._get_operator_version_map()
++    else:
++        version_map = {}
+     sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0])  # type: ignore[no-any-return]
+     sorted_version_map = {name: lst for name, lst in sorted_version_map_}
+ 
+@@ -379,7 +384,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ 
+ def main() -> None:
+ 
+-    upgrader_list = generate_upgraders_bytecode()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        upgrader_list = generate_upgraders_bytecode()
++    else:
++        upgrader_list = []
+     sorted_upgrader_list = sort_upgrader(upgrader_list)
+     for up in sorted_upgrader_list:
+         print("after sort upgrader : ", next(iter(up)))
+diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
+index c6336a6951..34e394d818 100644
+--- a/torchgen/shape_functions/gen_jit_shape_functions.py
++++ b/torchgen/shape_functions/gen_jit_shape_functions.py
+@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
+ if not file_path.exists():
+     raise Exception(err_msg)
+ 
+-spec = importlib.util.spec_from_file_location(module_name, file_path)
+-assert spec is not None
+-module = importlib.util.module_from_spec(spec)
+-sys.modules[module_name] = module
+-assert spec.loader is not None
+-assert module is not None
+-spec.loader.exec_module(module)
+-
+-bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
+-shape_compute_graph_mapping = module.shape_compute_graph_mapping
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    spec = importlib.util.spec_from_file_location(module_name, file_path)
++    assert spec is not None
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[module_name] = module
++    assert spec.loader is not None
++    assert module is not None
++    spec.loader.exec_module(module)
++
++    bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
++    shape_compute_graph_mapping = module.shape_compute_graph_mapping
++else:
++    bounded_compute_graph_mapping = {}
++    shape_compute_graph_mapping = {}
+ 
+ 
+ SHAPE_HEADER = r"""
diff --git a/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch b/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
new file mode 100644
index 0000000000..e5d647f70d
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
@@ -0,0 +1,399 @@
+Patch build files to also system libraries instead of bundled ones for the
+libraries not supported or working only by specifying USE_SYSTEM_LIBS.  This
+includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
+ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
+For QNNPACK, two versions were bundled and are required: The upstream one and
+an internal fork (now in the package qnnpack-pytorch).
+
+diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
+index 96fc297..7f27b66 100644
+--- a/aten/src/ATen/CMakeLists.txt
++++ b/aten/src/ATen/CMakeLists.txt
+@@ -362,9 +362,9 @@ if(AT_NNPACK_ENABLED)
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
+ endif()
+ 
+-if(MKLDNN_FOUND)
+-  list(APPEND ATen_CPU_DEPENDENCY_LIBS ${MKLDNN_LIBRARIES})
+-endif(MKLDNN_FOUND)
++if(USE_MKLDNN)
++  list(APPEND ATen_CPU_DEPENDENCY_LIBS DNNL::dnnl)
++endif(USE_MKLDNN)
+ 
+ list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
+ 
+diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
+index 221e3f3..417f601 100644
+--- a/caffe2/CMakeLists.txt
++++ b/caffe2/CMakeLists.txt
+@@ -110,9 +110,6 @@ if(NOT MSVC AND USE_XNNPACK)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+-    add_subdirectory(
+-      "${FXDIV_SOURCE_DIR}"
+-      "${CMAKE_BINARY_DIR}/FXdiv")
+   endif()
+ endif()
+ 
+@@ -975,7 +972,6 @@ elseif(USE_CUDA)
+ endif()
+ 
+ if(NOT MSVC AND USE_XNNPACK)
+-  TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 
+ # ==========================================================
+@@ -1314,6 +1310,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+ target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
++target_link_libraries(torch_cpu PRIVATE miniz clog)
+ target_include_directories(torch_cpu INTERFACE $<INSTALL_INTERFACE:include>)
+ target_include_directories(torch_cpu PRIVATE ${Caffe2_CPU_INCLUDE})
+ target_include_directories(torch_cpu SYSTEM PRIVATE "${Caffe2_DEPENDENCY_INCLUDE}")
+@@ -1570,7 +1567,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
+   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
+   target_link_libraries(static_runtime_bench torch_library benchmark)
+-  target_link_libraries(static_runtime_test torch_library gtest_main)
++  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
+ endif()
+ 
+ if(BUILD_TENSOREXPR_BENCHMARK)
+@@ -1601,7 +1598,7 @@ if(BUILD_MOBILE_TEST)
+   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
+@@ -1622,13 +1619,13 @@ if(BUILD_TEST)
+         if(NOT MSVC)
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
+           # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
+           if(USE_FBGEMM)
+             target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
+           endif()
+         else()
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
+         endif()
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+@@ -1645,7 +1642,7 @@ if(BUILD_TEST)
+   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+@@ -1703,7 +1700,7 @@ if(BUILD_TEST)
+     foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
+       get_filename_component(test_name ${test_src} NAME_WE)
+       add_executable(${test_name} "${test_src}")
+-      target_link_libraries(${test_name} torch_library gtest_main)
++      target_link_libraries(${test_name} torch_library gtest_main gtest)
+       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
+diff --git a/caffe2/serialize/CMakeLists.txt b/caffe2/serialize/CMakeLists.txt
+index 1552b59..67e1a9a 100644
+--- a/caffe2/serialize/CMakeLists.txt
++++ b/caffe2/serialize/CMakeLists.txt
+@@ -2,7 +2,6 @@ file(GLOB tmp *_test.cc)
+ 
+ set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
+ list(APPEND Caffe2_CPU_SRCS
+-  ${PROJECT_SOURCE_DIR}/third_party/miniz-2.1.0/miniz.c
+   ${CMAKE_CURRENT_SOURCE_DIR}/inline_container.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/istream_adapter.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/file_adapter.cc
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index 8c0e3c2..d65576a 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -298,7 +298,7 @@ endif()
+ # --- [ PocketFFT
+ set(AT_POCKETFFT_ENABLED 0)
+ if(NOT AT_MKL_ENABLED)
+-  set(POCKETFFT_INCLUDE_DIR "${Torch_SOURCE_DIR}/third_party/pocketfft/")
++  set(POCKETFFT_INCLUDE_DIR "#POCKETFFT_INCLUDE_DIR")
+   if(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}")
+     message(FATAL_ERROR "pocketfft directory not found, expected ${POCKETFFT_INCLUDE_DIR}")
+   elif(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}/pocketfft_hdronly.h")
+@@ -501,19 +501,6 @@ if(USE_QNNPACK)
+     set(QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+     set(QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+     set(QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-    add_subdirectory(
+-      "${QNNPACK_SOURCE_DIR}"
+-      "${CONFU_DEPENDENCIES_BINARY_DIR}/QNNPACK")
+-
+-    # TODO: See https://github.com/pytorch/pytorch/issues/56285
+-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+-      target_compile_options(qnnpack PRIVATE -Wno-deprecated-declarations)
+-    endif()
+-
+-    # We build static versions of QNNPACK and pthreadpool but link
+-    # them into a shared library for Caffe2, so they need PIC.
+-    set_property(TARGET qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+     if(QNNPACK_CUSTOM_THREADPOOL)
+       target_compile_definitions(
+@@ -562,13 +549,6 @@ if(USE_PYTORCH_QNNPACK)
+       set(PYTORCH_QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-      add_subdirectory(
+-        "${PYTORCH_QNNPACK_SOURCE_DIR}"
+-        "${CONFU_DEPENDENCIES_BINARY_DIR}/pytorch_qnnpack")
+-      # We build static versions of QNNPACK and pthreadpool but link
+-      # them into a shared library for Caffe2, so they need PIC.
+-      set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-      set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+       if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
+         target_compile_definitions(
+@@ -750,11 +730,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+   # this shouldn't be necessary anymore.
+   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
+-  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
+-
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
+ 
+   # We will not need to test benchmark lib itself.
+   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
+@@ -829,16 +804,6 @@ if(USE_FBGEMM)
+     else()
+       set(FBGEMM_LIBRARY_TYPE "static" CACHE STRING "")
+     endif()
+-    add_subdirectory("${FBGEMM_SOURCE_DIR}")
+-    set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
+-      # See https://github.com/pytorch/pytorch/issues/74352
+-      target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
+-      target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
+-    endif()
+   endif()
+ 
+   if(USE_FBGEMM)
+@@ -1001,7 +966,7 @@ if(NOT TARGET fp16 AND NOT USE_SYSTEM_FP16)
+     "${FP16_SOURCE_DIR}"
+     "${CONFU_DEPENDENCIES_BINARY_DIR}/FP16")
+ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
+-  add_library(fp16 STATIC "/usr/include/fp16.h")
++  add_library(fp16 STATIC "#FP16_INCLUDE_DIR")
+   set_target_properties(fp16 PROPERTIES LINKER_LANGUAGE C)
+ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
+@@ -1395,7 +1360,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ 
+     # Tensorpipe uses cuda_add_library
+     torch_update_find_cuda_flags()
+-    add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
+ 
+     list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
+     if(USE_CUDA)
+@@ -1551,7 +1515,6 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+       set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
+     endif()
+   endif()
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+ 
+   add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+   if(NOT USE_SYSTEM_ONNX)
+@@ -1582,7 +1545,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+     endif()
+     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
+     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
+-    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
++    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
+   endif()
+   include_directories(${FOXI_INCLUDE_DIRS})
+   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
+@@ -1752,9 +1715,8 @@ if(NOT INTERN_BUILD_MOBILE)
+   endif()
+   if(USE_MKLDNN)
+     include(${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake)
+-    if(MKLDNN_FOUND)
++    if(DNNL_FOUND)
+       set(AT_MKLDNN_ENABLED 1)
+-      include_directories(AFTER SYSTEM ${MKLDNN_INCLUDE_DIR})
+       if(BUILD_CAFFE2_OPS)
+         list(APPEND Caffe2_DEPENDENCY_LIBS caffe2::mkldnn)
+       endif(BUILD_CAFFE2_OPS)
+@@ -1819,7 +1781,7 @@ endif()
+ #
+ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
+-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
++find_package(fmt)
+ 
+ # Disable compiler feature checks for `fmt`.
+ #
+@@ -1828,7 +1790,6 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
+ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
+ # `fmt` is compatible with a superset of the compilers that PyTorch is, it
+ # shouldn't be too bad to just disable the checks.
+-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "")
+ 
+ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
+ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
+diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
+index a41343c..6075bdd 100644
+--- a/cmake/External/nnpack.cmake
++++ b/cmake/External/nnpack.cmake
+@@ -40,7 +40,7 @@ endif()
+ # (3) Android, iOS, Linux, macOS - supported
+ ##############################################################################
+ 
+-if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
++if(FALSE)
+   message(STATUS "Brace yourself, we are building NNPACK")
+   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
+ 
+@@ -114,6 +114,5 @@ endif()
+ # (4) Catch-all: not supported.
+ ##############################################################################
+ 
+-message(WARNING "Unknown platform - I don't know how to build NNPACK. "
+-                "See cmake/External/nnpack.cmake for details.")
+-set(USE_NNPACK OFF)
++set(NNPACK_FOUND TRUE)
++set(USE_NNPACK ON)
+diff --git a/cmake/public/mkldnn.cmake b/cmake/public/mkldnn.cmake
+index 50404d3..ca067f0 100644
+--- a/cmake/public/mkldnn.cmake
++++ b/cmake/public/mkldnn.cmake
+@@ -4,7 +4,7 @@ if(CPU_AARCH64)
+   include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake)
+ endif()
+ 
+-find_package(MKLDNN QUIET)
++find_package(DNNL REQUIRED)
+ 
+ if(NOT TARGET caffe2::mkldnn)
+   add_library(caffe2::mkldnn INTERFACE IMPORTED)
+@@ -15,7 +15,7 @@ set_property(
+   ${MKLDNN_INCLUDE_DIR})
+ set_property(
+   TARGET caffe2::mkldnn PROPERTY INTERFACE_LINK_LIBRARIES
+-  ${MKLDNN_LIBRARIES})
++  DNNL::dnnl)
+ if(BUILD_ONEDNN_GRAPH)
+   if(NOT TARGET caffe2::dnnl_graph)
+     add_library(caffe2::dnnl_graph INTERFACE IMPORTED)
+diff --git a/setup.py b/setup.py
+index 34b2854..5db117f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -418,13 +418,9 @@ def build_deps():
+     # Windows has very poor support for them.
+     sym_files = [
+         'tools/shared/_utils_internal.py',
+-        'torch/utils/benchmark/utils/valgrind_wrapper/callgrind.h',
+-        'torch/utils/benchmark/utils/valgrind_wrapper/valgrind.h',
+     ]
+     orig_files = [
+         'torch/_utils_internal.py',
+-        'third_party/valgrind-headers/callgrind.h',
+-        'third_party/valgrind-headers/valgrind.h',
+     ]
+     for sym_file, orig_file in zip(sym_files, orig_files):
+         same = False
+diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
+index 89c6b91..0c60d08 100644
+--- a/test/cpp/c10d/CMakeLists.txt
++++ b/test/cpp/c10d/CMakeLists.txt
+@@ -16,14 +16,14 @@ function(c10d_add_test test_src)
+   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
+ endfunction()
+ 
+-c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
+-c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
++c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
++c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
+ if(INSTALL_TEST)
+   install(TARGETS FileStoreTest DESTINATION bin)
+   install(TARGETS TCPStoreTest DESTINATION bin)
+ endif()
+ if(NOT WIN32)
+-  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
++  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
+   if(INSTALL_TEST)
+     install(TARGETS HashStoreTest DESTINATION bin)
+   endif()
+@@ -31,11 +31,11 @@ endif()
+ 
+ if(USE_CUDA)
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
+     endif()
+-    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+   endif()
+   if(USE_NCCL AND USE_C10D_NCCL)
+     # NCCL is a private dependency of libtorch, but the tests include some
+@@ -44,10 +44,10 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupNCCLTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     c10d_add_test(
+       ProcessGroupNCCLErrorsTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+       install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+@@ -61,7 +61,7 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupUCCTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_ucc)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_ucc)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupUCCTest DESTINATION bin)
+       install(TARGETS c10d_cuda_test DESTINATION lib)
+@@ -69,7 +69,7 @@ if(USE_CUDA)
+   endif()
+ else()
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
+   endif()
+ endif()
+ 
+diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
+index 7dff706..90b1003 100644
+--- a/test/cpp/tensorexpr/CMakeLists.txt
++++ b/test/cpp/tensorexpr/CMakeLists.txt
+@@ -54,7 +54,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+ # pthreadpool header. For some build environment we need add the dependency
+ # explicitly.
+ if(USE_PTHREADPOOL)
+-  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
++  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
+ endif()
+ if(USE_CUDA)
+   target_link_libraries(test_tensorexpr PRIVATE
diff --git a/gnu/packages/patches/python-pytorch2-system-libraries.patch b/gnu/packages/patches/python-pytorch2-system-libraries.patch
deleted file mode 100644
index c2c44badbb..0000000000
--- a/gnu/packages/patches/python-pytorch2-system-libraries.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
-
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
---- a/caffe2/CMakeLists.txt	2023-12-27 12:14:24.308751288 +0100
-+++ b/caffe2/CMakeLists.txt	2023-12-27 12:30:15.941562126 +0100
-@@ -1570,7 +1570,7 @@
-   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
-   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
-   target_link_libraries(static_runtime_bench torch_library benchmark)
--  target_link_libraries(static_runtime_test torch_library gtest_main)
-+  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
- endif()
- 
- if(BUILD_TENSOREXPR_BENCHMARK)
-@@ -1601,7 +1601,7 @@
-   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
-@@ -1628,7 +1628,7 @@
-           endif()
-         else()
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
--          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
-+          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
-         endif()
-         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
-         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-@@ -1645,7 +1645,7 @@
-   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1666,7 +1666,7 @@
-     foreach(test_src ${Caffe2_MPS_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 557ab649..ee9cf410 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -732,11 +732,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1543,7 +1538,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cb..6075bdd0 100644
---- a/cmake/External/nnpack.cmake
-+++ b/cmake/External/nnpack.cmake
-@@ -40,7 +40,7 @@ endif()
- # (3) Android, iOS, Linux, macOS - supported
- ##############################################################################
- 
--if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-+if(FALSE)
-   message(STATUS "Brace yourself, we are building NNPACK")
-   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
- 
-@@ -114,6 +114,5 @@ endif()
- # (4) Catch-all: not supported.
- ##############################################################################
- 
--message(WARNING "Unknown platform - I don't know how to build NNPACK. "
--                "See cmake/External/nnpack.cmake for details.")
--set(USE_NNPACK OFF)
-+set(NNPACK_FOUND TRUE)
-+set(USE_NNPACK ON)
-diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
-index bf91460c..ef56948f 100644
---- a/test/cpp/c10d/CMakeLists.txt
-+++ b/test/cpp/c10d/CMakeLists.txt
-@@ -16,14 +16,14 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
--c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
-+c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
- if(INSTALL_TEST)
-   install(TARGETS FileStoreTest DESTINATION bin)
-   install(TARGETS TCPStoreTest DESTINATION bin)
- endif()
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
-+  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
-   if(INSTALL_TEST)
-     install(TARGETS HashStoreTest DESTINATION bin)
-   endif()
-@@ -31,11 +31,11 @@ endif()
- 
- if(USE_CUDA)
-   if(USE_GLOO AND USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
-     if(INSTALL_TEST)
-       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
-     endif()
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_NCCL AND USE_C10D_NCCL)
-     # NCCL is a private dependency of libtorch, but the tests include some
-@@ -56,7 +56,7 @@ if(USE_CUDA)
-   endif()
- else()
-   if(USE_GLOO AND USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
-   endif()
- endif()
- 
-diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
-index 8fc5a0a1..643202f6 100644
---- a/test/cpp/tensorexpr/CMakeLists.txt
-+++ b/test/cpp/tensorexpr/CMakeLists.txt
-@@ -53,7 +53,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
- # pthreadpool header. For some build environment we need add the dependency
- # explicitly.
- if(USE_PTHREADPOOL)
--  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
-+  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
- endif()
- if(USE_CUDA)
-   target_link_libraries(test_tensorexpr PRIVATE
-- 
2.41.0






^ permalink raw reply related	[relevance 43%]

* [bug#69591] [PATCH v4 07/32] gnu: Add python-pytest-rerunfailures-13.
                     ` (4 preceding siblings ...)
  2024-03-23 22:04 64% ` [bug#69591] [PATCH v4 06/32] gnu: Add python-expecttest David Elsing
@ 2024-03-23 22:04 65% ` David Elsing
  2024-03-23 22:05 46% ` [bug#69591] [PATCH v4 26/32] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
  2024-03-23 22:05 43% ` [bug#69591] [PATCH v4 32/32] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-23 22:04 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-rerunfailures-13): New variable.
---
 gnu/packages/python-check.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index dbca80652c..347e4a4701 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2464,6 +2464,17 @@ (define-public python-pytest-rerunfailures
 eliminate flaky failures.")
     (license license:mpl2.0)))
 
+(define-public python-pytest-rerunfailures-13
+  (package
+    (inherit python-pytest-rerunfailures)
+    (version "13.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-rerunfailures" version))
+       (sha256
+        (base32 "16cin0chv59w4rvnd6r0fisp0s8avmp07rwn9da6yixw43jdncp1"))))))
+
 (define-public python-xunitparser
   (package
     (name "python-xunitparser")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69947] [PATCH] gnu: python-box: Update to 7.1.1.
@ 2024-03-22 20:12 60% Felix Gruber
  0 siblings, 0 replies; 200+ results
From: Felix Gruber @ 2024-03-22 20:12 UTC (permalink / raw)
  To: 69947
  Cc: Felix Gruber, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-box): Update to 7.1.1.
[source]: Download from github since pypi tarball does not contain all
test files.
[build-system]: Use pyproject-build-system.
[propagated-inputs]: Remove python-toml; add python-tomli and python-tomli-w.
[native-inputs]: Add python-cython, python-pytest, and python-wheel.

Change-Id: Ia39063054821e75768b1d9a5c937eab432e7c59e
---
 gnu/packages/python-xyz.scm | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index eec7586d3f..aad89d251e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -108,7 +108,7 @@
 ;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
 ;;; Copyright © 2021, 2022, 2023 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 ;;; Copyright © 2021, 2022 Pradana Aumars <paumars@courrier.dev>
-;;; Copyright © 2021, 2022, 2023 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2021–2024 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2021 Sébastien Lerique <sl@eauchat.org>
 ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
 ;;; Copyright © 2021 ZmnSCPxj <ZmnSCPxj@protonmail.com>
@@ -33544,17 +33544,24 @@ (define-public python-glom
 (define-public python-box
   (package
     (name "python-box")
-    (version "5.3.0")
+    (version "7.1.1")
     (source
+     ;; The PyPI tarball does not contain all test files.
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "python-box" version))
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/cdgriffith/Box")
+         (commit version)))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "0jhrdif57khx2hsw1q6a9x42knwcvq8ijgqyq1jmll6y6ifyzm2f"))))
-    (build-system python-build-system)
+         "1v8s6wji17fh87nvamzysvxi8f51h6szh6h6dxvids56gg5zc553"))))
+    (build-system pyproject-build-system)
     (propagated-inputs
-     (list python-msgpack python-ruamel.yaml python-toml))
+     (list python-msgpack python-ruamel.yaml python-tomli python-tomli-w))
+    (native-inputs
+     (list python-cython python-pytest python-wheel))
     (home-page "https://github.com/cdgriffith/Box")
     (synopsis "Advanced Python dictionaries with dot notation access")
     (description

base-commit: d5f857a3cfd1d7523b4051b94bd67b5cf5636219
-- 
2.43.0





^ permalink raw reply related	[relevance 60%]

* [bug#69924] [PATCH 06/49] gnu: python-pytest-arraydiff: Update to 0.6.1.
                     ` (2 preceding siblings ...)
  2024-03-20 22:27 63% ` [bug#69924] [PATCH 05/49] gnu: python-pytest-doctestplus: Update to 1.2.0 Sharlatan Hellseher
@ 2024-03-20 22:27 65% ` Sharlatan Hellseher
  2024-03-20 22:27 64% ` [bug#69924] [PATCH 07/49] gnu: python-pytest-arraydiff: Enable tests Sharlatan Hellseher
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-check.scm (python-pytest-arraydiff): Update to 0.6.1.

Change-Id: I6dd911eb38597790f66756a77f6086112329a156
---
 gnu/packages/python-check.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 99f52b6846..fe96bd297c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -545,13 +545,13 @@ (define-public python-pytest-astropy
 (define-public python-pytest-arraydiff
   (package
     (name "python-pytest-arraydiff")
-    (version "0.5.0")
+    (version "0.6.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pytest-arraydiff" version))
        (sha256
-        (base32 "1livzfbi7ag17hskd5845dh1kdir24f7jrbw8y2s1pyhzyz4jhbi"))))
+        (base32 "1pk7v96rkypx4ld59f6p8fh5bq371ka8g7bh4h7n4df91x2v2dr9"))))
     (build-system python-build-system)
     (arguments
      ;; Tests require python-astropy, which itself requires this package.
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69924] [PATCH 11/49] gnu: python-zarr: Speed up tests.
                     ` (7 preceding siblings ...)
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 10/49] gnu: python-partd: Enable tests Sharlatan Hellseher
@ 2024-03-20 22:27 62% ` Sharlatan Hellseher
  2024-03-20 22:27 62% ` [bug#69924] [PATCH 12/49] gnu: python-distributed: " Sharlatan Hellseher
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-zarr): Use G-expressions.
[arguments] <#:test-flags>: Parallelize tests to speed them up.
<#:phases>: 'disable-service-tests remove trailing #t from
lambda. Use standard 'check phase.
[native-inputs]: Add python-fsspec, python-h5py,
python-pytest-doctestplus, python-pytest-timeout, and
python-pytest-xdist.

Change-Id: I3fc4e2a1649ad9f95ed9e3fe87e3f57ad4f58af8
---
 gnu/packages/python-xyz.scm | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 799174ab60..360b4db3f1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26979,23 +26979,29 @@ (define-public python-zarr
          "0qb2wj60i7v1c95k6m0pskx20ss6dxrj3ym0d7z4c98jfah3ljsn"))))
     (build-system pyproject-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'disable-service-tests
-           (lambda _
-             (setenv "ZARR_TEST_ABS" "0")
-             (setenv "ZARR_TEST_MONGO" "0")
-             (setenv "ZARR_TEST_REDIS" "0")
-             #t))
-         (replace 'check
-           (lambda _
-             (invoke "pytest" "-vv" "-k" "not lmdb")
-             #t)))))
+     (list
+      #:test-flags
+      #~(list "-n" "auto")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'disable-service-tests
+            (lambda _
+              (setenv "ZARR_TEST_ABS" "0")
+              (setenv "ZARR_TEST_MONGO" "0")
+              (setenv "ZARR_TEST_REDIS" "0"))))))
     (propagated-inputs
-     (list python-asciitree python-fasteners python-numcodecs
+     (list python-asciitree
+           python-fasteners
+           python-numcodecs
            python-numpy))
     (native-inputs
-     (list python-pytest python-setuptools-scm))
+     (list python-fsspec
+           python-pytest
+           python-h5py
+           python-pytest-doctestplus
+           python-pytest-timeout
+           python-pytest-xdist
+           python-setuptools-scm))
     (home-page "https://github.com/zarr-developers/zarr-python")
     (synopsis "Chunked, compressed, N-dimensional arrays for Python")
     (description
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#69924] [PATCH 05/49] gnu: python-pytest-doctestplus: Update to 1.2.0.
    2024-03-20 22:27 69% ` [bug#69924] [PATCH 03/49] gnu: python-blosc: Move to python-compression Sharlatan Hellseher
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 04/49] gnu: python-blosc: Simplify package Sharlatan Hellseher
@ 2024-03-20 22:27 63% ` Sharlatan Hellseher
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 06/49] gnu: python-pytest-arraydiff: Update to 0.6.1 Sharlatan Hellseher
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-check.scm (python-pytest-doctestplus): Update to 1.2.0.
[arguments] <#:test-flags>: Disable one more failing test.
[home-page]: Update accordingly with lint warning.

Change-Id: I353a671741cf887c348d627d9e071e3fedcc4edc
---
 gnu/packages/python-check.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 51a38bbcbe..99f52b6846 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -604,26 +604,29 @@ (define-public python-pytest-cookies
 (define-public python-pytest-doctestplus
   (package
     (name "python-pytest-doctestplus")
-    (version "1.0.0")
+    (version "1.2.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pytest-doctestplus" version))
        (sha256
-        (base32 "17ylfnrcvvp6sd13bfj40jl40paqmjsbywysszb3xqgdr86l8l7n"))))
+        (base32 "0cmrkgpib869kpy8h8hfkg20w16lakkmbkw8cxdywpmf5wx7dbf5"))))
     (build-system pyproject-build-system)
     (arguments
      (list #:test-flags
            #~(list "-k" (string-append
+                         ;; Tests requiring network access.
                          "not test_remote_data_url"
                          " and not test_remote_data_float_cmp"
                          " and not test_remote_data_ignore_whitespace"
                          " and not test_remote_data_ellipsis"
                          " and not test_remote_data_requires"
-                         " and not test_remote_data_ignore_warnings"))))
+                         " and not test_remote_data_ignore_warnings"
+                         ;; Requiring git available.
+                         " and not test_generate_diff_basic"))))
     (native-inputs
      (list python-numpy python-pytest python-setuptools-scm))
-    (home-page "https://github.com/astropy/pytest-doctestplus")
+    (home-page "https://github.com/scientific-python/pytest-doctestplus")
     (synopsis "Pytest plugin with advanced doctest features")
     (description
      "This package contains a plugin for the Pytest framework that provides
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#69924] [PATCH 12/49] gnu: python-distributed: Speed up tests.
                     ` (8 preceding siblings ...)
  2024-03-20 22:27 62% ` [bug#69924] [PATCH 11/49] gnu: python-zarr: Speed up tests Sharlatan Hellseher
@ 2024-03-20 22:27 62% ` Sharlatan Hellseher
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 13/49] gnu: python-dask: " Sharlatan Hellseher
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=a, Size: 2223 bytes --]

* gnu/packages/python-science.scm (python-distributed) [arguments]
<#:test-flags>: Add option to run tests in parallel. Disable 3 more
flaky tests.
[native-inputs]: Add python-pytest-xdist. Sort alphabetically.

Change-Id: I588c1a1dc82e3208cc1eeeefbdc58fb080775ac0
---
 gnu/packages/python-science.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index b6a116f16b..a01c68cbc3 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1688,7 +1689,8 @@ (define-public python-distributed
     (arguments
      (list
       #:test-flags
-      '(list "-x" "-m"
+      '(list "-n" "auto"
+             "-x" "-m"
              (string-append "not slow"
                             " and not flaky"
                             " and not gpu"
@@ -1814,7 +1816,10 @@ (define-public python-distributed
               ;; These tests are rather flaky
               " and not test_quiet_quit_when_cluster_leaves"
               " and not multiple_clients_restart"
-              " and not test_steal_twice"))
+              " and not test_steal_twice"
+              " and not test_task_groups_update_start_stop"
+              " and not test_web_preload"
+              " and not test_web_preload_worker"))
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'versioneer
@@ -1889,10 +1894,11 @@ (define-public python-distributed
            python-urllib3
            python-zict))
     (native-inputs
-     (list python-importlib-metadata
+     (list python-flaky
+           python-importlib-metadata
            python-pytest
            python-pytest-timeout
-           python-flaky
+           python-pytest-xdist
            python-versioneer))
     (home-page "https://distributed.dask.org")
     (synopsis "Distributed scheduler for Dask")
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#69924] [PATCH 45/49] gnu: Add python-ewah-bool-utils.
                     ` (12 preceding siblings ...)
  2024-03-20 22:28 65% ` [bug#69924] [PATCH 34/49] gnu: python-glymur: Update to 0.12.9 Sharlatan Hellseher
@ 2024-03-20 22:28 63% ` Sharlatan Hellseher
  2024-03-20 22:28 57% ` [bug#69924] [PATCH 48/49] gnu: Add python-pydantic-settings Sharlatan Hellseher
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:28 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-compression.scm (python-ewah-bool-utils): New variable.

Change-Id: Ib9730d599f66bc2b864bfd305135e367f89ba9dd
---
 gnu/packages/python-compression.scm | 35 +++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm
index d076a4e161..16e9fc7a4b 100644
--- a/gnu/packages/python-compression.scm
+++ b/gnu/packages/python-compression.scm
@@ -196,6 +196,41 @@ (define-public python-cramjam
 @end itemize")
     (license license:expat)))
 
+(define-public python-ewah-bool-utils
+  (package
+    (name "python-ewah-bool-utils")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ewah_bool_utils" version))
+       (sha256
+        (base32 "11z9vv9m19370j762z100dqhy2ndjzkxk3w9z02lzwadbyibal3h"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'build-extensions
+            (lambda _
+              (invoke "python" "setup.py" "build_ext" "--inplace"))))))
+    (native-inputs
+     (list python-cython python-pytest))
+    (propagated-inputs
+     (list python-numpy))
+    (home-page "https://github.com/yt-project/ewah_bool_utils")
+    (synopsis "EWAH Bool Array compression")
+    (description "This package provide a Python wrapper to @acronym{EWAH,
+ Enhanced Word-Aligned Hybrid} compression bitarray method.")
+    (license (list
+              ;; LICENSE: for Python code.
+              license:bsd-3
+              ;; XXX: Check if it's possible to have it as a dedicated package
+              ;; and link here..
+              ;; ewah_bool_utils/cpp/LICENSE: for C++ bundle, sourced from
+              ;; <https://github.com/lemire/EWAHBoolArray>.
+              license:asl2.0))))
+
 (define-public python-pybcj
   (package
     (name "python-pybcj")
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#69591] [PATCH v3 32/32] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch.
                     ` (6 preceding siblings ...)
  2024-03-20 22:38 47% ` [bug#69591] [PATCH v3 26/32] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
@ 2024-03-20 22:38 43% ` David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-20 22:38 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/machine-learning.scm (%python-pytorch-for-r-torch-src): Add
patches.
(python-pytorch-for-r-torch)[version]: Use
%python-pytorch-for-r-torch-version.
[source]: Use %python-pytorch-for-r-torch-src.
[native-inputs]: Use 'modify-inputs'.
[inputs]: Don't replace xnnpack. Replace qnnpack-pytorch with
qnnpack-pytorch-for-r-torch and oneapi-dnnl with oneapi-dnnl-for-r-torch.
[propagated-inputs]: Don't replace onnx and onnx-optimizer.
* gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen: New file.
* gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch: New file.
* gnu/packages/patches/python-pytorch2-system-libraries.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                  |   1 -
 gnu/packages/machine-learning.scm             |  61 +--
 ...thon-pytorch-for-r-torch-fix-codegen.patch | 167 ++++++++
 ...pytorch-for-r-torch-system-libraries.patch | 399 ++++++++++++++++++
 .../python-pytorch2-system-libraries.patch    | 156 -------
 5 files changed, 586 insertions(+), 198 deletions(-)
 create mode 100644 gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
 create mode 100644 gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
 delete mode 100644 gnu/packages/patches/python-pytorch2-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c7dfe1b873..a9fae2052d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1813,7 +1813,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyreadstat-link-libiconv.patch	\
   %D%/packages/patches/python-pyls-black-41.patch		\
   %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch	\
-  %D%/packages/patches/python-pytorch2-system-libraries.patch	\
   %D%/packages/patches/python-sip-include-dirs.patch	\
   %D%/packages/patches/python-sgmllib3k-assertions.patch	\
   %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch	\
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index caca1dcf89..081e2cff08 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4754,7 +4754,15 @@ (define %python-pytorch-for-r-torch-src
                               %python-pytorch-for-r-torch-version))
     (sha256
      (base32
-      "0iirrn687i7sfv0p0i7dn89x3rf13a7l8y1y5h190h51yjxpxqxa"))))
+      "0iirrn687i7sfv0p0i7dn89x3rf13a7l8y1y5h190h51yjxpxqxa"))
+    (patches (search-patches
+              "python-pytorch-for-r-torch-system-libraries.patch"
+              "python-pytorch-runpath.patch"
+              "python-pytorch-without-kineto.patch"
+              ;; Some autogeneration scripts depend on the
+              ;; compile PyTorch library. Therefore, we create
+              ;; dummy versions which are regenerated later.
+              "python-pytorch-for-r-torch-fix-codegen.patch"))))
 
 (define-public qnnpack-pytorch-for-r-torch
   (package
@@ -4770,56 +4778,27 @@ (define-public qnnpack-pytorch-for-r-torch
        (snippet
         (origin-snippet (package-source qnnpack-pytorch)))))))
 
+;; Keep in sync with r-torch
 (define-public python-pytorch-for-r-torch
   (package
     (inherit python-pytorch)
     (name "python-pytorch")
-    (version "2.0.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "14m7v54zyd2qg2xk9mqdpbf4ps7091mdzinzh4vq9p5k4bpznj65"))
-              (patches (search-patches "python-pytorch2-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-enum" "python-peachpy"
-                              "python-six" "tbb" "XNNPACK" "zstd"))
-                  (substitute* "caffe2/CMakeLists.txt"
-                    (("target_link_libraries\\(\\$\\{test_name\\}_\\$\\{CPU_CAPABILITY\\} c10 sleef gtest_main\\)")
-                     "target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest gtest_main)"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
+    (version %python-pytorch-for-r-torch-version)
+    (source %python-pytorch-for-r-torch-src)
+    (native-inputs
+     (modify-inputs (package-native-inputs python-pytorch)
+       (replace "ideep-pytorch" ideep-pytorch-for-r-torch)))
+    (inputs
+     (modify-inputs (package-inputs python-pytorch)
+       (replace "qnnpack-pytorch" qnnpack-pytorch-for-r-torch)
+       (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch)))
     (propagated-inputs
      (modify-inputs (package-propagated-inputs python-pytorch)
        (append python-filelock
                python-jinja2
                python-networkx
                python-opt-einsum
-               python-sympy)
-       (replace "onnx" onnx-for-torch2)
-       (replace "onnx-optimizer" onnx-optimizer-for-torch2)))))
+               python-sympy)))))
 
 (define-public python-pytorch-geometric
   (package
diff --git a/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
new file mode 100644
index 0000000000..8515e5ab13
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
@@ -0,0 +1,167 @@
+This patch fixes some scripts for generating source files.  For
+gen_jit_decompositions.py, gen_mobile_upgraders.py and
+gen_jit_shape_functions.py, which depend on the compiled PyTorch library, the
+option to generate "dummy" source files is added for the initial build, which
+is later corrected.  codegen_external.py is patched to avoid duplicate
+functions and add the static keyword as in the existing generated file.
+
+diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
+index cc0263dbbf..ac34e84b82 100644
+--- a/tools/gen_flatbuffers.sh
++++ b/tools/gen_flatbuffers.sh
+@@ -1,13 +1,13 @@
+ #!/bin/bash
+ ROOT=$(pwd)
+-FF_LOCATION="$ROOT/third_party/flatbuffers"
+-cd "$FF_LOCATION" || exit
+-mkdir build
+-cd build || exit
+-cmake ..
+-cmake --build . --target flatc
+-mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
+-./flatc --cpp --gen-mutable --scoped-enums \
++#FF_LOCATION="$ROOT/third_party/flatbuffers"
++#cd "$FF_LOCATION" || exit
++#mkdir build
++#cd build || exit
++#cmake ..
++#cmake --build . --target flatc
++#mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
++flatc --cpp --gen-mutable --scoped-enums \
+      -o "$ROOT/torch/csrc/jit/serialization" \
+      -c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
+ echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
+diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
+index 120520b139..0c8587f02d 100644
+--- a/torch/csrc/jit/tensorexpr/codegen_external.py
++++ b/torch/csrc/jit/tensorexpr/codegen_external.py
+@@ -16,9 +16,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+     native_functions = parse_native_yaml(native_functions_path, tags_path)
+     func_decls = []
+     func_registrations = []
+-    for func in native_functions:
++    done_names = set()
++    for func in native_functions[0]:
+         schema = func.func
+         name = schema.name.name.base
++        if name in done_names:
++            continue
++        else:
++            done_names.add(name)
+         args = schema.arguments
+         # Only supports extern calls for functions with out variants
+         if not schema.is_out_fn():
+@@ -48,7 +53,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+ 
+         # print(tensor_decls, name, arg_names)
+         func_decl = f"""\
+-void nnc_aten_{name}(
++static void nnc_aten_{name}(
+     int64_t bufs_num,
+     void** buf_data,
+     int64_t* buf_ranks,
+diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
+index 7cfbb803f9..2e69bb1868 100644
+--- a/torchgen/decompositions/gen_jit_decompositions.py
++++ b/torchgen/decompositions/gen_jit_decompositions.py
+@@ -1,8 +1,12 @@
+ #!/usr/bin/env python3
+ import os
+ from pathlib import Path
++import sys
+ 
+-from torch.jit._decompositions import decomposition_table
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    from torch.jit._decompositions import decomposition_table
++else:
++    decomposition_table = {}
+ 
+ # from torchgen.code_template import CodeTemplate
+ 
+@@ -85,7 +89,7 @@ def write_decomposition_util_file(path: str) -> None:
+ 
+ 
+ def main() -> None:
+-    pytorch_dir = Path(__file__).resolve().parents[3]
++    pytorch_dir = Path(__file__).resolve().parents[2]
+     upgrader_path = pytorch_dir / "torch" / "csrc" / "jit" / "runtime"
+     write_decomposition_util_file(str(upgrader_path))
+ 
+diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
+index e5287cffc5..57f3c38096 100644
+--- a/torchgen/operator_versions/gen_mobile_upgraders.py
++++ b/torchgen/operator_versions/gen_mobile_upgraders.py
+@@ -2,10 +2,12 @@
+ import os
+ from enum import Enum
+ from pathlib import Path
++import sys
+ from typing import Any, Dict, List
+ 
+-import torch
+-from torch.jit.generate_bytecode import generate_upgraders_bytecode
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    import torch
++    from torch.jit.generate_bytecode import generate_upgraders_bytecode
+ 
+ from torchgen.code_template import CodeTemplate
+ from torchgen.operator_versions.gen_mobile_upgraders_constant import (
+@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+ def construct_version_maps(
+     upgrader_bytecode_function_to_index_map: Dict[str, Any]
+ ) -> str:
+-    version_map = torch._C._get_operator_version_map()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        version_map = torch._C._get_operator_version_map()
++    else:
++        version_map = {}
+     sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0])  # type: ignore[no-any-return]
+     sorted_version_map = {name: lst for name, lst in sorted_version_map_}
+ 
+@@ -379,7 +384,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ 
+ def main() -> None:
+ 
+-    upgrader_list = generate_upgraders_bytecode()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        upgrader_list = generate_upgraders_bytecode()
++    else:
++        upgrader_list = []
+     sorted_upgrader_list = sort_upgrader(upgrader_list)
+     for up in sorted_upgrader_list:
+         print("after sort upgrader : ", next(iter(up)))
+diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
+index c6336a6951..34e394d818 100644
+--- a/torchgen/shape_functions/gen_jit_shape_functions.py
++++ b/torchgen/shape_functions/gen_jit_shape_functions.py
+@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
+ if not file_path.exists():
+     raise Exception(err_msg)
+ 
+-spec = importlib.util.spec_from_file_location(module_name, file_path)
+-assert spec is not None
+-module = importlib.util.module_from_spec(spec)
+-sys.modules[module_name] = module
+-assert spec.loader is not None
+-assert module is not None
+-spec.loader.exec_module(module)
+-
+-bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
+-shape_compute_graph_mapping = module.shape_compute_graph_mapping
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    spec = importlib.util.spec_from_file_location(module_name, file_path)
++    assert spec is not None
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[module_name] = module
++    assert spec.loader is not None
++    assert module is not None
++    spec.loader.exec_module(module)
++
++    bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
++    shape_compute_graph_mapping = module.shape_compute_graph_mapping
++else:
++    bounded_compute_graph_mapping = {}
++    shape_compute_graph_mapping = {}
+ 
+ 
+ SHAPE_HEADER = r"""
diff --git a/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch b/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
new file mode 100644
index 0000000000..e5d647f70d
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
@@ -0,0 +1,399 @@
+Patch build files to also system libraries instead of bundled ones for the
+libraries not supported or working only by specifying USE_SYSTEM_LIBS.  This
+includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
+ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
+For QNNPACK, two versions were bundled and are required: The upstream one and
+an internal fork (now in the package qnnpack-pytorch).
+
+diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
+index 96fc297..7f27b66 100644
+--- a/aten/src/ATen/CMakeLists.txt
++++ b/aten/src/ATen/CMakeLists.txt
+@@ -362,9 +362,9 @@ if(AT_NNPACK_ENABLED)
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
+ endif()
+ 
+-if(MKLDNN_FOUND)
+-  list(APPEND ATen_CPU_DEPENDENCY_LIBS ${MKLDNN_LIBRARIES})
+-endif(MKLDNN_FOUND)
++if(USE_MKLDNN)
++  list(APPEND ATen_CPU_DEPENDENCY_LIBS DNNL::dnnl)
++endif(USE_MKLDNN)
+ 
+ list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
+ 
+diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
+index 221e3f3..417f601 100644
+--- a/caffe2/CMakeLists.txt
++++ b/caffe2/CMakeLists.txt
+@@ -110,9 +110,6 @@ if(NOT MSVC AND USE_XNNPACK)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+-    add_subdirectory(
+-      "${FXDIV_SOURCE_DIR}"
+-      "${CMAKE_BINARY_DIR}/FXdiv")
+   endif()
+ endif()
+ 
+@@ -975,7 +972,6 @@ elseif(USE_CUDA)
+ endif()
+ 
+ if(NOT MSVC AND USE_XNNPACK)
+-  TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 
+ # ==========================================================
+@@ -1314,6 +1310,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+ target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
++target_link_libraries(torch_cpu PRIVATE miniz clog)
+ target_include_directories(torch_cpu INTERFACE $<INSTALL_INTERFACE:include>)
+ target_include_directories(torch_cpu PRIVATE ${Caffe2_CPU_INCLUDE})
+ target_include_directories(torch_cpu SYSTEM PRIVATE "${Caffe2_DEPENDENCY_INCLUDE}")
+@@ -1570,7 +1567,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
+   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
+   target_link_libraries(static_runtime_bench torch_library benchmark)
+-  target_link_libraries(static_runtime_test torch_library gtest_main)
++  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
+ endif()
+ 
+ if(BUILD_TENSOREXPR_BENCHMARK)
+@@ -1601,7 +1598,7 @@ if(BUILD_MOBILE_TEST)
+   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
+@@ -1622,13 +1619,13 @@ if(BUILD_TEST)
+         if(NOT MSVC)
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
+           # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
+           if(USE_FBGEMM)
+             target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
+           endif()
+         else()
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
+         endif()
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+@@ -1645,7 +1642,7 @@ if(BUILD_TEST)
+   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+@@ -1703,7 +1700,7 @@ if(BUILD_TEST)
+     foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
+       get_filename_component(test_name ${test_src} NAME_WE)
+       add_executable(${test_name} "${test_src}")
+-      target_link_libraries(${test_name} torch_library gtest_main)
++      target_link_libraries(${test_name} torch_library gtest_main gtest)
+       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
+diff --git a/caffe2/serialize/CMakeLists.txt b/caffe2/serialize/CMakeLists.txt
+index 1552b59..67e1a9a 100644
+--- a/caffe2/serialize/CMakeLists.txt
++++ b/caffe2/serialize/CMakeLists.txt
+@@ -2,7 +2,6 @@ file(GLOB tmp *_test.cc)
+ 
+ set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
+ list(APPEND Caffe2_CPU_SRCS
+-  ${PROJECT_SOURCE_DIR}/third_party/miniz-2.1.0/miniz.c
+   ${CMAKE_CURRENT_SOURCE_DIR}/inline_container.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/istream_adapter.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/file_adapter.cc
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index 8c0e3c2..d65576a 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -298,7 +298,7 @@ endif()
+ # --- [ PocketFFT
+ set(AT_POCKETFFT_ENABLED 0)
+ if(NOT AT_MKL_ENABLED)
+-  set(POCKETFFT_INCLUDE_DIR "${Torch_SOURCE_DIR}/third_party/pocketfft/")
++  set(POCKETFFT_INCLUDE_DIR "#POCKETFFT_INCLUDE_DIR")
+   if(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}")
+     message(FATAL_ERROR "pocketfft directory not found, expected ${POCKETFFT_INCLUDE_DIR}")
+   elif(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}/pocketfft_hdronly.h")
+@@ -501,19 +501,6 @@ if(USE_QNNPACK)
+     set(QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+     set(QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+     set(QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-    add_subdirectory(
+-      "${QNNPACK_SOURCE_DIR}"
+-      "${CONFU_DEPENDENCIES_BINARY_DIR}/QNNPACK")
+-
+-    # TODO: See https://github.com/pytorch/pytorch/issues/56285
+-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+-      target_compile_options(qnnpack PRIVATE -Wno-deprecated-declarations)
+-    endif()
+-
+-    # We build static versions of QNNPACK and pthreadpool but link
+-    # them into a shared library for Caffe2, so they need PIC.
+-    set_property(TARGET qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+     if(QNNPACK_CUSTOM_THREADPOOL)
+       target_compile_definitions(
+@@ -562,13 +549,6 @@ if(USE_PYTORCH_QNNPACK)
+       set(PYTORCH_QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-      add_subdirectory(
+-        "${PYTORCH_QNNPACK_SOURCE_DIR}"
+-        "${CONFU_DEPENDENCIES_BINARY_DIR}/pytorch_qnnpack")
+-      # We build static versions of QNNPACK and pthreadpool but link
+-      # them into a shared library for Caffe2, so they need PIC.
+-      set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-      set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+       if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
+         target_compile_definitions(
+@@ -750,11 +730,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+   # this shouldn't be necessary anymore.
+   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
+-  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
+-
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
+ 
+   # We will not need to test benchmark lib itself.
+   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
+@@ -829,16 +804,6 @@ if(USE_FBGEMM)
+     else()
+       set(FBGEMM_LIBRARY_TYPE "static" CACHE STRING "")
+     endif()
+-    add_subdirectory("${FBGEMM_SOURCE_DIR}")
+-    set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
+-      # See https://github.com/pytorch/pytorch/issues/74352
+-      target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
+-      target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
+-    endif()
+   endif()
+ 
+   if(USE_FBGEMM)
+@@ -1001,7 +966,7 @@ if(NOT TARGET fp16 AND NOT USE_SYSTEM_FP16)
+     "${FP16_SOURCE_DIR}"
+     "${CONFU_DEPENDENCIES_BINARY_DIR}/FP16")
+ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
+-  add_library(fp16 STATIC "/usr/include/fp16.h")
++  add_library(fp16 STATIC "#FP16_INCLUDE_DIR")
+   set_target_properties(fp16 PROPERTIES LINKER_LANGUAGE C)
+ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
+@@ -1395,7 +1360,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ 
+     # Tensorpipe uses cuda_add_library
+     torch_update_find_cuda_flags()
+-    add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
+ 
+     list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
+     if(USE_CUDA)
+@@ -1551,7 +1515,6 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+       set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
+     endif()
+   endif()
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+ 
+   add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+   if(NOT USE_SYSTEM_ONNX)
+@@ -1582,7 +1545,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+     endif()
+     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
+     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
+-    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
++    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
+   endif()
+   include_directories(${FOXI_INCLUDE_DIRS})
+   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
+@@ -1752,9 +1715,8 @@ if(NOT INTERN_BUILD_MOBILE)
+   endif()
+   if(USE_MKLDNN)
+     include(${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake)
+-    if(MKLDNN_FOUND)
++    if(DNNL_FOUND)
+       set(AT_MKLDNN_ENABLED 1)
+-      include_directories(AFTER SYSTEM ${MKLDNN_INCLUDE_DIR})
+       if(BUILD_CAFFE2_OPS)
+         list(APPEND Caffe2_DEPENDENCY_LIBS caffe2::mkldnn)
+       endif(BUILD_CAFFE2_OPS)
+@@ -1819,7 +1781,7 @@ endif()
+ #
+ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
+-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
++find_package(fmt)
+ 
+ # Disable compiler feature checks for `fmt`.
+ #
+@@ -1828,7 +1790,6 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
+ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
+ # `fmt` is compatible with a superset of the compilers that PyTorch is, it
+ # shouldn't be too bad to just disable the checks.
+-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "")
+ 
+ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
+ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
+diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
+index a41343c..6075bdd 100644
+--- a/cmake/External/nnpack.cmake
++++ b/cmake/External/nnpack.cmake
+@@ -40,7 +40,7 @@ endif()
+ # (3) Android, iOS, Linux, macOS - supported
+ ##############################################################################
+ 
+-if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
++if(FALSE)
+   message(STATUS "Brace yourself, we are building NNPACK")
+   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
+ 
+@@ -114,6 +114,5 @@ endif()
+ # (4) Catch-all: not supported.
+ ##############################################################################
+ 
+-message(WARNING "Unknown platform - I don't know how to build NNPACK. "
+-                "See cmake/External/nnpack.cmake for details.")
+-set(USE_NNPACK OFF)
++set(NNPACK_FOUND TRUE)
++set(USE_NNPACK ON)
+diff --git a/cmake/public/mkldnn.cmake b/cmake/public/mkldnn.cmake
+index 50404d3..ca067f0 100644
+--- a/cmake/public/mkldnn.cmake
++++ b/cmake/public/mkldnn.cmake
+@@ -4,7 +4,7 @@ if(CPU_AARCH64)
+   include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake)
+ endif()
+ 
+-find_package(MKLDNN QUIET)
++find_package(DNNL REQUIRED)
+ 
+ if(NOT TARGET caffe2::mkldnn)
+   add_library(caffe2::mkldnn INTERFACE IMPORTED)
+@@ -15,7 +15,7 @@ set_property(
+   ${MKLDNN_INCLUDE_DIR})
+ set_property(
+   TARGET caffe2::mkldnn PROPERTY INTERFACE_LINK_LIBRARIES
+-  ${MKLDNN_LIBRARIES})
++  DNNL::dnnl)
+ if(BUILD_ONEDNN_GRAPH)
+   if(NOT TARGET caffe2::dnnl_graph)
+     add_library(caffe2::dnnl_graph INTERFACE IMPORTED)
+diff --git a/setup.py b/setup.py
+index 34b2854..5db117f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -418,13 +418,9 @@ def build_deps():
+     # Windows has very poor support for them.
+     sym_files = [
+         'tools/shared/_utils_internal.py',
+-        'torch/utils/benchmark/utils/valgrind_wrapper/callgrind.h',
+-        'torch/utils/benchmark/utils/valgrind_wrapper/valgrind.h',
+     ]
+     orig_files = [
+         'torch/_utils_internal.py',
+-        'third_party/valgrind-headers/callgrind.h',
+-        'third_party/valgrind-headers/valgrind.h',
+     ]
+     for sym_file, orig_file in zip(sym_files, orig_files):
+         same = False
+diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
+index 89c6b91..0c60d08 100644
+--- a/test/cpp/c10d/CMakeLists.txt
++++ b/test/cpp/c10d/CMakeLists.txt
+@@ -16,14 +16,14 @@ function(c10d_add_test test_src)
+   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
+ endfunction()
+ 
+-c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
+-c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
++c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
++c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
+ if(INSTALL_TEST)
+   install(TARGETS FileStoreTest DESTINATION bin)
+   install(TARGETS TCPStoreTest DESTINATION bin)
+ endif()
+ if(NOT WIN32)
+-  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
++  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
+   if(INSTALL_TEST)
+     install(TARGETS HashStoreTest DESTINATION bin)
+   endif()
+@@ -31,11 +31,11 @@ endif()
+ 
+ if(USE_CUDA)
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
+     endif()
+-    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+   endif()
+   if(USE_NCCL AND USE_C10D_NCCL)
+     # NCCL is a private dependency of libtorch, but the tests include some
+@@ -44,10 +44,10 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupNCCLTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     c10d_add_test(
+       ProcessGroupNCCLErrorsTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+       install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+@@ -61,7 +61,7 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupUCCTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_ucc)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_ucc)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupUCCTest DESTINATION bin)
+       install(TARGETS c10d_cuda_test DESTINATION lib)
+@@ -69,7 +69,7 @@ if(USE_CUDA)
+   endif()
+ else()
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
+   endif()
+ endif()
+ 
+diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
+index 7dff706..90b1003 100644
+--- a/test/cpp/tensorexpr/CMakeLists.txt
++++ b/test/cpp/tensorexpr/CMakeLists.txt
+@@ -54,7 +54,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+ # pthreadpool header. For some build environment we need add the dependency
+ # explicitly.
+ if(USE_PTHREADPOOL)
+-  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
++  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
+ endif()
+ if(USE_CUDA)
+   target_link_libraries(test_tensorexpr PRIVATE
diff --git a/gnu/packages/patches/python-pytorch2-system-libraries.patch b/gnu/packages/patches/python-pytorch2-system-libraries.patch
deleted file mode 100644
index c2c44badbb..0000000000
--- a/gnu/packages/patches/python-pytorch2-system-libraries.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
-
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
---- a/caffe2/CMakeLists.txt	2023-12-27 12:14:24.308751288 +0100
-+++ b/caffe2/CMakeLists.txt	2023-12-27 12:30:15.941562126 +0100
-@@ -1570,7 +1570,7 @@
-   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
-   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
-   target_link_libraries(static_runtime_bench torch_library benchmark)
--  target_link_libraries(static_runtime_test torch_library gtest_main)
-+  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
- endif()
- 
- if(BUILD_TENSOREXPR_BENCHMARK)
-@@ -1601,7 +1601,7 @@
-   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
-@@ -1628,7 +1628,7 @@
-           endif()
-         else()
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
--          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
-+          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
-         endif()
-         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
-         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-@@ -1645,7 +1645,7 @@
-   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1666,7 +1666,7 @@
-     foreach(test_src ${Caffe2_MPS_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 557ab649..ee9cf410 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -732,11 +732,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1543,7 +1538,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cb..6075bdd0 100644
---- a/cmake/External/nnpack.cmake
-+++ b/cmake/External/nnpack.cmake
-@@ -40,7 +40,7 @@ endif()
- # (3) Android, iOS, Linux, macOS - supported
- ##############################################################################
- 
--if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-+if(FALSE)
-   message(STATUS "Brace yourself, we are building NNPACK")
-   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
- 
-@@ -114,6 +114,5 @@ endif()
- # (4) Catch-all: not supported.
- ##############################################################################
- 
--message(WARNING "Unknown platform - I don't know how to build NNPACK. "
--                "See cmake/External/nnpack.cmake for details.")
--set(USE_NNPACK OFF)
-+set(NNPACK_FOUND TRUE)
-+set(USE_NNPACK ON)
-diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
-index bf91460c..ef56948f 100644
---- a/test/cpp/c10d/CMakeLists.txt
-+++ b/test/cpp/c10d/CMakeLists.txt
-@@ -16,14 +16,14 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
--c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
-+c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
- if(INSTALL_TEST)
-   install(TARGETS FileStoreTest DESTINATION bin)
-   install(TARGETS TCPStoreTest DESTINATION bin)
- endif()
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
-+  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
-   if(INSTALL_TEST)
-     install(TARGETS HashStoreTest DESTINATION bin)
-   endif()
-@@ -31,11 +31,11 @@ endif()
- 
- if(USE_CUDA)
-   if(USE_GLOO AND USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
-     if(INSTALL_TEST)
-       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
-     endif()
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_NCCL AND USE_C10D_NCCL)
-     # NCCL is a private dependency of libtorch, but the tests include some
-@@ -56,7 +56,7 @@ if(USE_CUDA)
-   endif()
- else()
-   if(USE_GLOO AND USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
-   endif()
- endif()
- 
-diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
-index 8fc5a0a1..643202f6 100644
---- a/test/cpp/tensorexpr/CMakeLists.txt
-+++ b/test/cpp/tensorexpr/CMakeLists.txt
-@@ -53,7 +53,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
- # pthreadpool header. For some build environment we need add the dependency
- # explicitly.
- if(USE_PTHREADPOOL)
--  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
-+  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
- endif()
- if(USE_CUDA)
-   target_link_libraries(test_tensorexpr PRIVATE
-- 
2.41.0






^ permalink raw reply related	[relevance 43%]

* [bug#69591] [PATCH v3 26/32] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies.
                     ` (5 preceding siblings ...)
  2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 07/32] gnu: Add python-pytest-rerunfailures-13 David Elsing
@ 2024-03-20 22:38 47% ` David Elsing
  2024-03-20 22:38 43% ` [bug#69591] [PATCH v3 32/32] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-20 22:38 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

Autogenerated files are also regenerated. The tests can be run, but are
disabled, as they require a long time.

* gnu/packages/machine-learning.scm (python-pytorch): Update to 2.2.1.
[version]: Use %python-pytorch-version.
[source]: Use %python-pytorch-src.
[arguments]: Remove 'make-things-writable phase.  Add 'cmake-patches,
'disable-avx-dependencies, 'set-max-jobs, 'codegen1, 'codegen2, 'build2,
'install2 phases. Adjust 'use-system-libraries and 'check phases.
[native-inputs]: Add doxygen, ideep-pytorch, pocketfft-cpp, python-expecttest,
python-pytest-flakefinder, python-pytest-rerunfailures-13,
python-pytest-shard, python-pytest-xdist, python-hypothesis,
python-types-dataclasses, python-typing-extensions-4.10 and valgrind.
[inputs]: Add asmjit, clog, flatbuffers-next, foxi, fxdiv, libuv,
miniz-for-pytorch, qnnpack, qnnpack-pytorch and oneapi-dnnl. Use nnpack,
oneapi-dnnl, qnnpack, qnnpack-pytorch and xnnpack only for supported systems.
[propagated-inputs]: Add python-filelock, python-fsspec, python-jinja2,
python-networkx, python-optree, python-packaging, python-psutil and
python-sympy. Remove python-cffi and python-six. Use cpuinfo only for
supported systems.
(%python-pytorch-src)[source]: Add patches.
* gnu/packages/patches/python-pytorch-runpath.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-system-libraries.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch: Remove file.
* gnu/packages/patches/python-pytorch-fix-codegen.patch: New file.
* gnu/packages/patches/python-pytorch-without-kineto: New file.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                  |   3 +-
 gnu/packages/machine-learning.scm             | 371 ++++++++++++------
 ...ython-pytorch-1.9.0-system-libraries.patch | 139 -------
 .../patches/python-pytorch-fix-codegen.patch  | 167 ++++++++
 .../patches/python-pytorch-runpath.patch      |  19 +-
 .../python-pytorch-system-libraries.patch     | 317 +++++++++++++--
 .../python-pytorch-without-kineto.patch       |  60 +++
 7 files changed, 771 insertions(+), 305 deletions(-)
 delete mode 100644 gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
 create mode 100644 gnu/packages/patches/python-pytorch-fix-codegen.patch
 create mode 100644 gnu/packages/patches/python-pytorch-without-kineto.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index adcb1be9b7..c7dfe1b873 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1930,9 +1930,10 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyan3-fix-absolute-path-bug.patch \
   %D%/packages/patches/python-pyan3-fix-positional-arguments.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch	\
+  %D%/packages/patches/python-pytorch-fix-codegen.patch		\
   %D%/packages/patches/python-pytorch-runpath.patch		\
   %D%/packages/patches/python-pytorch-system-libraries.patch	\
-  %D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
+  %D%/packages/patches/python-pytorch-without-kineto.patch	\
   %D%/packages/patches/python-robotframework-atest.patch	\
   %D%/packages/patches/python-robotframework-source-date-epoch.patch \
   %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index c4785ac2f1..a062a2398b 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -105,6 +105,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages parallel)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -123,6 +124,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages vulkan)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
@@ -4325,6 +4327,13 @@ (define %python-pytorch-src
     (sha256
      (base32
       "03mm0pwwb5lxdsmmiw3cch9fijgjw81kmmc4ln9rlyazkm7l1r48"))
+    (patches (search-patches "python-pytorch-system-libraries.patch"
+                             "python-pytorch-runpath.patch"
+                             "python-pytorch-without-kineto.patch"
+                             ;; Some autogeneration scripts depend on the
+                             ;; compile PyTorch library. Therefore, we create
+                             ;; dummy versions which are regenerated later.
+                             "python-pytorch-fix-codegen.patch"))
     (modules '((guix build utils)))
     (snippet
      '(begin
@@ -4444,135 +4453,249 @@ (define-public qnnpack-pytorch
 (define-public python-pytorch
   (package
     (name "python-pytorch")
-    (version "1.13.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "17yxjzwp4zp75fz7czgz9acijzw7dpyqcza50v8y1x7hfg2gw369"))
-              (patches (search-patches "python-pytorch-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-enum" "python-peachpy"
-                              "python-six" "tbb" "XNNPACK" "zstd"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
+    (version %python-pytorch-version)
+    (source %python-pytorch-src)
     (build-system python-build-system)
     (arguments
-     '(#:phases (modify-phases %standard-phases
-                  (add-before 'build 'use-system-libraries
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
-                      ;; want to use "system libraries" instead of the bundled
-                      ;; ones.
-                      (setenv "USE_SYSTEM_LIBS" "1")
-
-                      (substitute* "cmake/Dependencies.cmake"
-                        (("if\\(USE_SYSTEM_BIND11\\)")
-                         "if(TRUE)"))
-
-                      ;; XXX: Disable that for simplicity for now.
-                      (setenv "USE_FBGEMM" "0")))
-                  (add-before 'build 'make-things-writable
-                    (lambda _
-                      ;; The 'build_caffe2' function in
-                      ;; 'tools/build_pytorch_libs.py', called from the
-                      ;; top-level 'setup.py', needs write access to this
-                      ;; directory.
-                      (for-each make-file-writable
-                                (find-files "caffe2/proto" "."
-                                            #:directories? #t))))
-                  (replace 'check
-                    (lambda* (#:key inputs outputs tests? #:allow-other-keys)
-                      ;; Run the test suite following the instructions in
-                      ;; 'CONTRIBUTING.md'.  XXX: Unfortunately this doesn't
-                      ;; work, unless you set GUIX_PYTHONPATH presumably.
-                      (when tests?
-                        (add-installed-pythonpath inputs outputs)
-                        (invoke "python" "test/run_test.py"))))
-                  (add-after 'install 'remove-test-executables
-                    (lambda* (#:key inputs outputs #:allow-other-keys)
-                      ;; Remove test executables, but keep other executables
-                      ;; such as 'torch_shm_manager' and and .so files such as
-                      ;; 'libtorch_global_deps.so'.
-                      (let ((python-site (site-packages inputs outputs)))
-                        (for-each delete-file
-                                  (find-files python-site
-                                              "(^test_cpp_rpc|_test)$")))))
-                  (add-after 'install 'remove-caffe2-onnx-scripts
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let* ((out (assoc-ref outputs "out"))
-                             (bin (string-append out "/bin")))
-                        ;; Remove 'convert-caffe2-to-onnx' and
-                        ;; 'convert-onnx-to-caffe2': they seem to be
-                        ;; deprecated and they cause a failure of the
-                        ;; 'sanity-check' phase:
-                        ;;
-                        ;; ImportError: cannot import name 'metanet_pb2' from partially initialized module 'caffe2.proto' (most likely due to a circular import)
-                        (for-each delete-file
-                                  (find-files bin "^convert-.*caffe2"))
-
-                        (substitute* (find-files out "^entry_points\\.txt$")
-                          (("^convert-.*" all)
-                           (string-append "# " all "\n")))))))
-
-       ;; XXX: Tests attempt to download data such as
-       ;; <https://raw.githubusercontent.com/pytorch/test-infra/master/stats/slow-tests.json>.
-       ;; We're also missing some Python modules, such as expecttest.
-       #:tests? #f))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'cmake-patches
+            (lambda _
+              (substitute* "cmake/Dependencies.cmake"
+                (("#POCKETFFT_INCLUDE_DIR")
+                 (string-append
+                  #$(this-package-native-input "pocketfft-cpp") "/include"))
+                (("#FP16_INCLUDE_DIR")
+                 (string-append
+                  #$(this-package-input "fp16") "/include")))))
+          (add-before 'build 'use-system-libraries
+            (lambda _
+              (substitute* '("caffe2/serialize/crc.cc"
+                             "caffe2/serialize/inline_container.cc")
+                (("\"miniz\\.h\"") "<miniz/miniz.h>"))
+              (substitute* "aten/src/ATen/native/vulkan/api/Allocator.h"
+                (("<include/vk_mem_alloc.h>")
+                 "<vk_mem_alloc.h>"))
+              ;; For Vulkan
+              (substitute* "CMakeLists.txt"
+                (("append_cxx_flag.*-Werror=(return-type|range-loop-construct).*") ""))
+              (substitute*
+                  (cons*
+                   "torch/csrc/Module.cpp"
+                   (map
+                    (lambda (name)
+                      (string-append
+                       "torch/utils/benchmark/utils/valgrind_wrapper/"
+                       name))
+                    '("compat_bindings.cpp" "timer_callgrind_template.cpp")))
+                (("<callgrind.h>") "<valgrind/callgrind.h>"))
+              (setenv "USE_FFMPEG" "1")
+              (setenv "USE_VULKAN" "1")
+              (setenv "USE_OPENCV" "1")
+              ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
+              ;; want to use "system libraries" instead of the bundled
+              ;; ones.
+              (setenv "USE_SYSTEM_LIBS" "1")
+              ;; For oneDNN
+              (setenv "USE_MKLDNN" "1")
+              ;; Only works with CUPTI
+              (setenv "USE_KINETO" "0")
+              ;; Prevent CMake error by disabling explicitely
+              (setenv "USE_ITT" "0")
+              ;; Disable on unsupported systems
+              (if #$(not (member
+                          (or (%current-target-system)
+                              (%current-system))
+                          (package-transitive-supported-systems qnnpack)))
+                  (setenv "USE_QNNPACK" "0")
+                  (setenv "USE_PYTORCH_QNNPACK" "0"))))
+          ;; PyTorch is still built with AVX2 and AVX-512 support selected at
+          ;; runtime, but these dependencies require it (nnpack only for
+          ;; x86_64).
+          (add-before 'build 'disable-avx-dependencies
+            (lambda _
+              (setenv "USE_FBGEMM" "0")
+              (if #$(not
+                     (member (or (%current-target-system)
+                                 (%current-system))
+                             '("armhf-linux" "aarch64-linux")))
+                  (setenv "USE_NNPACK" "0"))))
+          (add-after 'use-system-libraries 'set-max-jobs
+            (lambda _
+              (setenv "MAX_JOBS" (number->string (parallel-job-count)))))
+          (add-after 'set-max-jobs 'codegen1
+            (lambda _
+              (with-directory-excursion "torch/csrc/jit/tensorexpr"
+                (setenv "PYTHONPATH" "../../../..")
+                (invoke "python3" "codegen_external.py")
+                (setenv "PYTHONPATH" #f))
+
+              (invoke "python3" "aten/src/ATen/nnapi/codegen.py")
+
+              (invoke "bash" "tools/gen_flatbuffers.sh")
+
+              ;; Generate dummy files as the generation depends on the compiled
+              ;; library. They are regenerated later.
+              (setenv "PYTHONPATH" ".")
+              (invoke "python3"
+                      "torchgen/operator_versions/gen_mobile_upgraders.py"
+                      "dummy")
+              (setenv "PYTHONPATH" #f)
+
+              (invoke "python3"
+                      "torchgen/shape_functions/gen_jit_shape_functions.py"
+                      "dummy")
+
+              (invoke "python3"
+                      "torchgen/decompositions/gen_jit_decompositions.py"
+                      "dummy")))
+          ;; Properly generate autogenerated files ...
+          (add-after 'install 'codegen2
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (add-installed-pythonpath inputs outputs)
+              (invoke "python3"
+                      "torchgen/operator_versions/gen_mobile_upgraders.py")
+              (invoke "python3"
+                      "torchgen/shape_functions/gen_jit_shape_functions.py")
+              (invoke "python3"
+                      "torchgen/decompositions/gen_jit_decompositions.py")))
+          ;; ... rebuild their dependencies ...
+          (add-after 'codegen2 'build2
+            (lambda _
+              (invoke "python3" "setup.py" "build")))
+          ;; ... and install again.
+          (add-after 'build2 'install2
+            (lambda _
+              (invoke "python3" "setup.py" "install" (string-append "--prefix=" #$output)
+                      "--no-compile" "--single-version-externally-managed" "--root=/")
+              (invoke "python" "-m" "compileall"
+                      "--invalidation-mode=unchecked-hash" #$output)))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              ;; Run the test suite following the instructions in
+              ;; 'CONTRIBUTING.md'. Unfortunately this doesn't work, unless
+              ;; you set PYTHONPATH or GUIX_PYTHONPATH, but this is done in
+              ;; the codegen2 phase already.
+              (when tests?
+                (invoke "python3" "test/run_test.py" "--core"))))
+          (add-after 'install2 'remove-test-executables
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              ;; Remove test executables, but keep other executables
+              ;; such as 'torch_shm_manager' and and .so files such as
+              ;; 'libtorch_global_deps.so'.
+              (let ((python-site (site-packages inputs outputs)))
+                (for-each delete-file
+                          (find-files python-site
+                                      "(^test_cpp_rpc|_test)$")))))
+          (add-after 'install2 'remove-caffe2-onnx-scripts
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (bin (string-append out "/bin")))
+                ;; Remove 'convert-caffe2-to-onnx' and
+                ;; 'convert-onnx-to-caffe2': they seem to be
+                ;; deprecated and they cause a failure of the
+                ;; 'sanity-check' phase:
+                ;;
+                ;; ImportError: cannot import name 'metanet_pb2' from
+                ;; partially initialized module 'caffe2.proto' (most likely
+                ;; due to a circular import)
+                (for-each delete-file
+                          (find-files bin "^convert-.*caffe2"))
+
+                (substitute* (find-files out "^entry_points\\.txt$")
+                  (("^convert-.*" all)
+                   (string-append "# " all "\n")))))))
+
+      ;; Even only the core tests take a very long time to run.
+      #:tests? #f))
     (native-inputs
-     (list cmake ninja))
+     (list cmake
+           doxygen
+           ideep-pytorch
+           ninja
+           pocketfft-cpp
+           python-expecttest
+           python-pytest-flakefinder
+           python-pytest-rerunfailures-13
+           python-pytest-shard
+           python-pytest-xdist
+           python-hypothesis
+           python-types-dataclasses
+           python-typing-extensions-4.10
+           shaderc
+           valgrind))
     (inputs
-     (list eigen
-           ;; ("fmt" ,fmt)
-           fp16
-           gemmlowp
-           googletest
-           googlebenchmark
-           gloo
-           nnpack
-           openblas
-           openmpi
-           pthreadpool
-           protobuf
-           pybind11
-           sleef
-           xnnpack
-           zstd))
+     (append
+      (list asmjit
+            clog
+            eigen
+            ffmpeg
+            flatbuffers-next
+            fmt
+            foxi
+            fp16
+            fxdiv
+            gemmlowp
+            gloo
+            googletest
+            googlebenchmark
+            libuv
+            miniz-for-pytorch
+            openblas
+            opencv
+            openmpi
+            pthreadpool
+            protobuf
+            pybind11
+            sleef
+            tensorpipe
+            vulkan-headers
+            vulkan-loader
+            vulkan-memory-allocator
+            zstd)
+      ;; TODO: fix build on 32 bit systems once Rust is available.
+      (filter
+       (lambda (pkg)
+         (member (or (%current-target-system)
+                     (%current-system))
+                 (package-transitive-supported-systems pkg)))
+       (list oneapi-dnnl
+             qnnpack
+             qnnpack-pytorch
+             xnnpack))
+      ;; nnpack requires AVX2 for x86_64-linux
+      (filter
+       (lambda (pkg)
+         (member (or (%current-target-system)
+                     (%current-system))
+                 '("armhf-linux" "aarch64-linux")))
+       (list nnpack))))
     (propagated-inputs
-     (list python-astunparse
-           python-click
-           python-numpy
-           python-pyyaml
-           python-cffi
-           python-typing-extensions
-           python-future
-           python-six
-           python-requests
-           onnx                             ;propagated for its Python modules
-           onnx-optimizer
-           cpuinfo))
+     (append
+      (list onnx ;propagated for its Python modules
+            onnx-optimizer
+            python-astunparse
+            python-click
+            python-filelock
+            python-fsspec
+            python-future
+            python-jinja2
+            python-networkx
+            python-numpy
+            python-optree
+            python-packaging
+            python-psutil
+            python-pyyaml
+            python-requests
+            python-sympy
+            python-typing-extensions)
+      (filter
+       (lambda (pkg)
+         (member (or (%current-target-system)
+                     (%current-system))
+                 (package-transitive-supported-systems pkg)))
+       (list cpuinfo))))
     (home-page "https://pytorch.org/")
     (synopsis "Python library for tensor computation and deep neural networks")
     (description
diff --git a/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch b/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
deleted file mode 100644
index 76c06520f0..0000000000
--- a/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
-
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 5d57b9ca78..620cca4e60 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -644,11 +644,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1485,7 +1480,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 50ebb224ce..5953d9ddf7 100644
---- a/caffe2/CMakeLists.txt
-+++ b/caffe2/CMakeLists.txt
-@@ -1632,7 +1632,7 @@ if(BUILD_TEST)
-         if(NOT MSVC)
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
-           # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
--          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
-+          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
-           if(USE_FBGEMM)
-             target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
-           endif()
-@@ -1655,7 +1655,7 @@ if(BUILD_TEST)
-   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1673,7 +1673,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_GPU_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       cuda_add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1691,7 +1691,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1709,7 +1709,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_HIP_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
-       target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
-
-diff --git a/torch/lib/c10d/test/CMakeLists.txt b/torch/lib/c10d/test/CMakeLists.txt
-index b74d4b65f7..fc7c207505 100644
---- a/torch/lib/c10d/test/CMakeLists.txt
-+++ b/torch/lib/c10d/test/CMakeLists.txt
-@@ -16,24 +16,24 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp c10d gtest_main)
--c10d_add_test(TCPStoreTest.cpp c10d gtest_main)
-+c10d_add_test(FileStoreTest.cpp c10d gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp c10d gtest_main gtest)
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp c10d gtest_main)
-+  c10d_add_test(HashStoreTest.cpp c10d gtest_main gtest)
- endif()
- 
- if(USE_CUDA)
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main)
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main gtest)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_C10D_NCCL)
--    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main gtest)
-     c10d_add_test(ProcessGroupNCCLErrorsTest.cpp c10d c10d_cuda_test
--        gtest_main)
-+        gtest_main gtest)
-   endif()
- else()
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main gtest)
-   endif()
- endif()
-
-diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cbb5..6075bdd0a4 100644
---- a/cmake/External/nnpack.cmake
-+++ b/cmake/External/nnpack.cmake
-@@ -40,7 +40,7 @@ endif()
- # (3) Android, iOS, Linux, macOS - supported
- ##############################################################################
- 
--if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-+if(FALSE)
-   message(STATUS "Brace yourself, we are building NNPACK")
-   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
- 
-@@ -114,6 +114,5 @@ endif()
- # (4) Catch-all: not supported.
- ##############################################################################
- 
--message(WARNING "Unknown platform - I don't know how to build NNPACK. "
--                "See cmake/External/nnpack.cmake for details.")
--set(USE_NNPACK OFF)
-+set(NNPACK_FOUND TRUE)
-+set(USE_NNPACK ON)
diff --git a/gnu/packages/patches/python-pytorch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-fix-codegen.patch
new file mode 100644
index 0000000000..cb246b25de
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-fix-codegen.patch
@@ -0,0 +1,167 @@
+This patch fixes some scripts for generating source files.  For
+gen_jit_decompositions.py, gen_mobile_upgraders.py and
+gen_jit_shape_functions.py, which depend on the compiled PyTorch library, the
+option to generate "dummy" source files is added for the initial build, which
+is later corrected.  codegen_external.py is patched to avoid duplicate
+functions and add the static keyword as in the existing generated file.
+
+diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
+index cc0263dbbf..ac34e84b82 100644
+--- a/tools/gen_flatbuffers.sh
++++ b/tools/gen_flatbuffers.sh
+@@ -1,13 +1,13 @@
+ #!/bin/bash
+ ROOT=$(pwd)
+-FF_LOCATION="$ROOT/third_party/flatbuffers"
+-cd "$FF_LOCATION" || exit
+-mkdir build
+-cd build || exit
+-cmake ..
+-cmake --build . --target flatc
+-mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
+-./flatc --cpp --gen-mutable --scoped-enums \
++#FF_LOCATION="$ROOT/third_party/flatbuffers"
++#cd "$FF_LOCATION" || exit
++#mkdir build
++#cd build || exit
++#cmake ..
++#cmake --build . --target flatc
++#mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
++flatc --cpp --gen-mutable --scoped-enums \
+      -o "$ROOT/torch/csrc/jit/serialization" \
+      -c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
+ echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
+diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
+index bc69b05162..0f8df81de3 100644
+--- a/torch/csrc/jit/tensorexpr/codegen_external.py
++++ b/torch/csrc/jit/tensorexpr/codegen_external.py
+@@ -20,9 +20,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+     native_functions = parse_native_yaml(native_functions_path, tags_path)
+     func_decls = []
+     func_registrations = []
+-    for func in native_functions:
++    done_names = set()
++    for func in native_functions[0]:
+         schema = func.func
+         name = schema.name.name.base
++        if name in done_names:
++            continue
++        else:
++            done_names.add(name)
+         args = schema.arguments
+         # Only supports extern calls for functions with out variants
+         if not schema.is_out_fn():
+@@ -62,7 +67,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+ 
+         # print(tensor_decls, name, arg_names)
+         func_decl = f"""\
+-void nnc_aten_{name}(
++static void nnc_aten_{name}(
+     int64_t bufs_num,
+     void** buf_data,
+     int64_t* buf_ranks,
+diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
+index 7cfbb803f9..2e69bb1868 100644
+--- a/torchgen/decompositions/gen_jit_decompositions.py
++++ b/torchgen/decompositions/gen_jit_decompositions.py
+@@ -1,8 +1,12 @@
+ #!/usr/bin/env python3
+ import os
+ from pathlib import Path
++import sys
+ 
+-from torch.jit._decompositions import decomposition_table
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    from torch.jit._decompositions import decomposition_table
++else:
++    decomposition_table = {}
+ 
+ # from torchgen.code_template import CodeTemplate
+ 
+@@ -85,7 +89,7 @@ def write_decomposition_util_file(path: str) -> None:
+ 
+ 
+ def main() -> None:
+-    pytorch_dir = Path(__file__).resolve().parents[3]
++    pytorch_dir = Path(__file__).resolve().parents[2]
+     upgrader_path = pytorch_dir / "torch" / "csrc" / "jit" / "runtime"
+     write_decomposition_util_file(str(upgrader_path))
+ 
+diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
+index dab1568580..55c58715fc 100644
+--- a/torchgen/operator_versions/gen_mobile_upgraders.py
++++ b/torchgen/operator_versions/gen_mobile_upgraders.py
+@@ -2,10 +2,12 @@
+ import os
+ from enum import Enum
+ from pathlib import Path
++import sys
+ from typing import Any, Dict, List
+ 
+-import torch
+-from torch.jit.generate_bytecode import generate_upgraders_bytecode
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    import torch
++    from torch.jit.generate_bytecode import generate_upgraders_bytecode
+ 
+ from torchgen.code_template import CodeTemplate
+ from torchgen.operator_versions.gen_mobile_upgraders_constant import (
+@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+ def construct_version_maps(
+     upgrader_bytecode_function_to_index_map: Dict[str, Any]
+ ) -> str:
+-    version_map = torch._C._get_operator_version_map()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        version_map = torch._C._get_operator_version_map()
++    else:
++        version_map = {}
+     sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0])  # type: ignore[no-any-return]
+     sorted_version_map = dict(sorted_version_map_)
+ 
+@@ -378,7 +383,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ 
+ 
+ def main() -> None:
+-    upgrader_list = generate_upgraders_bytecode()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        upgrader_list = generate_upgraders_bytecode()
++    else:
++        upgrader_list = []
+     sorted_upgrader_list = sort_upgrader(upgrader_list)
+     for up in sorted_upgrader_list:
+         print("after sort upgrader : ", next(iter(up)))
+diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
+index c6336a6951..34e394d818 100644
+--- a/torchgen/shape_functions/gen_jit_shape_functions.py
++++ b/torchgen/shape_functions/gen_jit_shape_functions.py
+@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
+ if not file_path.exists():
+     raise Exception(err_msg)
+ 
+-spec = importlib.util.spec_from_file_location(module_name, file_path)
+-assert spec is not None
+-module = importlib.util.module_from_spec(spec)
+-sys.modules[module_name] = module
+-assert spec.loader is not None
+-assert module is not None
+-spec.loader.exec_module(module)
+-
+-bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
+-shape_compute_graph_mapping = module.shape_compute_graph_mapping
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    spec = importlib.util.spec_from_file_location(module_name, file_path)
++    assert spec is not None
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[module_name] = module
++    assert spec.loader is not None
++    assert module is not None
++    spec.loader.exec_module(module)
++
++    bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
++    shape_compute_graph_mapping = module.shape_compute_graph_mapping
++else:
++    bounded_compute_graph_mapping = {}
++    shape_compute_graph_mapping = {}
+ 
+ 
+ SHAPE_HEADER = r"""
diff --git a/gnu/packages/patches/python-pytorch-runpath.patch b/gnu/packages/patches/python-pytorch-runpath.patch
index 7f95b88a2b..2c1724cdb0 100644
--- a/gnu/packages/patches/python-pytorch-runpath.patch
+++ b/gnu/packages/patches/python-pytorch-runpath.patch
@@ -3,10 +3,10 @@ get installed, quite surprisingly, to 'lib/python3.8/site-packages/{bin,lib}'.
 Make sure RUNPATH matches that.
 
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 5b5622f0..30d27e57 100644
+index 74836372..c8eb69d1 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1909,7 +1909,7 @@ if(BUILD_PYTHON)
+@@ -1910,7 +1910,7 @@ if(BUILD_PYTHON)
    if(${BUILDING_WITH_TORCH_LIBS})
      # site-packages/caffe2/python/caffe2_pybind11_state
      # site-packages/torch/lib
@@ -16,7 +16,7 @@ index 5b5622f0..30d27e57 100644
  
    # Must also include `CMAKE_SHARED_LINKER_FLAGS` in linker flags for
 diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index ee9cf410..f190e69b 100644
+index acc95842..8f8fb7d7 100644
 --- a/cmake/Dependencies.cmake
 +++ b/cmake/Dependencies.cmake
 @@ -4,7 +4,7 @@ if(APPLE)
@@ -28,3 +28,16 @@ index ee9cf410..f190e69b 100644
  endif(APPLE)
  # Use separate rpaths during build and install phases
  set(CMAKE_SKIP_BUILD_RPATH  FALSE)
+diff --git a/functorch/CMakeLists.txt b/functorch/CMakeLists.txt
+index f2f32745..db21b656 100644
+--- a/functorch/CMakeLists.txt
++++ b/functorch/CMakeLists.txt
+@@ -21,7 +21,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE pybind::pybind11)
+ 
+ set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
+       ${CMAKE_BINARY_DIR}/functorch)
+-set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${_rpath_portable_origin}/../torch/lib")
++set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/../torch/lib")
+ 
+ # Copy-pasted prefix/suffix logic for Python extensions from
+ # https://github.com/pytorch/pytorch/blob/33bb8ae350611760139457b85842b1d7edf9aa11/caffe2/CMakeLists.txt#L1975
diff --git a/gnu/packages/patches/python-pytorch-system-libraries.patch b/gnu/packages/patches/python-pytorch-system-libraries.patch
index fd849fd9e2..99f999f32f 100644
--- a/gnu/packages/patches/python-pytorch-system-libraries.patch
+++ b/gnu/packages/patches/python-pytorch-system-libraries.patch
@@ -1,38 +1,104 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
+Patch build files to also system libraries instead of bundled ones for the
+libraries not supported or working only by specifying USE_SYSTEM_LIBS.  This
+includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
+ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
+For QNNPACK, two versions were bundled and are required: The upstream one and
+an internal fork (now in the package qnnpack-pytorch).
 
+diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
+index 2c2b967..5ac5fa6 100644
+--- a/aten/src/ATen/CMakeLists.txt
++++ b/aten/src/ATen/CMakeLists.txt
+@@ -371,9 +371,9 @@ if(AT_NNPACK_ENABLED)
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
+ endif()
+ 
+-if(MKLDNN_FOUND)
+-  list(APPEND ATen_CPU_DEPENDENCY_LIBS ${MKLDNN_LIBRARIES})
+-endif(MKLDNN_FOUND)
++if(USE_MKLDNN)
++  list(APPEND ATen_CPU_DEPENDENCY_LIBS DNNL::dnnl)
++endif(USE_MKLDNN)
+ 
+ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x|ppc64le)$")
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index d57d7ebb..5b5622f0 100644
+index 7483637..093de40 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1736,7 +1736,7 @@ if(BUILD_TEST)
+@@ -111,9 +111,6 @@ if(NOT MSVC AND USE_XNNPACK)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+-    add_subdirectory(
+-      "${FXDIV_SOURCE_DIR}"
+-      "${CMAKE_BINARY_DIR}/FXdiv")
+   endif()
+ endif()
+ 
+@@ -1055,7 +1052,6 @@ elseif(USE_CUDA)
+ endif()
+ 
+ if(NOT MSVC AND USE_XNNPACK)
+-  TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 
+ # ==========================================================
+@@ -1396,6 +1392,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+ target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
++target_link_libraries(torch_cpu PRIVATE miniz clog)
+ if(USE_MPI)
+   target_link_libraries(torch_cpu PRIVATE MPI::MPI_CXX)
+ endif()
+@@ -1653,7 +1650,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
+   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
+   target_link_libraries(static_runtime_bench torch_library benchmark)
+-  target_link_libraries(static_runtime_test torch_library gtest_main)
++  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
+ endif()
+ 
+ if(BUILD_TENSOREXPR_BENCHMARK)
+@@ -1680,7 +1677,7 @@ if(BUILD_MOBILE_TEST)
+   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
+@@ -1701,7 +1698,7 @@ if(BUILD_TEST)
          if(NOT MSVC)
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
            # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
 -          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
 +          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
            if(USE_FBGEMM)
              target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
            endif()
-@@ -1759,7 +1759,7 @@ if(BUILD_TEST)
+@@ -1715,7 +1712,7 @@ if(BUILD_TEST)
+           endif()
+         else()
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
+         endif()
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+@@ -1732,7 +1729,7 @@ if(BUILD_TEST)
    foreach(test_src ${Caffe2_CPU_TEST_SRCS})
      get_filename_component(test_name ${test_src} NAME_WE)
      add_executable(${test_name} "${test_src}")
 -    target_link_libraries(${test_name} torch_library gtest_main)
 +    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     if(USE_OPENMP)
-       # -fopenmp is a compile time flag and as result not guaranteed
-       # to link executable against OpenMP runtime library
-@@ -1785,7 +1785,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_GPU_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1803,7 +1803,7 @@ if(BUILD_TEST)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+@@ -1795,7 +1792,7 @@ if(BUILD_TEST)
      foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
        get_filename_component(test_name ${test_src} NAME_WE)
        add_executable(${test_name} "${test_src}")
@@ -41,20 +107,66 @@ index d57d7ebb..5b5622f0 100644
        target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
        target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
        add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1821,7 +1821,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_HIP_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
-       target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
+diff --git a/caffe2/serialize/CMakeLists.txt b/caffe2/serialize/CMakeLists.txt
+index 1552b59..67e1a9a 100644
+--- a/caffe2/serialize/CMakeLists.txt
++++ b/caffe2/serialize/CMakeLists.txt
+@@ -2,7 +2,6 @@ file(GLOB tmp *_test.cc)
+ 
+ set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
+ list(APPEND Caffe2_CPU_SRCS
+-  ${PROJECT_SOURCE_DIR}/third_party/miniz-2.1.0/miniz.c
+   ${CMAKE_CURRENT_SOURCE_DIR}/inline_container.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/istream_adapter.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/file_adapter.cc
 diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 557ab649..ee9cf410 100644
+index acc9584..97275bf 100644
 --- a/cmake/Dependencies.cmake
 +++ b/cmake/Dependencies.cmake
-@@ -732,11 +732,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+@@ -283,7 +283,7 @@ endif()
+ # --- [ PocketFFT
+ set(AT_POCKETFFT_ENABLED 0)
+ if(NOT AT_MKL_ENABLED)
+-  set(POCKETFFT_INCLUDE_DIR "${Torch_SOURCE_DIR}/third_party/pocketfft/")
++  set(POCKETFFT_INCLUDE_DIR "#POCKETFFT_INCLUDE_DIR")
+   if(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}")
+     message(FATAL_ERROR "pocketfft directory not found, expected ${POCKETFFT_INCLUDE_DIR}")
+   elif(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}/pocketfft_hdronly.h")
+@@ -489,19 +489,6 @@ if(USE_QNNPACK)
+     set(QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+     set(QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+     set(QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-    add_subdirectory(
+-      "${QNNPACK_SOURCE_DIR}"
+-      "${CONFU_DEPENDENCIES_BINARY_DIR}/QNNPACK")
+-
+-    # TODO: See https://github.com/pytorch/pytorch/issues/56285
+-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+-      target_compile_options(qnnpack PRIVATE -Wno-deprecated-declarations)
+-    endif()
+-
+-    # We build static versions of QNNPACK and pthreadpool but link
+-    # them into a shared library for Caffe2, so they need PIC.
+-    set_property(TARGET qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+     if(QNNPACK_CUSTOM_THREADPOOL)
+       target_compile_definitions(
+@@ -550,13 +537,6 @@ if(USE_PYTORCH_QNNPACK)
+       set(PYTORCH_QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-      add_subdirectory(
+-        "${PYTORCH_QNNPACK_SOURCE_DIR}"
+-        "${CONFU_DEPENDENCIES_BINARY_DIR}/pytorch_qnnpack")
+-      # We build static versions of QNNPACK and pthreadpool but link
+-      # them into a shared library for Caffe2, so they need PIC.
+-      set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-      set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+       if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
+         target_compile_definitions(
+@@ -728,11 +708,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
    # this shouldn't be necessary anymore.
    get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
    set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
@@ -66,7 +178,49 @@ index 557ab649..ee9cf410 100644
  
    # We will not need to test benchmark lib itself.
    set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1543,7 +1538,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+@@ -810,16 +785,6 @@ if(USE_FBGEMM)
+     if(USE_ASAN)
+       set(USE_SANITIZER "address,undefined" CACHE STRING "-fsanitize options for FBGEMM")
+     endif()
+-    add_subdirectory("${FBGEMM_SOURCE_DIR}")
+-    set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
+-      # See https://github.com/pytorch/pytorch/issues/74352
+-      target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
+-      target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
+-    endif()
+   endif()
+ 
+   if(USE_FBGEMM)
+@@ -979,7 +944,7 @@ if(NOT TARGET fp16 AND NOT USE_SYSTEM_FP16)
+     "${FP16_SOURCE_DIR}"
+     "${CONFU_DEPENDENCIES_BINARY_DIR}/FP16")
+ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
+-  add_library(fp16 STATIC "/usr/include/fp16.h")
++  add_library(fp16 STATIC "#FP16_INCLUDE_DIR")
+   set_target_properties(fp16 PROPERTIES LINKER_LANGUAGE C)
+ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
+@@ -1362,7 +1327,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ 
+     # Tensorpipe uses cuda_add_library
+     torch_update_find_cuda_flags()
+-    add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
+ 
+     list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
+     if(USE_CUDA)
+@@ -1529,7 +1493,6 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+       set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
+     endif()
+   endif()
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+ 
+   add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+   if(NOT USE_SYSTEM_ONNX)
+@@ -1560,7 +1523,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
      endif()
      set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
      message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
@@ -75,8 +229,36 @@ index 557ab649..ee9cf410 100644
    endif()
    include_directories(${FOXI_INCLUDE_DIRS})
    list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
+@@ -1739,9 +1702,8 @@ if(NOT INTERN_BUILD_MOBILE)
+   endif()
+   if(USE_MKLDNN)
+     include(${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake)
+-    if(MKLDNN_FOUND)
++    if(DNNL_FOUND)
+       set(AT_MKLDNN_ENABLED 1)
+-      include_directories(AFTER SYSTEM ${MKLDNN_INCLUDE_DIR})
+       if(BUILD_CAFFE2_OPS)
+         list(APPEND Caffe2_DEPENDENCY_LIBS caffe2::mkldnn)
+       endif(BUILD_CAFFE2_OPS)
+@@ -1796,7 +1758,7 @@ endif()
+ #
+ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
+-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
++find_package(fmt)
+ 
+ # Disable compiler feature checks for `fmt`.
+ #
+@@ -1805,7 +1767,6 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
+ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
+ # `fmt` is compatible with a superset of the compilers that PyTorch is, it
+ # shouldn't be too bad to just disable the checks.
+-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "")
+ 
+ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
+ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
 diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cb..6075bdd0 100644
+index 9d5f064..c3624e5 100644
 --- a/cmake/External/nnpack.cmake
 +++ b/cmake/External/nnpack.cmake
 @@ -40,7 +40,7 @@ endif()
@@ -88,7 +270,7 @@ index a41343cb..6075bdd0 100644
    message(STATUS "Brace yourself, we are building NNPACK")
    set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
  
-@@ -114,6 +114,5 @@ endif()
+@@ -112,6 +112,5 @@ endif()
  # (4) Catch-all: not supported.
  ##############################################################################
  
@@ -97,8 +279,45 @@ index a41343cb..6075bdd0 100644
 -set(USE_NNPACK OFF)
 +set(NNPACK_FOUND TRUE)
 +set(USE_NNPACK ON)
+diff --git a/cmake/public/mkldnn.cmake b/cmake/public/mkldnn.cmake
+index 8793562..9f8fa3d 100644
+--- a/cmake/public/mkldnn.cmake
++++ b/cmake/public/mkldnn.cmake
+@@ -4,7 +4,7 @@ if(CPU_AARCH64)
+   include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake)
+ endif()
+ 
+-find_package(MKLDNN QUIET)
++find_package(DNNL REQUIRED)
+ 
+ if(NOT TARGET caffe2::mkldnn)
+   add_library(caffe2::mkldnn INTERFACE IMPORTED)
+@@ -15,4 +15,4 @@ set_property(
+   ${MKLDNN_INCLUDE_DIR})
+ set_property(
+   TARGET caffe2::mkldnn PROPERTY INTERFACE_LINK_LIBRARIES
+-  ${MKLDNN_LIBRARIES})
++  DNNL::dnnl)
+diff --git a/setup.py b/setup.py
+index 81f3c6c..3251cab 100644
+--- a/setup.py
++++ b/setup.py
+@@ -482,13 +482,9 @@ def build_deps():
+     # Windows has very poor support for them.
+     sym_files = [
+         "tools/shared/_utils_internal.py",
+-        "torch/utils/benchmark/utils/valgrind_wrapper/callgrind.h",
+-        "torch/utils/benchmark/utils/valgrind_wrapper/valgrind.h",
+     ]
+     orig_files = [
+         "torch/_utils_internal.py",
+-        "third_party/valgrind-headers/callgrind.h",
+-        "third_party/valgrind-headers/valgrind.h",
+     ]
+     for sym_file, orig_file in zip(sym_files, orig_files):
+         same = False
 diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
-index bf91460c..ef56948f 100644
+index 5c89748..ef84c57 100644
 --- a/test/cpp/c10d/CMakeLists.txt
 +++ b/test/cpp/c10d/CMakeLists.txt
 @@ -16,14 +16,14 @@ function(c10d_add_test test_src)
@@ -133,7 +352,29 @@ index bf91460c..ef56948f 100644
    endif()
    if(USE_NCCL AND USE_C10D_NCCL)
      # NCCL is a private dependency of libtorch, but the tests include some
-@@ -56,7 +56,7 @@ if(USE_CUDA)
+@@ -44,10 +44,10 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupNCCLTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     c10d_add_test(
+       ProcessGroupNCCLErrorsTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+       install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+@@ -61,7 +61,7 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupUCCTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_ucc)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_ucc)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupUCCTest DESTINATION bin)
+       install(TARGETS c10d_cuda_test DESTINATION lib)
+@@ -69,7 +69,7 @@ if(USE_CUDA)
    endif()
  else()
    if(USE_GLOO AND USE_C10D_GLOO)
@@ -143,10 +384,10 @@ index bf91460c..ef56948f 100644
  endif()
  
 diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
-index 8fc5a0a1..643202f6 100644
+index 012471d..d39b625 100644
 --- a/test/cpp/tensorexpr/CMakeLists.txt
 +++ b/test/cpp/tensorexpr/CMakeLists.txt
-@@ -53,7 +53,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+@@ -54,7 +54,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
  # pthreadpool header. For some build environment we need add the dependency
  # explicitly.
  if(USE_PTHREADPOOL)
@@ -154,4 +395,4 @@ index 8fc5a0a1..643202f6 100644
 +  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
  endif()
  if(USE_CUDA)
-   target_link_libraries(test_tensorexpr PRIVATE
+   target_compile_definitions(test_tensorexpr PRIVATE USE_CUDA)
diff --git a/gnu/packages/patches/python-pytorch-without-kineto.patch b/gnu/packages/patches/python-pytorch-without-kineto.patch
new file mode 100644
index 0000000000..f956316866
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-without-kineto.patch
@@ -0,0 +1,60 @@
+Even when building without Kineto, the <ActivityType.h> header is still
+imported and the ActivityType type is used. This patch was copied from
+https://github.com/pytorch/pytorch/pull/111048.
+
+diff --git a/torch/csrc/profiler/kineto_shim.h b/torch/csrc/profiler/kineto_shim.h
+index e92cbf00..68985ab7 100644
+--- a/torch/csrc/profiler/kineto_shim.h
++++ b/torch/csrc/profiler/kineto_shim.h
+@@ -12,7 +12,51 @@
+ #undef USE_KINETO
+ #endif
+ 
++#ifdef USE_KINETO
+ #include <ActivityType.h>
++#else
++namespace libkineto {
++// copied from header
++/*
++ * Copyright (c) Meta Platforms, Inc. and affiliates.
++ * All rights reserved.
++ *
++ * This source code is licensed under the BSD-style license found in the
++ * LICENSE file in the root directory of this source tree.
++ */
++
++// Note : All activity types are not enabled by default. Please add them
++// at correct position in the enum
++enum class ActivityType {
++    // Activity types enabled by default
++    CPU_OP = 0, // cpu side ops
++    USER_ANNOTATION,
++    GPU_USER_ANNOTATION,
++    GPU_MEMCPY,
++    GPU_MEMSET,
++    CONCURRENT_KERNEL, // on-device kernels
++    EXTERNAL_CORRELATION,
++    CUDA_RUNTIME, // host side cuda runtime events
++    CUDA_DRIVER, // host side cuda driver events
++    CPU_INSTANT_EVENT, // host side point-like events
++    PYTHON_FUNCTION,
++    OVERHEAD, // CUPTI induced overhead events sampled from its overhead API.
++
++    // Optional Activity types
++    CUDA_SYNC, // synchronization events between runtime and kernels
++    GLOW_RUNTIME, // host side glow runtime events
++    MTIA_RUNTIME, // host side MTIA runtime events
++    CUDA_PROFILER_RANGE, // CUPTI Profiler range for performance metrics
++    MTIA_CCP_EVENTS, // MTIA ondevice CCP events
++    HPU_OP, // HPU host side runtime event
++    XPU_RUNTIME, // host side xpu runtime events
++
++    ENUM_COUNT, // This is to add buffer and not used for any profiling logic. Add your new type before it.
++    OPTIONAL_ACTIVITY_TYPE_START = CUDA_SYNC,
++};
++}
++
++#endif
+ 
+ #include <torch/csrc/Export.h>
+ #include <torch/csrc/profiler/api.h>
-- 
2.41.0





^ permalink raw reply related	[relevance 47%]

* [bug#69924] [PATCH 08/49] gnu: python-pytest-filter-subpackage: Update to 0.2.0.
                     ` (4 preceding siblings ...)
  2024-03-20 22:27 64% ` [bug#69924] [PATCH 07/49] gnu: python-pytest-arraydiff: Enable tests Sharlatan Hellseher
@ 2024-03-20 22:27 65% ` Sharlatan Hellseher
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 09/49] gnu: python-zarr: Update to 2.17.1 Sharlatan Hellseher
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-check.scm (python-pytest-filter-subpackage): Update to 0.2.0.

Change-Id: I04f000b3a75f671340fbd351b06265b99acb3856
---
 gnu/packages/python-check.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index beb151178d..bee5a468fa 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -668,13 +668,13 @@ (define-public python-pytest-exploratory
 (define-public python-pytest-filter-subpackage
   (package
     (name "python-pytest-filter-subpackage")
-    (version "0.1.2")
+    (version "0.2.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pytest-filter-subpackage" version))
        (sha256
-        (base32 "10hpl3f7g2bm29lakmp8492b7lr0dp90khfni12m4gl02xks7bhz"))))
+        (base32 "0mmgg2n8qk6s2kprycjl70lxcpm43dkapplmkf32i0ai6qdqyiiz"))))
     (build-system pyproject-build-system)
     (native-inputs
      (list python-pytest
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69924] [PATCH 07/49] gnu: python-pytest-arraydiff: Enable tests.
                     ` (3 preceding siblings ...)
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 06/49] gnu: python-pytest-arraydiff: Update to 0.6.1 Sharlatan Hellseher
@ 2024-03-20 22:27 64% ` Sharlatan Hellseher
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 08/49] gnu: python-pytest-filter-subpackage: Update to 0.2.0 Sharlatan Hellseher
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-check.scm (python-pytest-arraydiff): Enable tests.
[build-system]: Swap to pyproject-build-system.
[arguments] <#:test-flags>: Disable tests requiring python-astropy to
break dependencies cycle.

Change-Id: I0e4b6681d106a999c6fc12c3fd8c8f084762a92e
---
 gnu/packages/python-check.scm | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index fe96bd297c..beb151178d 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -552,13 +552,18 @@ (define-public python-pytest-arraydiff
        (uri (pypi-uri "pytest-arraydiff" version))
        (sha256
         (base32 "1pk7v96rkypx4ld59f6p8fh5bq371ka8g7bh4h7n4df91x2v2dr9"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (arguments
-     ;; Tests require python-astropy, which itself requires this package.
-     ;; Disable tests to avoid the circular dependency problem.
-     '(#:tests? #f))
+     (list
+      #:test-flags
+      #~(list "-k" (string-append
+                    ;; Disable tests requiring python-astropy, to break cycle.
+                    "not test_succeeds_func_fits_hdu"
+                    " and not test_fails"
+                    " and not test_generate"
+                    " and not test_default_format"))))
     (native-inputs
-     (list python-pytest python-setuptools-scm)) ; for sanity-check
+     (list python-pytest python-setuptools-scm))
     (propagated-inputs
      (list python-numpy))
     (home-page "https://github.com/astropy/pytest-arraydiff")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69924] [PATCH 48/49] gnu: Add python-pydantic-settings.
                     ` (13 preceding siblings ...)
  2024-03-20 22:28 63% ` [bug#69924] [PATCH 45/49] gnu: Add python-ewah-bool-utils Sharlatan Hellseher
@ 2024-03-20 22:28 57% ` Sharlatan Hellseher
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:28 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-pydantic-settings): New variable.

Change-Id: I410edc37f17a293f3d40ce9a2ab6416ea35bae39
---
 gnu/packages/python-xyz.scm | 65 +++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6d587dc017..285507971a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7603,6 +7603,71 @@ (define-public python-pydantic-cli
 Interfaces} via data models provided in the JSON format.")
     (license license:expat)))
 
+(define-public python-pydantic-settings
+  (package
+    (name "python-pydantic-settings")
+    (version "2.2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pydantic_settings" version))
+       (sha256
+        (base32 "1vf58f398ngk6wpf0jn51ghw65mjs3m03yn06h25jlsmx6jzdf80"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      #~(list "-k" (string-append
+                    ;; Disable tests requiring python-ruff.
+                    "not test_docs_examples[docs/index.md:24-83]"
+                    " and not test_docs_examples[docs/index.md:113-137]"
+                    " and not test_docs_examples[docs/index.md:148-156]"
+                    " and not test_docs_examples[docs/index.md:173-183]"
+                    " and not test_docs_examples[docs/index.md:193-201]"
+                    " and not test_docs_examples[docs/index.md:212-243]"
+                    " and not test_docs_examples[docs/index.md:286-317]"
+                    " and not test_docs_examples[docs/index.md:331-372]"
+                    " and not test_docs_examples[docs/index.md:430-439]"
+                    " and not test_docs_examples[docs/index.md:453-459]"
+                    " and not test_docs_examples[docs/index.md:514-522]"
+                    " and not test_docs_examples[docs/index.md:547-549]"
+                    " and not test_docs_examples[docs/index.md:553-585]"
+                    " and not test_docs_examples[docs/index.md:620-645]"
+                    " and not test_docs_examples[docs/index.md:654-732]"
+                    " and not test_docs_examples[docs/index.md:738-772]"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'relax-requirements
+            (lambda _
+              (substitute* "pyproject.toml"
+                ;; hatchling.build failed on this line with error:
+                ;; ValueError: Unknown classifier in field
+                ;; `project.classifiers`: Framework :: Pydantic :: 2
+                (("'Framework :: Pydantic :: 2',") "")
+                ;; python-dotenv>=0.21.0
+                ((">=0.21.0") ">=0.20.0"))))
+          (add-before 'check 'set-home
+            (lambda _
+              ;; FileNotFoundError: [Errno 2] No such file or directory:
+              ;; '/homeless-shelter/
+              (setenv "HOME" "/tmp"))))))
+    (propagated-inputs
+     (list python-dotenv
+           python-pydantic-2
+           python-pyaml
+           python-tomli))
+    (native-inputs
+     (list python-hatchling
+           python-pytest
+           python-pytest-examples
+           python-pytest-mock))
+    (home-page "https://docs.pydantic.dev/latest/usage/pydantic_settings/")
+    (synopsis "Settings management using Pydantic")
+    (description
+     "Pydantic Settings provides optional Pydantic features for loading a
+settings or config class from environment variables or secrets files.")
+    (license license:expat)))
+
 (define-public python-pydoc-markdown
   (package
     (name "python-pydoc-markdown")
-- 
2.41.0





^ permalink raw reply related	[relevance 57%]

* [bug#69924] [PATCH 34/49] gnu: python-glymur: Update to 0.12.9.
                     ` (11 preceding siblings ...)
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 15/49] gnu: python-glymur: " Sharlatan Hellseher
@ 2024-03-20 22:28 65% ` Sharlatan Hellseher
  2024-03-20 22:28 63% ` [bug#69924] [PATCH 45/49] gnu: Add python-ewah-bool-utils Sharlatan Hellseher
  2024-03-20 22:28 57% ` [bug#69924] [PATCH 48/49] gnu: Add python-pydantic-settings Sharlatan Hellseher
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:28 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-glymur): Update to 0.12.9.

Change-Id: Ifb84738df85cb6142fc5ecafa164a6dc4148a69e
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 763345c0c2..6d587dc017 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1943,7 +1943,7 @@ (define-public python-gh-md-to-html
 (define-public python-glymur
   (package
     (name "python-glymur")
-    (version "0.12.8")
+    (version "0.12.9")
     (source
      (origin
        (method git-fetch)   ; no tests data in PyPi package
@@ -1952,7 +1952,7 @@ (define-public python-glymur
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0mfyn9j7h13242d41vg12acw55yl2mv6lmgi265hfp11k7g52b6n"))))
+        (base32 "0awyav7071nn9z2g4mmpg33y0y0nfandfr6nr3j5vyb8hnprcmns"))))
     (build-system pyproject-build-system)
     (arguments
      (list
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v3 06/32] gnu: Add python-expecttest.
                     ` (3 preceding siblings ...)
  2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 05/32] gnu: Add python-pytest-shard David Elsing
@ 2024-03-20 22:38 64% ` David Elsing
  2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 07/32] gnu: Add python-pytest-rerunfailures-13 David Elsing
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-20 22:38 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-expecttest): New variable.
---
 gnu/packages/python-check.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index f876088488..dbca80652c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2078,6 +2078,41 @@ (define-public python-eradicate
 valid Python syntax that are likely to be commented out code.")
     (license license:expat)))
 
+(define-public python-expecttest
+  (let ((commit "683b09a352cc426851adc2e3a9f46e0ab25e4dee")
+        (revision "0"))
+    (package
+      (name "python-expecttest")
+      (version (git-version "0.2.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ezyang/expecttest")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1djwxp9x1hczzxbimv1b1bmd083am88v27l82nmlkhvzyg2cmpvv"))))
+      (build-system pyproject-build-system)
+      (arguments
+       (list
+        #:phases
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  ;; The test runs tests expected to fail, so the output is
+                  ;; confusing
+                  (invoke "python3" "test_expecttest.py")))))))
+      (native-inputs (list python-hypothesis poetry))
+      (home-page "https://github.com/ezyang/expecttest")
+      (synopsis "Python module for expect tests")
+      (description "@code{expecttest} is a Python module for expect tests, where
+the initial expected value of a test can be automatically set by running the
+test itself.")
+      (license license:expat))))
+
 (define-public python-robber
   (package
     (name "python-robber")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69591] [PATCH v3 02/32] gnu: Add python-typing-extensions-4.10.
  @ 2024-03-20 22:38 65% ` David Elsing
  2024-03-20 22:38 63% ` [bug#69591] [PATCH v3 03/32] gnu: Add python-optree David Elsing
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-20 22:38 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-build.scm (python-typing-extensions-4.10): New variable.
---
 gnu/packages/python-build.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 2ea457cdba..dfd59d5e25 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2022 Garek Dyszel <garekdyszel@disroot.org>
 ;;; Copyright © 2022 Greg Hogan <code@greghogan.com>
-
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -252,6 +252,18 @@ (define-public python-typing-extensions
 @end enumerate\n")
     (license license:psfl)))
 
+(define-public python-typing-extensions-4.10
+  (package
+    (inherit python-typing-extensions)
+    (version "4.10.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "typing_extensions" version))
+       (sha256
+        (base32
+         "1jxkj4pni8pdyrn79sq441lsp40xzw363n0qvfc6zfcgkv4dgaxh"))))))
+
 \f
 ;;;
 ;;; Python builder packages.
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v3 07/32] gnu: Add python-pytest-rerunfailures-13.
                     ` (4 preceding siblings ...)
  2024-03-20 22:38 64% ` [bug#69591] [PATCH v3 06/32] gnu: Add python-expecttest David Elsing
@ 2024-03-20 22:38 65% ` David Elsing
  2024-03-20 22:38 47% ` [bug#69591] [PATCH v3 26/32] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
  2024-03-20 22:38 43% ` [bug#69591] [PATCH v3 32/32] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-20 22:38 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-rerunfailures-13): New variable.
---
 gnu/packages/python-check.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index dbca80652c..347e4a4701 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2464,6 +2464,17 @@ (define-public python-pytest-rerunfailures
 eliminate flaky failures.")
     (license license:mpl2.0)))
 
+(define-public python-pytest-rerunfailures-13
+  (package
+    (inherit python-pytest-rerunfailures)
+    (version "13.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-rerunfailures" version))
+       (sha256
+        (base32 "16cin0chv59w4rvnd6r0fisp0s8avmp07rwn9da6yixw43jdncp1"))))))
+
 (define-public python-xunitparser
   (package
     (name "python-xunitparser")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69924] [PATCH 09/49] gnu: python-zarr: Update to 2.17.1.
                     ` (5 preceding siblings ...)
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 08/49] gnu: python-pytest-filter-subpackage: Update to 0.2.0 Sharlatan Hellseher
@ 2024-03-20 22:27 65% ` Sharlatan Hellseher
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 10/49] gnu: python-partd: Enable tests Sharlatan Hellseher
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-zarr): Update to 2.17.1.

Change-Id: Id7873b68bb82400f66539d03fe9a357deb61d58c
---
 gnu/packages/python-xyz.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7eacce5caf..2bff593063 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -26969,15 +26969,15 @@ (define-public python-asciitree
 (define-public python-zarr
   (package
     (name "python-zarr")
-    (version "2.13.3")
+    (version "2.17.1")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "zarr" version))
        (sha256
         (base32
-         "135ls2q7zc98pk61a5cnh88j4hnnavcwasrswdjqyqvcc68b096v"))))
-    (build-system python-build-system)
+         "0qb2wj60i7v1c95k6m0pskx20ss6dxrj3ym0d7z4c98jfah3ljsn"))))
+    (build-system pyproject-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69924] [PATCH 13/49] gnu: python-dask: Speed up tests.
                     ` (9 preceding siblings ...)
  2024-03-20 22:27 62% ` [bug#69924] [PATCH 12/49] gnu: python-distributed: " Sharlatan Hellseher
@ 2024-03-20 22:27 65% ` Sharlatan Hellseher
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 15/49] gnu: python-glymur: " Sharlatan Hellseher
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-dask) [arguments] <#:test-flags>:
Add option to run tests in parallel.
[native-inputs]: Add python-xdist. Reformat as a list.

Change-Id: I9b4b1c53f827e1f5d3edd0908f8e37e1a3bddb71
---
 gnu/packages/python-xyz.scm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 360b4db3f1..4a9069bbed 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -27488,7 +27488,8 @@ (define-public python-dask
      (list
       ;; Avoid coverage
       #:test-flags
-      #~(list "-m" "not gpu and not slow and not network"
+      #~(list "-n" "auto"
+              "-m" "not gpu and not slow and not network"
               "-k" (string-append
                     ;; This one cannot be interrupted.
                     "not test_interrupt"
@@ -27541,7 +27542,10 @@ (define-public python-dask
            python-pyyaml))
     (native-inputs
      (list python-importlib-metadata
-           python-pytest python-pytest-runner python-pytest-rerunfailures
+           python-pytest
+           python-pytest-rerunfailures
+           python-pytest-runner
+           python-pytest-xdist
            python-versioneer))
     (home-page "https://github.com/dask/dask/")
     (synopsis "Parallel computing with task scheduling")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v3 05/32] gnu: Add python-pytest-shard.
                     ` (2 preceding siblings ...)
  2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 04/32] gnu: Add python-pytest-flakefinder David Elsing
@ 2024-03-20 22:38 65% ` David Elsing
  2024-03-20 22:38 64% ` [bug#69591] [PATCH v3 06/32] gnu: Add python-expecttest David Elsing
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-20 22:38 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-shard): New variable.
---
 gnu/packages/python-check.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 247f8af98b..f876088488 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -210,6 +210,30 @@ (define-public python-pytest-flakefinder
 times and detect flakyness.")
     (license license:asl2.0)))
 
+(define-public python-pytest-shard
+  (let ((commit "64610a08dac6b0511b6d51cf895d0e1040d162ad")
+        (revision "0"))
+    (package
+      (name "python-pytest-shard")
+      (version (git-version "0.1.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/AdamGleave/pytest-shard")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1h31m68igz670bzl307hazjrfbr8pk14mxflllar18ydmlrnl677"))))
+      (build-system pyproject-build-system)
+      (propagated-inputs (list python-pytest))
+      (home-page "https://github.com/AdamGleave/pytest-shard")
+      (synopsis "Pytest plugin for sharding tests")
+      (description "This package provides a Pytest extension for sharding
+tests at the granularity of individual test cases, which can be run in
+parallel and on multiple machines.")
+      (license license:expat))))
+
 (define-public python-testfixtures
   (package
     (name "python-testfixtures")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v3 03/32] gnu: Add python-optree.
    2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 02/32] gnu: Add python-typing-extensions-4.10 David Elsing
@ 2024-03-20 22:38 63% ` David Elsing
  2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 04/32] gnu: Add python-pytest-flakefinder David Elsing
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-20 22:38 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-xyz.scm (python-optree): New variable.
---
 .../patches/python-optree-fix-32-bit.patch    | 122 ++++++++++++++++++
 gnu/packages/python-xyz.scm                   |  30 +++++
 2 files changed, 152 insertions(+)
 create mode 100644 gnu/packages/patches/python-optree-fix-32-bit.patch

diff --git a/gnu/packages/patches/python-optree-fix-32-bit.patch b/gnu/packages/patches/python-optree-fix-32-bit.patch
new file mode 100644
index 0000000000..6a32c39bd8
--- /dev/null
+++ b/gnu/packages/patches/python-optree-fix-32-bit.patch
@@ -0,0 +1,122 @@
+In include/utils.h, ssize_t is an alias for py::ssize_t, which is an alias for
+Py_ssize_t in Python, which is an alias for the system ssize_t.
+The latter is defined in glibc as int if __WORDSIZE == 32 and as long int if
+__WORDSIZE == 64.  Therefore, we need to remove the explicit template
+specialization for int in the first case.
+
+diff --git a/include/utils.h b/include/utils.h
+index 950a02b..82a9591 100644
+--- a/include/utils.h
++++ b/include/utils.h
+@@ -141,10 +141,12 @@ template <>
+ inline py::handle GET_ITEM_HANDLE<py::tuple>(const py::handle& container, const size_t& item) {
+     return PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::tuple>(const py::handle& container, const int& item) {
+     return PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#endif
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const ssize_t& item) {
+     return PyList_GET_ITEM(container.ptr(), item);
+@@ -153,10 +155,12 @@ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const size_t& item) {
+     return PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const int& item) {
+     return PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline py::object GET_ITEM_BORROW(const py::handle& container, const Item& item) {
+@@ -171,11 +175,13 @@ inline py::object GET_ITEM_BORROW<py::tuple>(const py::handle& container, const
+     return py::reinterpret_borrow<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_BORROW<py::tuple>(const py::handle& container, const int& item) {
+     return py::reinterpret_borrow<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ template <>
+ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const ssize_t& item) {
+     return py::reinterpret_borrow<py::object>(PyList_GET_ITEM(container.ptr(), item));
+@@ -185,11 +191,13 @@ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const s
+     return py::reinterpret_borrow<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const int& item) {
+     return py::reinterpret_borrow<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline py::object GET_ITEM_STEAL(const py::handle& container, const Item& item) {
+@@ -204,11 +212,13 @@ inline py::object GET_ITEM_STEAL<py::tuple>(const py::handle& container, const s
+     return py::reinterpret_steal<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_STEAL<py::tuple>(const py::handle& container, const int& item) {
+     return py::reinterpret_steal<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ template <>
+ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const ssize_t& item) {
+     return py::reinterpret_steal<py::object>(PyList_GET_ITEM(container.ptr(), item));
+@@ -218,11 +228,13 @@ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const si
+     return py::reinterpret_steal<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const int& item) {
+     return py::reinterpret_steal<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline void SET_ITEM(const py::handle& container, const Item& item, const py::handle& value) {
+@@ -240,12 +252,14 @@ inline void SET_ITEM<py::tuple>(const py::handle& container,
+                                 const py::handle& value) {
+     PyTuple_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline void SET_ITEM<py::tuple>(const py::handle& container,
+                                 const int& item,
+                                 const py::handle& value) {
+     PyTuple_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#endif
+ template <>
+ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const ssize_t& item,
+@@ -258,12 +272,14 @@ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const py::handle& value) {
+     PyList_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const int& item,
+                                const py::handle& value) {
+     PyList_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#endif
+ 
+ template <typename PyType>
+ inline void AssertExact(const py::handle& object) {
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0ac9d669d3..bac7d79af9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -150,6 +150,7 @@
 ;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
 ;;; Copyright © 2024 Ian Eure <ian@retrospec.tv>
 ;;; Copyright © 2024 Adriel Dumas--Jondeau <leirda@disroot.org>
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -11741,6 +11742,35 @@ (define-public python-treelib
      "This package provides a Python implementation of a tree structure.")
     (license license:asl2.0)))
 
+(define-public python-optree
+  (package
+    (name "python-optree")
+    (version "0.10.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/metaopt/optree")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1q3wljk7cyl5rsam02sfsj8zjrqx4c3x9vic8j6xx13p8czpsisg"))
+       (patches (search-patches "python-optree-fix-32-bit.patch"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-typing-extensions))
+    (native-inputs
+     (list python-pytest
+           python-pytest-cov
+           python-pytest-xdist
+           cmake
+           pybind11))
+    (home-page "https://github.com/metaopt/optree")
+    (synopsis "Optimized PyTree Utilities")
+    (description "This package contains operations on PyTrees (a tree made of
+container data structures in Python).")
+    (license license:asl2.0)))
+
 (define-public python-jupyter-core
   (package
     (name "python-jupyter-core")
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#69591] [PATCH v3 04/32] gnu: Add python-pytest-flakefinder.
    2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 02/32] gnu: Add python-typing-extensions-4.10 David Elsing
  2024-03-20 22:38 63% ` [bug#69591] [PATCH v3 03/32] gnu: Add python-optree David Elsing
@ 2024-03-20 22:38 65% ` David Elsing
  2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 05/32] gnu: Add python-pytest-shard David Elsing
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-20 22:38 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-flakefinder): New variable.
---
 gnu/packages/python-check.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 51a38bbcbe..247f8af98b 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -191,6 +192,24 @@ (define-public python-pytest-csv
 it adds to the Pytest command line interface (CLI).")
     (license license:gpl3+)))
 
+(define-public python-pytest-flakefinder
+  (package
+    (name "python-pytest-flakefinder")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-flakefinder" version))
+       (sha256
+        (base32 "03iy80xlkpgzjs2kxa9rrj8dbnp9awyhpcl3hy8fgf5x40cjlhg2"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-pytest))
+    (home-page "https://github.com/dropbox/pytest-flakefinder")
+    (synopsis "Pytest plugin for finding flaky tests")
+    (description "This package provides a Pytest plugin to run tests multiple
+times and detect flakyness.")
+    (license license:asl2.0)))
+
 (define-public python-testfixtures
   (package
     (name "python-testfixtures")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69924] [PATCH 03/49] gnu: python-blosc: Move to python-compression.
  @ 2024-03-20 22:27 69% ` Sharlatan Hellseher
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 04/49] gnu: python-blosc: Simplify package Sharlatan Hellseher
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=a, Size: 5579 bytes --]

* gnu/packages/python-xyz.scm (python-blosc): Move from here ...
* gnu/packages/python-compression.scm: ... to here.

Change-Id: Ieed1b399602d0ba64b065d1c03ef0855ac52f71e
---
 gnu/packages/python-compression.scm | 47 ++++++++++++++++++++++++++++-
 gnu/packages/python-xyz.scm         | 44 ---------------------------
 2 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm
index 691fbd3065..ef289bc4d1 100644
--- a/gnu/packages/python-compression.scm
+++ b/gnu/packages/python-compression.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2017, 2019, 2021, 2022 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Nikita <nikita@n0.is>
 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
-;;; Copyright © 2018-2020, 2022 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018-2020, 2022, 2023 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2020, 2022, 2023 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
@@ -38,6 +38,7 @@ (define-module (gnu packages python-compression)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crates-io)
+  #:use-module (gnu packages cmake)
   #:use-module (gnu packages check)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages pkg-config)
@@ -49,6 +50,50 @@ (define-module (gnu packages python-compression)
   #:use-module (gnu packages rust-apps)
   #:use-module (gnu packages sphinx))
 
+(define-public python-blosc
+  (package
+    (name "python-blosc")
+    (version "1.11.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "blosc" version))
+       (sha256
+        (base32
+         "0xmjs28sgpnb940zrhw010dq2m9d8a5h4fgnjyk6645fgfr1j8f2"))
+       (snippet
+        #~(begin (use-modules (guix build utils))
+                 (delete-file-recursively "blosc/c-blosc")))))
+    (build-system python-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'find-blosc
+                 (lambda* (#:key inputs #:allow-other-keys)
+                   (setenv "USE_SYSTEM_BLOSC" "1")
+                   (setenv "Blosc_ROOT" #$(this-package-input "c-blosc"))))
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (invoke "python" "-m" "blosc.test")))))))
+    (propagated-inputs
+     (list python-scikit-build python-numpy))
+    (inputs (list c-blosc))
+    (native-inputs (list cmake-minimal))
+    (home-page "https://github.com/blosc/python-blosc")
+    (synopsis "Python wrapper for the Blosc data compressor library")
+    (description "Blosc is a high performance compressor optimized for binary
+data.  It has been designed to transmit data to the processor cache faster
+than the traditional, non-compressed, direct memory fetch approach via a
+@code{memcpy()} system call.
+
+Blosc works well for compressing numerical arrays that contains data with
+relatively low entropy, like sparse data, time series, grids with
+regular-spaced values, etc.
+
+This Python package wraps the Blosc library.")
+    (license license:bsd-3)))
+
 (define-public python-multivolumefile
   (package
     (name "python-multivolumefile")
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7ed8c945be..7eacce5caf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -27394,50 +27394,6 @@ (define-public python-locket
 they use the same path.")
     (license license:bsd-2)))
 
-(define-public python-blosc
-  (package
-    (name "python-blosc")
-    (version "1.11.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (pypi-uri "blosc" version))
-       (sha256
-        (base32
-         "0xmjs28sgpnb940zrhw010dq2m9d8a5h4fgnjyk6645fgfr1j8f2"))
-       (snippet
-        #~(begin (use-modules (guix build utils))
-                 (delete-file-recursively "blosc/c-blosc")))))
-    (build-system python-build-system)
-    (arguments
-     (list #:phases
-           #~(modify-phases %standard-phases
-               (add-after 'unpack 'find-blosc
-                 (lambda* (#:key inputs #:allow-other-keys)
-                   (setenv "USE_SYSTEM_BLOSC" "1")
-                   (setenv "Blosc_ROOT" #$(this-package-input "c-blosc"))))
-               (replace 'check
-                 (lambda* (#:key tests? #:allow-other-keys)
-                   (when tests?
-                     (invoke "python" "-m" "blosc.test")))))))
-    (propagated-inputs
-     (list python-scikit-build python-numpy))
-    (inputs (list c-blosc))
-    (native-inputs (list cmake-minimal))
-    (home-page "https://github.com/blosc/python-blosc")
-    (synopsis "Python wrapper for the Blosc data compressor library")
-    (description "Blosc is a high performance compressor optimized for binary
-data.  It has been designed to transmit data to the processor cache faster
-than the traditional, non-compressed, direct memory fetch approach via a
-@code{memcpy()} system call.
-
-Blosc works well for compressing numerical arrays that contains data with
-relatively low entropy, like sparse data, time series, grids with
-regular-spaced values, etc.
-
-This Python package wraps the Blosc library.")
-    (license license:bsd-3)))
-
 (define-public python-partd
   (package
     (name "python-partd")
-- 
2.41.0





^ permalink raw reply related	[relevance 69%]

* [bug#69924] [PATCH 04/49] gnu: python-blosc: Simplify package.
    2024-03-20 22:27 69% ` [bug#69924] [PATCH 03/49] gnu: python-blosc: Move to python-compression Sharlatan Hellseher
@ 2024-03-20 22:27 65% ` Sharlatan Hellseher
  2024-03-20 22:27 63% ` [bug#69924] [PATCH 05/49] gnu: python-pytest-doctestplus: Update to 1.2.0 Sharlatan Hellseher
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-compression.scm (python-blosc) [arguments]
<#:phases>: Swap to simple lambda in 'find-blosc phase as it already
uses this-package-input procedure.

Change-Id: I4d3219d9575b9573b0c384b067855fa927f122da
---
 gnu/packages/python-compression.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm
index ef289bc4d1..d076a4e161 100644
--- a/gnu/packages/python-compression.scm
+++ b/gnu/packages/python-compression.scm
@@ -69,7 +69,7 @@ (define-public python-blosc
      (list #:phases
            #~(modify-phases %standard-phases
                (add-after 'unpack 'find-blosc
-                 (lambda* (#:key inputs #:allow-other-keys)
+                 (lambda _
                    (setenv "USE_SYSTEM_BLOSC" "1")
                    (setenv "Blosc_ROOT" #$(this-package-input "c-blosc"))))
                (replace 'check
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69924] [PATCH 15/49] gnu: python-glymur: Speed up tests.
                     ` (10 preceding siblings ...)
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 13/49] gnu: python-dask: " Sharlatan Hellseher
@ 2024-03-20 22:27 65% ` Sharlatan Hellseher
  2024-03-20 22:28 65% ` [bug#69924] [PATCH 34/49] gnu: python-glymur: Update to 0.12.9 Sharlatan Hellseher
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-xyz.scm (python-glymur): Enable parallel
tests to speed them up.
[arguments] <#:test-flags>: Add it with "-n" option.
[native-inputs]: Add python-pytest-xdist.

Change-Id: Ied066330cc24a50b47307cefb2694675be8af0a4
---
 gnu/packages/python-xyz.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4a9069bbed..763345c0c2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1956,6 +1956,8 @@ (define-public python-glymur
     (build-system pyproject-build-system)
     (arguments
      (list
+      #:test-flags
+      #~(list "-n" "auto")
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'patch-library-locations
@@ -1981,7 +1983,9 @@ (define-public python-glymur
               ;; which is patched above.
               (delete-file "tests/test_config.py"))))))
     (native-inputs
-     (list python-pytest python-scikit-image))
+     (list python-pytest
+           python-pytest-xdist
+           python-scikit-image))
     (inputs
      (list openjpeg  ; glymur/lib/openjp2.py
            libtiff)) ; glymur/lib/tiff.py
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69924] [PATCH 10/49] gnu: python-partd: Enable tests.
                     ` (6 preceding siblings ...)
  2024-03-20 22:27 65% ` [bug#69924] [PATCH 09/49] gnu: python-zarr: Update to 2.17.1 Sharlatan Hellseher
@ 2024-03-20 22:27 65% ` Sharlatan Hellseher
  2024-03-20 22:27 62% ` [bug#69924] [PATCH 11/49] gnu: python-zarr: Speed up tests Sharlatan Hellseher
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-20 22:27 UTC (permalink / raw)
  To: 69924
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

Newer version of the project is migrated to pyproject.toml, this change
may help to prepare for the future upgrade.

* gnu/packages/python-xyz.scm (python-partd) [build-system]: Swap to
pyproject-build-system, allowing to detect tests and run them.

Change-Id: Ia4375b83cea6dcbf7781b3dc40f544261075d2ca
---
 gnu/packages/python-xyz.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2bff593063..799174ab60 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -27405,7 +27405,7 @@ (define-public python-partd
        (sha256
         (base32
          "1sy3vdfyyx3bc5590zb7gwpsmimqz8m992x9hsydq8nmhixqjrxa"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (propagated-inputs
      (list python-blosc
            python-locket
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69867] [PATCH 1/2] gnu: Add python-noiseprotocol.
  @ 2024-03-20 18:55 64% ` normalmente
  0 siblings, 0 replies; 200+ results
From: normalmente @ 2024-03-20 18:55 UTC (permalink / raw)
  To: 69867
  Cc: mail, normalmente, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

* gnu/packages/python-web.scm (python-noiseprotocol): New variable.

Change-Id: Id62f22f9fd3f019beded5ce5c0fe9123c34f8bb2
---
 gnu/packages/python-web.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 9ad081beb1..67bc193b4d 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -63,6 +63,7 @@
 ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net>
 ;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com>
 ;;; Copyright © 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2024 normally_js <normally_js@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3422,6 +3423,24 @@ (define-public python-ndg-httpsclient
     (home-page "https://github.com/cedadev/ndg_httpsclient/")
     (license license:bsd-3)))
 
+(define-public python-noiseprotocol
+  (package
+    (name "python-noiseprotocol")
+    (version "0.3.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "noiseprotocol" version))
+       (sha256
+        (base32 "0ifnj0mpbqsfqba9n12vf5yzxj4qf2gxql3ry43qyshgnrqsi4mh"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-cryptography))
+    (home-page "https://github.com/plizonczyk/noiseprotocol")
+    (synopsis "Implementation of Noise Protocol Framework")
+    (description
+     "This package provides an implementation of Noise Protocol Framework.")
+    (license license:expat)))
+
 (define-public python-websocket-client
   (package
     (name "python-websocket-client")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* bug#69486: [PATCH v2] gnu: Add python-pypugjs.
  2024-03-17 16:32 60% ` [bug#69486] [PATCH v2] " Tanguy Le Carrour
@ 2024-03-19 16:18 65%   ` Ludovic Courtès
  0 siblings, 0 replies; 200+ results
From: Ludovic Courtès @ 2024-03-19 16:18 UTC (permalink / raw)
  To: Tanguy Le Carrour
  Cc: Sharlatan Hellseher, Munyoki Kilyungi, Lars-Dominik Braun,
	69486-done, Marius Bakke, jgart

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

Hello!

Tanguy Le Carrour <tanguy@bioneland.org> skribis:

> * gnu/packages/python-xyz.scm (python-pypugjs): New variable.
>
> Change-Id: I050ab42d0149fcffddcf6b12dd9c1ddea23f84c9
> Signed-off-by: Tanguy Le Carrour <tanguy@bioneland.org>

Applied with the change below, to match our conventions:

  https://guix.gnu.org/manual/devel/en/html_node/Synopses-and-Descriptions.html

Thanks!  :-)

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 709 bytes --]

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 13c48bc923..8209e21828 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6100,7 +6100,9 @@ (define-public python-pypugjs
     (home-page "https://github.com/kakulukia/pypugjs")
     (synopsis "Convert Pug source files into different template languages")
     (description
-     "PugJS syntax template adapter for Django, Jinja2, Mako and Tornado templates.")
+     "PyPugJS is a high-performance port of PugJS for Python, that converts
+any @file{.pug} source into different template languages: Django, Jinja2,
+Mako, and Tornado.")
     (license license:expat))) ;; MIT
 
 (define-public python-pysdl2

^ permalink raw reply related	[relevance 65%]

* [bug#69887] [PATCH] gnu: Add python-ical2orgpy.
@ 2024-03-18 22:53 62% Benjamin Slade
  0 siblings, 0 replies; 200+ results
From: Benjamin Slade @ 2024-03-18 22:53 UTC (permalink / raw)
  To: 69887

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-python-ical2orgpy.patch --]
[-- Type: text/x-patch, Size: 2140 bytes --]

From edfc5be31a37f0c9ae0c5e7297a237645ab92e32 Mon Sep 17 00:00:00 2001
From: Benjamin Slade <slade@lambda-y.net>
Date: Mon, 18 Mar 2024 17:52:06 -0500
Subject: [PATCH] gnu: Add python-ical2orgpy.

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1f3272e..20ead67 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17623,6 +17623,36 @@ (define-public python-execnet
       (home-page "https://codespeak.net/execnet/")
       (license license:expat))))
 
+(define-public python-ical2orgpy
+  (package
+    (name "python-ical2orgpy")
+    (version "0.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ical2orgpy" version))
+       (sha256
+        (base32 "0a2ai78jzn250s1dlsimsfp6035421nrabj08xdlgsh7mb82gkap"))))
+    (build-system python-build-system)
+    (arguments
+     ;; Broken tests or cyclic dependecies with other packages.
+     '(#:phases (modify-phases %standard-phases
+                  (delete 'sanity-check))
+       #:tests? #f))
+    (propagated-inputs (list python-click python-icalendar python-pytz
+                             python-tzlocal python-recurring-ical-events))
+    (home-page "https://github.com/ical2org-py/ical2org.py")
+    (synopsis "Convert ical .ics file to org-mode")
+    (description
+     "This python script converts an ical calendar (for instance, as exported
+ from google calendar) into an org-mode document.  It is conceived as a replacement of
+ the awk script located at
+@url{https://orgmode.org/worg/org-tutorials/org-google-sync.html}.
+  The main difference is that ical2orgpy correctly manages recurring events of
+ @dfn{yearly}, @dfn{daily} and @dfn{weekly} types.  ical2orgpy duplicates all recurring
+ events falling into a specified time-frame into the exported org-document.")
+    (license license:gpl3+)))
+
 (define-public python-recurring-ical-events
   (package
     (name "python-recurring-ical-events")
-- 
2.41.0


^ permalink raw reply related	[relevance 62%]

* [bug#69885] [PATCH] gnu: Add python-x-wr-timezone.
@ 2024-03-18 22:49 79% Benjamin Slade
  0 siblings, 0 replies; 200+ results
From: Benjamin Slade @ 2024-03-18 22:49 UTC (permalink / raw)
  To: 69885

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 0001-gnu-Add-python-x-wr-timezone.patch --]
[-- Type: text/x-patch, Size: 2327 bytes --]

From f93366cb785f4783efe3c5e4027ae2062f0f87a3 Mon Sep 17 00:00:00 2001
From: Benjamin Slade <slade@lambda-y.net>
Date: Mon, 18 Mar 2024 17:47:03 -0500
Subject: [PATCH] gnu: Add python-x-wr-timezone.

* gnu/packages/<module>.scm (python-x-wr-timezone): New variable
---
 gnu/packages/python-xyz.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7ed8c94..17ce6ef 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -149,6 +149,7 @@
 ;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
 ;;; Copyright © 2024 Ian Eure <ian@retrospec.tv>
 ;;; Copyright © 2024 Adriel Dumas--Jondeau <leirda@disroot.org>
+;;; Copyright © 2024 Benjamin Slade <slade@lambda-y.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -17622,6 +17623,33 @@ (define-public python-execnet
       (home-page "https://codespeak.net/execnet/")
       (license license:expat))))
 
+(define-public python-x-wr-timezone
+  (package
+    (name "python-x-wr-timezone")
+    (version "0.0.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "x_wr_timezone" version))
+       (sha256
+        (base32 "0j5zjvrshn7smq6cgbh7l66dl64wqs18cfyfnq1np1y00g320pha"))))
+    (build-system python-build-system)
+    (arguments
+     ;; Broken tests or cyclic dependecies with other packages.
+     '(#:phases (modify-phases %standard-phases
+                  (delete 'sanity-check))
+       #:tests? #f))
+    (propagated-inputs (list python-icalendar python-pytz))
+    (home-page "https://github.com/niccokunzmann/x-wr-timezone")
+    (synopsis "Handling of non-standard X-WR-TIMEZONE icalendar property")
+    (description
+     "Some calendar providers introduce the non-standard X-WR-TIMEZONE
+parameter to ICS calendar files.  Strict interpretations according to RFC 5545 ignore
+ the X-WR-TIMEZONE parameter.  This causes the times of the events to differ from those
+ which make use of X-WR-TIMEZONE.  This module aims to bridge the gap by converting
+ calendars using X-WR-TIMEZONE to a strict RFC 5545 calendars.")
+    (license license:lgpl3+)))
+
 (define-public python-icalendar
   (package
     (name "python-icalendar")
-- 
2.41.0


^ permalink raw reply related	[relevance 79%]

* [bug#69884] [PATCH] gnu: Add python-recurring-ical-events.
@ 2024-03-18 22:51 63% Benjamin Slade
  0 siblings, 0 replies; 200+ results
From: Benjamin Slade @ 2024-03-18 22:51 UTC (permalink / raw)
  To: 69884

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-python-recurring-ical-events.patch --]
[-- Type: text/x-patch, Size: 1838 bytes --]

From f7ea1140bb2937dd2d41f858ca8a39cd4b423e76 Mon Sep 17 00:00:00 2001
From: Benjamin Slade <slade@lambda-y.net>
Date: Mon, 18 Mar 2024 17:50:14 -0500
Subject: [PATCH] gnu: Add python-recurring-ical-events.

* gnu/packages/python-xyz.scm (python-recurring-ical-events): New variable
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 17ce6ef..1f3272e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17623,6 +17623,32 @@ (define-public python-execnet
       (home-page "https://codespeak.net/execnet/")
       (license license:expat))))
 
+(define-public python-recurring-ical-events
+  (package
+    (name "python-recurring-ical-events")
+    (version "2.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "recurring_ical_events" version))
+       (sha256
+        (base32 "00k4l800j2d3zfqhxjlzjk0b6493wqhmg4r58xsp12sx2ia2sxla"))))
+    (build-system python-build-system)
+    (arguments
+     ;; Broken tests or cyclic dependecies with other packages.
+     '(#:phases (modify-phases %standard-phases
+                  (delete 'sanity-check))
+       #:tests? #f))
+    (propagated-inputs (list python-x-wr-timezone python-icalendar python-pytz))
+    (home-page "https://github.com/niccokunzmann/python-recurring-ical-events")
+    (synopsis
+     "Python library for recurrence of ical events based on icalendar")
+    (description
+     "ICal has some complexity to it: Events, TODOs and Journal entries can
+ be repeated, removed from the feed and edited later on.
+This tool takes care of these circumstances.")
+    (license license:lgpl3+)))
+
 (define-public python-x-wr-timezone
   (package
     (name "python-x-wr-timezone")
-- 
2.41.0


^ permalink raw reply related	[relevance 63%]

* [bug#60238] [PATCH v3 6/7] gnu: Add python-cheroot.
    2024-03-17 17:08 59% ` [bug#60238] [PATCH v3 4/7] gnu: Add python-markdown2 Sharlatan Hellseher
  2024-03-17 17:08 64% ` [bug#60238] [PATCH v3 5/7] gnu: Add python-pypytools Sharlatan Hellseher
@ 2024-03-17 17:08 59% ` Sharlatan Hellseher
  2 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-17 17:08 UTC (permalink / raw)
  To: 60238
  Cc: Sharlatan Hellseher, dan, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

From: dan <i@dan.games>

* gnu/packages/python-web.scm (python-cheroot): New variable.

Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-web.scm | 57 +++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index c2bdfc8da8..f14c0a7bde 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -58,6 +58,7 @@
 ;;; Copyright © 2022 msimonin <matthieu.simonin@inria.fr>
 ;;; Copyright © 2022 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2022 Baptiste Strazzulla <bstrazzull@hotmail.fr>
+;;; Copyright © 2023 dan <i@dan.games>
 ;;; Copyright © 2023 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net>
 ;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com>
@@ -1279,6 +1280,62 @@ (define-public python-httplib2
 other HTTP libraries.")
     (license license:expat)))
 
+(define-public python-cheroot
+  (package
+    (name "python-cheroot")
+    (version "10.0.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cheroot" version))
+       (sha256
+        (base32
+         "1w0ind0dza9j1py56y23344piqkpyfmcm060qfrnk6gggy3s3i2r"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      #~(list "--cov=cheroot"
+              ;; Tests a flaky in parallel invocation.
+              ;; "--numprocesses=auto"
+              "--doctest-modules"
+              "--showlocals"
+              ;; Disable test requiring networking.
+              "-k" "not test_tls_client_auth")
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'check
+            (lambda* (#:key tests? test-flags #:allow-other-keys)
+              (when tests?
+                (with-directory-excursion "/tmp"
+                  (apply invoke "pytest" "-v"
+                         (append test-flags (list #$output))))))))))
+    (propagated-inputs
+     (list python-jaraco-functools
+           python-more-itertools
+           python-six))
+    (native-inputs
+     (list python-cryptography
+           python-jaraco-text
+           python-portend
+           python-pyopenssl
+           python-pypytools
+           python-pytest
+           python-pytest-cov
+           python-pytest-mock
+           python-pytest-xdist
+           python-requests
+           python-requests-toolbelt
+           python-requests-unixsocket
+           python-setuptools-scm
+           python-setuptools-scm-git-archive
+           python-trustme))
+    (home-page "https://cheroot.cherrypy.dev")
+    (synopsis "Highly-optimized, pure-python HTTP server")
+    (description
+     "Cheroot is a high-performance, pure-Python HTTP server.")
+    (license license:bsd-3)))
+
 (define-public httpie
   (package
     (name "httpie")
-- 
2.41.0





^ permalink raw reply related	[relevance 59%]

* [bug#60238] [PATCH v3 5/7] gnu: Add python-pypytools.
    2024-03-17 17:08 59% ` [bug#60238] [PATCH v3 4/7] gnu: Add python-markdown2 Sharlatan Hellseher
@ 2024-03-17 17:08 64% ` Sharlatan Hellseher
  2024-03-17 17:08 59% ` [bug#60238] [PATCH v3 6/7] gnu: Add python-cheroot Sharlatan Hellseher
  2 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-17 17:08 UTC (permalink / raw)
  To: 60238
  Cc: Sharlatan Hellseher, dan, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

From: dan <i@dan.games>

* gnu/packages/python-xyz.scm (python-pypytools): New variable.

Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-xyz.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0e458fdadc..c4a5375839 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11433,6 +11433,27 @@ (define-public python-jaraco-text
 processing, values parsing, case insensitive comparison, and more.")
     (license license:expat)))
 
+(define-public python-pypytools
+  (package
+    (name "python-pypytools")
+    (version "0.6.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pypytools" version))
+       (sha256
+        (base32 "0ag5xyzagprji0m2pkqsfy8539s003mn41pl6plbmh6iwi9w0h51"))))
+    (build-system python-build-system)
+    (arguments (list #:tests? #f)) ; no tests
+    (propagated-inputs (list python-py))
+    (home-page "https://github.com/antocuni/pypytools/")
+    (synopsis
+     "Tools to use PyPy-specific features, with CPython fallbacks")
+    (description
+     "This package provides a collection of useful tools to use PyPy-specific
+features, with CPython fallbacks.")
+    (license license:x11)))
+
 (define-public python-simplegeneric
   (package
     (name "python-simplegeneric")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#60238] [PATCH v3 4/7] gnu: Add python-markdown2.
  @ 2024-03-17 17:08 59% ` Sharlatan Hellseher
  2024-03-17 17:08 64% ` [bug#60238] [PATCH v3 5/7] gnu: Add python-pypytools Sharlatan Hellseher
  2024-03-17 17:08 59% ` [bug#60238] [PATCH v3 6/7] gnu: Add python-cheroot Sharlatan Hellseher
  2 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-17 17:08 UTC (permalink / raw)
  To: 60238
  Cc: Sharlatan Hellseher, dan, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

From: dan <i@dan.games>

* gnu/packages/python-xyz.scm (python-markdown2): New variable.

Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7ed8c945be..0e458fdadc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -136,6 +136,7 @@
 ;;; Copyright © 2023 Amade Nemes <nemesamade@gmail.com>
 ;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
 ;;; Copyright © 2023 Kaelyn Takata <kaelyn.alexi@protonmail.com>
+;;; Copyright © 2023 dan <i@dan.games>
 ;;; Copyright © 2023 Dominik Delgado Steuter <d@delgado.nrw>
 ;;; Copyright © 2023 Ivan Vilata-i-Balaguer <ivan@selidor.net>
 ;;; Copyright © 2023 Ontje Lünsdorf <ontje.luensdorf@dlr.de>
@@ -14245,6 +14246,41 @@ (define-public python-markdown
 markdown_py is also provided to convert Markdown files to HTML.")
     (license license:bsd-3)))
 
+(define-public python-markdown2
+  (package
+    (name "python-markdown2")
+    (version "2.4.13")
+    (source
+     (origin
+       (method git-fetch) ; no tests data in PyPi package
+       (uri (git-reference
+             (url "https://github.com/trentm/python-markdown2")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0m1wy8i4xmna5b97dvks8cfjmc1wid8pxmd2h82869d0ajva3r6a"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'check
+            (lambda* (#:key tests? test-flags #:allow-other-keys)
+              (when tests?
+                (with-directory-excursion "test"
+                  (invoke "python" "testall.py"))))))))
+    (native-inputs
+     (list python-pygments))
+    (home-page "https://github.com/trentm/python-markdown2")
+    (synopsis "Fast and complete Python implementation of Markdown")
+    (description
+     "This package provides a fast and complete Python implementation of
+Markdown.  It was written to closely match the behaviour of the original
+Perl-implemented Markdown.pl.  It also comes with a number of
+extensions (called @code{extras}) for things like syntax coloring, tables,
+header-ids.")
+    (license license:expat)))
+
 (define-public python-mdx-include
   (package
     (name "python-mdx-include")
-- 
2.41.0





^ permalink raw reply related	[relevance 59%]

* [bug#69486] [PATCH v2] gnu: Add python-pypugjs.
  2024-03-01  9:22 61% [bug#69486] [PATCH] gnu: Add python-pypugjs Tanguy Le Carrour
@ 2024-03-17 16:32 60% ` Tanguy Le Carrour
  2024-03-19 16:18 65%   ` bug#69486: " Ludovic Courtès
  0 siblings, 1 reply; 200+ results
From: Tanguy Le Carrour @ 2024-03-17 16:32 UTC (permalink / raw)
  To: 69486
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, Tanguy Le Carrour, jgart

Hi Guix,

V2 fixes problems reported by QA: `python-pip` and `python-setuptools`
should not be part of the inputs.

Tanguy

* gnu/packages/python-xyz.scm (python-pypugjs): New variable.

Change-Id: I050ab42d0149fcffddcf6b12dd9c1ddea23f84c9
Signed-off-by: Tanguy Le Carrour <tanguy@bioneland.org>
---
 gnu/packages/python-xyz.scm | 46 +++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 232b5d6999..e314ba9fab 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6056,6 +6056,52 @@ (define-public python-jinja2-time
 templates.  A format string can be provided to control the output.")
     (license license:expat)))
 
+(define-public python-pypugjs
+  (package
+    (name "python-pypugjs")
+    (version "5.9.12")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/kakulukia/pypugjs")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0zj7a560h973cl7brfw1nmyhgm8rp8j80wnih0shvhmw4ql23lpa"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   ;; Our pyramid is outdated and pyramid-mako is not packaged.
+                   (add-after 'unpack 'disable-pyramid
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "setup.py"
+                         (("'pyramid")
+                          "#'pyramid"))))
+                   (replace 'check
+                     (lambda* (#:key tests? #:allow-other-keys)
+                       (when tests?
+                         (invoke "python" "-m" "pytest" "-v"
+                                 "pypugjs/testsuite/")))))))
+    (native-inputs (list python-coverage
+                         python-django
+                         python-jinja2
+                         python-flake8
+                         python-flask
+                         python-mako
+                         python-nose
+                         python-poetry-core
+                         python-pytest
+                         python-tornado-6
+                         python-wheel))
+    (propagated-inputs (list python-charset-normalizer python-six))
+    (home-page "https://github.com/kakulukia/pypugjs")
+    (synopsis "Convert Pug source files into different template languages")
+    (description
+     "PugJS syntax template adapter for Django, Jinja2, Mako and Tornado templates.")
+    (license license:expat))) ;; MIT
+
 (define-public python-pysdl2
   (package
     (name "python-pysdl2")

base-commit: 93aefca7bab5f5b40164176e3224221d26d708f1
-- 
2.41.0





^ permalink raw reply related	[relevance 60%]

* [bug#69817] [PATCH] gnu: Add python-pynsee.
@ 2024-03-15 19:12 62% Nicolas Graves via Guix-patches via
  2024-04-16 12:34 62% ` [bug#69817] [PATCH v2] " Nicolas Graves via Guix-patches via
  0 siblings, 1 reply; 200+ results
From: Nicolas Graves via Guix-patches via @ 2024-03-15 19:12 UTC (permalink / raw)
  To: 69817; +Cc: ngraves

* gnu/packages/python-science.scm (python-pynsee): New variable.

Change-Id: I4e93d26ad4b6be238b0e4cce82ea77030caf6e02
---
 gnu/packages/python-science.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index b6a116f16b..48155fbbd8 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -23,6 +23,7 @@
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -2641,6 +2642,37 @@ (define-public python-pynrrd
 and from numpy arrays.")
     (license license:expat)))
 
+(define-public python-pynsee
+  (package
+    (name "python-pynsee")
+    (version "0.1.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pynsee" version))
+       (sha256
+        (base32 "0wd1xhkjpll8mzrrhnqxrand32p338j2zfw3h1gxacf31iwxhips"))))
+    (build-system pyproject-build-system)
+    (arguments (list #:tests? #f))  ; XXX: Tests require network access.
+    (propagated-inputs (list python-appdirs
+                             python-pandas
+                             python-requests
+                             python-shapely
+                             python-tqdm
+                             python-unidecode
+                             python-urllib3))
+    (home-page "https://pynsee.readthedocs.io")
+    (synopsis
+     "Tools to Easily Search and Download French Data From INSEE and IGN APIs")
+    (description
+     "This package provides tools to easily search and download French data
+from INSEE and IGN APIs.  This data includes more than 150 000 macroeconomic
+series, a dozen datasets of local french data, numerous sources available on
+@url{insee.fr}, geographical limits of administrative areas taken from IGN as
+well as key metadata and SIRENE database containing data on all French
+compagnies.")
+    (license license:expat)))
+
 (define-public python-libneuroml
   (package
     (name "python-libneuroml")
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#69794] [PATCH 1/2] gnu: Add python-sacremoses.
  @ 2024-03-14  8:32 61% ` guix-patches--- via
  0 siblings, 0 replies; 200+ results
From: guix-patches--- via @ 2024-03-14  8:32 UTC (permalink / raw)
  To: 69794
  Cc: Nguyễn Gia Phong, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-sacremoses): New variable.

Change-Id: I2c2cd94c054d7e952ffb4b3afdedd2ee8ce905bf
---
 gnu/packages/python-xyz.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 232b5d69993c..ad33d98db142 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -149,6 +149,7 @@
 ;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
 ;;; Copyright © 2024 Ian Eure <ian@retrospec.tv>
 ;;; Copyright © 2024 Adriel Dumas--Jondeau <leirda@disroot.org>
+;;; Copyright © 2024 Nguyễn Gia Phong <mcsinyx@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21897,6 +21898,39 @@ (define-public python-nltk
      reasoning, wrappers for natural language processing libraries.")
     (license license:asl2.0)))
 
+(define-public python-sacremoses
+  (package
+    (name "python-sacremoses")
+    (version "0.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://github.com/hplt-project/sacremoses")
+                     (commit version)))
+              (sha256
+                (base32
+                  "0g70vchfniknp65n4wnx7chg6g49d4xrz1wagv7f7ir2swdzyn9b"))))
+    (build-system python-build-system)
+    (arguments
+      '(#:phases
+         (modify-phases %standard-phases
+           (replace 'check
+             (lambda* (#:key tests? #:allow-other-keys)
+               (when tests?
+                 ;; Skip truecaser tests which fetch https://norvig.com/big.txt
+                 (invoke "python" "-m" "unittest"
+                         "sacremoses/test/test_corpus.py"
+                         "sacremoses/test/test_no_redos_has_numeric_only.py"
+                         "sacremoses/test/test_normalizer.py"
+                         "sacremoses/test/test_tokenizer.py")))))))
+    (propagated-inputs
+      (list python-click-7 python-joblib python-regex python-tqdm))
+    (home-page "https://github.com/hplt-project/sacremoses")
+    (synopsis "Natural language tokenizer, truecaser and normalizer")
+    (description "SacreMoses is a Python port of Moses'
+tokenizer, detokenizer, truecaser and punctuation normalizer.")
+    (license license:expat)))
+
 (define-public python-pymongo
   (package
     (name "python-pymongo")
-- 
2.41.0





^ permalink raw reply related	[relevance 61%]

* [bug#69765] [PATCH 3/4] gnu: python-web: Update python-s3transfer to 0.10.0.
@ 2024-03-13  1:11 65% Daniel Ziltener via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Daniel Ziltener via Guix-patches via @ 2024-03-13  1:11 UTC (permalink / raw)
  To: 69765; +Cc: dziltener

---
 gnu/packages/python-web.scm | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 6b61ba10b3..a3de510394 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -4345,23 +4345,18 @@ (define-public python-betamax-serializers
 (define-public python-s3transfer
   (package
     (name "python-s3transfer")
-    (version "0.5.0")
+    (version "0.10.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "s3transfer" version))
               (sha256
                (base32
-                "0k6sc956yrrv9b4laa0r79jhxajpyxr21jcd1ka8m1n53lz85vah"))))
-    (build-system python-build-system)
+                "0nsr664ci9bqysmiqrigv03kz5idjwxy4ibrwpjbpvnmfbvbpj6h"))))
+    (build-system pyproject-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               ;; Some of the 'integration' tests require network access or
-               ;; login credentials.
-               (invoke "nosetests" "--exclude=integration")))))))
+         (delete 'check))))
     (native-inputs
      (list python-docutils python-mock python-nose))
     (propagated-inputs
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69769] [PATCH 1/4] gnu: python-xyz: Update python-botocore to 1.34.61.
@ 2024-03-13  1:09 65% Daniel Ziltener via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Daniel Ziltener via Guix-patches via @ 2024-03-13  1:09 UTC (permalink / raw)
  To: 69769; +Cc: dziltener

---
 gnu/packages/python-xyz.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0c72caeca0..95010eca23 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18293,15 +18293,15 @@ (define-public python-botocore
   ;; are compatible.
   (package
     (name "python-botocore")
-    (version "1.24.35")
+    (version "1.34.61")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "botocore" version))
        (sha256
         (base32
-         "0rv8mvhq5s373zdjs2yb45hzvqcqdh2lp2rbb21jjc8ciwnl5d9n"))))
-    (build-system python-build-system)
+         "0d3h7phvlbri3dqjkn6q9jzgg6xywis8rm42r192afg6wkvlmpvj"))))
+    (build-system pyproject-build-system)
     (arguments
      ;; FIXME: Many tests are failing.
      '(#:tests? #f))
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69768] [PATCH 4/4] gnu: python-web: Update awscli to 1.32.61.
@ 2024-03-13  1:12 65% Daniel Ziltener via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Daniel Ziltener via Guix-patches via @ 2024-03-13  1:12 UTC (permalink / raw)
  To: 69768; +Cc: dziltener

---
 gnu/packages/python-web.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index a3de510394..bfd0a6a1e7 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -3763,15 +3763,15 @@ (define-public awscli
   (package
     ;; Note: updating awscli typically requires updating botocore as well.
     (name "awscli")
-    (version "1.22.90")
+    (version "1.32.61")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri name version))
        (sha256
         (base32
-         "0ky4ax4xh7s8w1l0hwc7w9ii8afvh9nib3kz09qhiqdinxzrlv54"))))
-    (build-system python-build-system)
+         "1xms4yd07i8869jk7kmd0p80fj7qnf18kip3kmxwalnqygpwsqfw"))))
+    (build-system pyproject-build-system)
     (arguments
      ;; FIXME: The 'pypi' release does not contain tests.
      '(#:tests? #f
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69766] [PATCH 2/4] gnu: python-xyz: Update python-boto3 to 1.34.61.
@ 2024-03-13  1:10 65% Daniel Ziltener via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Daniel Ziltener via Guix-patches via @ 2024-03-13  1:10 UTC (permalink / raw)
  To: 69766; +Cc: dziltener

---
 gnu/packages/python-xyz.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 95010eca23..b4caca34a0 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -18316,7 +18316,7 @@ (define-public python-botocore
 (define-public python-boto3
   (package
     (name "python-boto3")
-    (version "1.21.35")
+    (version "1.34.61")
     (home-page "https://github.com/boto/boto3")
     (source (origin
               (method git-fetch)
@@ -18324,7 +18324,7 @@ (define-public python-boto3
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "1kdyf238rpfldnpzs0rdh3nhjn6hwfym4faskyhzlgzkf1smmbg1"))))
+                "1nbq2rly56gia2z2zh57qwpafsj2w3258gz4k6z494bws0fb99nb"))))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
@@ -18336,7 +18336,7 @@ (define-public python-boto3
            (lambda* (#:key tests? #:allow-other-keys)
              (when tests?
                (invoke "pytest" "-v")))))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (native-inputs
      (list python-nose python-mock python-pytest))
     (propagated-inputs
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69764] [PATCH] gnu: python-build: Update python-wheel to 0.43.0.
@ 2024-03-12 23:47 65% Daniel Ziltener via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Daniel Ziltener via Guix-patches via @ 2024-03-12 23:47 UTC (permalink / raw)
  To: 69764; +Cc: dziltener

---
 gnu/packages/python-build.scm | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 2ea457cdba..863ed7373a 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -331,20 +331,17 @@ (define-public python-setuptools-57
 (define-public python-wheel
   (package
     (name "python-wheel")
-    (version "0.40.0")
+    (version "0.43.0")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "wheel" version))
         (sha256
          (base32
-          "0ww8fgkvwv35ypj4cnngczdwp6agr4qifvk2inb32azfzbrrc4fd"))))
-    (build-system python-build-system)
-    (arguments
-     ;; FIXME: The test suite runs "python setup.py bdist_wheel", which in turn
-     ;; fails to find the newly-built bdist_wheel library, even though it is
-     ;; available on PYTHONPATH.  What search path is consulted by setup.py?
-     '(#:tests? #f))
+          "118x5y37152by7f8gvzwda441jd8b42w92ngs6i5sp7sd4ngjpj6"))))
+    (build-system pyproject-build-system)
+    (native-inputs
+     (list python-flit-core))
     (home-page "https://github.com/pypa/wheel")
     (synopsis "Format for built Python packages")
     (description
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69763] [PATCH] gnu: python-build: Update python-pypa-build to 1.1.1.
@ 2024-03-12 23:40 63% Daniel Ziltener via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Daniel Ziltener via Guix-patches via @ 2024-03-12 23:40 UTC (permalink / raw)
  To: 69763; +Cc: dziltener

---
 gnu/packages/python-build.scm | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 2ea457cdba..a381f6fcd0 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -464,27 +464,21 @@ (define-public python-packaging-bootstrap
 (define-public python-pypa-build
   (package
     (name "python-pypa-build")
-    (version "0.7.0")
+    (version "1.1.1")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "build" version))
               (sha256
                (base32
-                "17xqija27x4my1yrnk6q2vwln60r39g2dhby9zg2l99qjgbdrahs"))))
-    (build-system python-build-system)
+                "0c9a7nalcyryxp85nf8sj2bpvnd6sgdchb5s6kkw5ami8nxnbslf"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(#:tests? #f                      ;to tests in the PyPI release
-       #:phases (modify-phases %standard-phases
-                  (add-after 'unpack 'use-toml-instead-of-tomli
-                    ;; Using toml instead of tomli eases bootstrapping.
-                    (lambda _
-                      (substitute* "setup.cfg"
-                        (("tomli>=.*")
-                         "toml\n")))))))
+     `(#:tests? #f))                    ;to tests in the PyPI release
+    (native-inputs
+     (list python-flit-core))
     (propagated-inputs
-     `(("python-packaging" ,python-packaging-bootstrap)
-       ("python-pep517", python-pep517-bootstrap)
-       ("python-toml" ,python-toml)))
+     `(("python-pyproject-hooks" ,python-pyproject-hooks)
+       ("python-packaging" ,python-packaging-bootstrap)))
     (home-page "https://pypa-build.readthedocs.io/en/latest/")
     (synopsis "Simple Python PEP 517 package builder")
     (description "The @command{build} command invokes the PEP 517 hooks to
@@ -762,4 +756,3 @@ (define-public python-pdm-backend
      "PDM-Backend is a build backend that supports the latest packaging
 standards, which includes PEP 517, PEP 621 and PEP 660.")
     (license license:expat)))
-
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#69591] [PATCH v2 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch.
                     ` (6 preceding siblings ...)
  2024-03-12 22:51 48% ` [bug#69591] [PATCH v2 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
@ 2024-03-12 22:51 42% ` David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-12 22:51 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/machine-learning.scm (%python-pytorch-for-r-torch-src): Add
patches.
(python-pytorch-for-r-torch)[version]: Use
%python-pytorch-for-r-torch-version.
[source]: Use %python-pytorch-for-r-torch-src.
[native-inputs]: Use 'modify-inputs'.
[inputs]: Don't replace xnnpack. Replace qnnpack-pytorch with
qnnpack-pytorch-for-r-torch and oneapi-dnnl with oneapi-dnnl-for-r-torch.
[propagated-inputs]: Don't replace onnx and onnx-optimizer.
[supported-systems]: New field.
* gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen: New file.
* gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch: New file.
* gnu/packages/patches/python-pytorch2-system-libraries.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                  |   1 -
 gnu/packages/machine-learning.scm             |  61 +--
 ...thon-pytorch-for-r-torch-fix-codegen.patch | 167 ++++++++
 ...pytorch-for-r-torch-system-libraries.patch | 399 ++++++++++++++++++
 .../python-pytorch2-system-libraries.patch    | 156 -------
 5 files changed, 585 insertions(+), 199 deletions(-)
 create mode 100644 gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
 create mode 100644 gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
 delete mode 100644 gnu/packages/patches/python-pytorch2-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c0b9b3a150..19d71d1b41 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1812,7 +1812,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyreadstat-link-libiconv.patch	\
   %D%/packages/patches/python-pyls-black-41.patch		\
   %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch	\
-  %D%/packages/patches/python-pytorch2-system-libraries.patch	\
   %D%/packages/patches/python-sip-include-dirs.patch	\
   %D%/packages/patches/python-sgmllib3k-assertions.patch	\
   %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch	\
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 4a8aa13d50..213260d0b5 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4707,7 +4707,15 @@ (define %python-pytorch-for-r-torch-src
                               %python-pytorch-for-r-torch-version))
     (sha256
      (base32
-      "0iirrn687i7sfv0p0i7dn89x3rf13a7l8y1y5h190h51yjxpxqxa"))))
+      "0iirrn687i7sfv0p0i7dn89x3rf13a7l8y1y5h190h51yjxpxqxa"))
+    (patches (search-patches
+              "python-pytorch-for-r-torch-system-libraries.patch"
+              "python-pytorch-runpath.patch"
+              "python-pytorch-without-kineto.patch"
+              ;; Some autogeneration scripts depend on the
+              ;; compile PyTorch library. Therefore, we create
+              ;; dummy versions which are regenerated later.
+              "python-pytorch-for-r-torch-fix-codegen.patch"))))
 
 (define-public qnnpack-pytorch-for-r-torch
   (package
@@ -4723,59 +4731,28 @@ (define-public qnnpack-pytorch-for-r-torch
        (snippet
         (origin-snippet (package-source qnnpack-pytorch)))))))
 
+;; Keep in sync with r-torch
 (define-public python-pytorch-for-r-torch
   (package
     (inherit python-pytorch)
     (name "python-pytorch")
-    (version "2.0.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "14m7v54zyd2qg2xk9mqdpbf4ps7091mdzinzh4vq9p5k4bpznj65"))
-              (patches (search-patches "python-pytorch2-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-enum" "python-peachpy"
-                              "python-six" "tbb" "XNNPACK" "zstd"))
-                  (substitute* "caffe2/CMakeLists.txt"
-                    (("target_link_libraries\\(\\$\\{test_name\\}_\\$\\{CPU_CAPABILITY\\} c10 sleef gtest_main\\)")
-                     "target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest gtest_main)"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
+    (version %python-pytorch-for-r-torch-version)
+    (source %python-pytorch-for-r-torch-src)
+    (native-inputs
+     (modify-inputs (package-native-inputs python-pytorch)
+       (replace "ideep-pytorch" ideep-pytorch-for-r-torch)))
     (inputs
      (modify-inputs (package-inputs python-pytorch)
-       (replace "xnnpack" xnnpack-for-torch2)))
+       (replace "qnnpack-pytorch" qnnpack-pytorch-for-r-torch)
+       (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch)))
     (propagated-inputs
      (modify-inputs (package-propagated-inputs python-pytorch)
        (append python-filelock
                python-jinja2
                python-networkx
                python-opt-einsum
-               python-sympy)
-       (replace "onnx" onnx-for-torch2)
-       (replace "onnx-optimizer" onnx-optimizer-for-torch2)))))
+               python-sympy)))
+    (supported-systems %64bit-supported-systems)))
 
 (define-public python-pytorch-geometric
   (package
diff --git a/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
new file mode 100644
index 0000000000..8515e5ab13
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
@@ -0,0 +1,167 @@
+This patch fixes some scripts for generating source files.  For
+gen_jit_decompositions.py, gen_mobile_upgraders.py and
+gen_jit_shape_functions.py, which depend on the compiled PyTorch library, the
+option to generate "dummy" source files is added for the initial build, which
+is later corrected.  codegen_external.py is patched to avoid duplicate
+functions and add the static keyword as in the existing generated file.
+
+diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
+index cc0263dbbf..ac34e84b82 100644
+--- a/tools/gen_flatbuffers.sh
++++ b/tools/gen_flatbuffers.sh
+@@ -1,13 +1,13 @@
+ #!/bin/bash
+ ROOT=$(pwd)
+-FF_LOCATION="$ROOT/third_party/flatbuffers"
+-cd "$FF_LOCATION" || exit
+-mkdir build
+-cd build || exit
+-cmake ..
+-cmake --build . --target flatc
+-mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
+-./flatc --cpp --gen-mutable --scoped-enums \
++#FF_LOCATION="$ROOT/third_party/flatbuffers"
++#cd "$FF_LOCATION" || exit
++#mkdir build
++#cd build || exit
++#cmake ..
++#cmake --build . --target flatc
++#mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
++flatc --cpp --gen-mutable --scoped-enums \
+      -o "$ROOT/torch/csrc/jit/serialization" \
+      -c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
+ echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
+diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
+index 120520b139..0c8587f02d 100644
+--- a/torch/csrc/jit/tensorexpr/codegen_external.py
++++ b/torch/csrc/jit/tensorexpr/codegen_external.py
+@@ -16,9 +16,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+     native_functions = parse_native_yaml(native_functions_path, tags_path)
+     func_decls = []
+     func_registrations = []
+-    for func in native_functions:
++    done_names = set()
++    for func in native_functions[0]:
+         schema = func.func
+         name = schema.name.name.base
++        if name in done_names:
++            continue
++        else:
++            done_names.add(name)
+         args = schema.arguments
+         # Only supports extern calls for functions with out variants
+         if not schema.is_out_fn():
+@@ -48,7 +53,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+ 
+         # print(tensor_decls, name, arg_names)
+         func_decl = f"""\
+-void nnc_aten_{name}(
++static void nnc_aten_{name}(
+     int64_t bufs_num,
+     void** buf_data,
+     int64_t* buf_ranks,
+diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
+index 7cfbb803f9..2e69bb1868 100644
+--- a/torchgen/decompositions/gen_jit_decompositions.py
++++ b/torchgen/decompositions/gen_jit_decompositions.py
+@@ -1,8 +1,12 @@
+ #!/usr/bin/env python3
+ import os
+ from pathlib import Path
++import sys
+ 
+-from torch.jit._decompositions import decomposition_table
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    from torch.jit._decompositions import decomposition_table
++else:
++    decomposition_table = {}
+ 
+ # from torchgen.code_template import CodeTemplate
+ 
+@@ -85,7 +89,7 @@ def write_decomposition_util_file(path: str) -> None:
+ 
+ 
+ def main() -> None:
+-    pytorch_dir = Path(__file__).resolve().parents[3]
++    pytorch_dir = Path(__file__).resolve().parents[2]
+     upgrader_path = pytorch_dir / "torch" / "csrc" / "jit" / "runtime"
+     write_decomposition_util_file(str(upgrader_path))
+ 
+diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
+index e5287cffc5..57f3c38096 100644
+--- a/torchgen/operator_versions/gen_mobile_upgraders.py
++++ b/torchgen/operator_versions/gen_mobile_upgraders.py
+@@ -2,10 +2,12 @@
+ import os
+ from enum import Enum
+ from pathlib import Path
++import sys
+ from typing import Any, Dict, List
+ 
+-import torch
+-from torch.jit.generate_bytecode import generate_upgraders_bytecode
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    import torch
++    from torch.jit.generate_bytecode import generate_upgraders_bytecode
+ 
+ from torchgen.code_template import CodeTemplate
+ from torchgen.operator_versions.gen_mobile_upgraders_constant import (
+@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+ def construct_version_maps(
+     upgrader_bytecode_function_to_index_map: Dict[str, Any]
+ ) -> str:
+-    version_map = torch._C._get_operator_version_map()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        version_map = torch._C._get_operator_version_map()
++    else:
++        version_map = {}
+     sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0])  # type: ignore[no-any-return]
+     sorted_version_map = {name: lst for name, lst in sorted_version_map_}
+ 
+@@ -379,7 +384,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ 
+ def main() -> None:
+ 
+-    upgrader_list = generate_upgraders_bytecode()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        upgrader_list = generate_upgraders_bytecode()
++    else:
++        upgrader_list = []
+     sorted_upgrader_list = sort_upgrader(upgrader_list)
+     for up in sorted_upgrader_list:
+         print("after sort upgrader : ", next(iter(up)))
+diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
+index c6336a6951..34e394d818 100644
+--- a/torchgen/shape_functions/gen_jit_shape_functions.py
++++ b/torchgen/shape_functions/gen_jit_shape_functions.py
+@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
+ if not file_path.exists():
+     raise Exception(err_msg)
+ 
+-spec = importlib.util.spec_from_file_location(module_name, file_path)
+-assert spec is not None
+-module = importlib.util.module_from_spec(spec)
+-sys.modules[module_name] = module
+-assert spec.loader is not None
+-assert module is not None
+-spec.loader.exec_module(module)
+-
+-bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
+-shape_compute_graph_mapping = module.shape_compute_graph_mapping
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    spec = importlib.util.spec_from_file_location(module_name, file_path)
++    assert spec is not None
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[module_name] = module
++    assert spec.loader is not None
++    assert module is not None
++    spec.loader.exec_module(module)
++
++    bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
++    shape_compute_graph_mapping = module.shape_compute_graph_mapping
++else:
++    bounded_compute_graph_mapping = {}
++    shape_compute_graph_mapping = {}
+ 
+ 
+ SHAPE_HEADER = r"""
diff --git a/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch b/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
new file mode 100644
index 0000000000..e5d647f70d
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
@@ -0,0 +1,399 @@
+Patch build files to also system libraries instead of bundled ones for the
+libraries not supported or working only by specifying USE_SYSTEM_LIBS.  This
+includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
+ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
+For QNNPACK, two versions were bundled and are required: The upstream one and
+an internal fork (now in the package qnnpack-pytorch).
+
+diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
+index 96fc297..7f27b66 100644
+--- a/aten/src/ATen/CMakeLists.txt
++++ b/aten/src/ATen/CMakeLists.txt
+@@ -362,9 +362,9 @@ if(AT_NNPACK_ENABLED)
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
+ endif()
+ 
+-if(MKLDNN_FOUND)
+-  list(APPEND ATen_CPU_DEPENDENCY_LIBS ${MKLDNN_LIBRARIES})
+-endif(MKLDNN_FOUND)
++if(USE_MKLDNN)
++  list(APPEND ATen_CPU_DEPENDENCY_LIBS DNNL::dnnl)
++endif(USE_MKLDNN)
+ 
+ list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
+ 
+diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
+index 221e3f3..417f601 100644
+--- a/caffe2/CMakeLists.txt
++++ b/caffe2/CMakeLists.txt
+@@ -110,9 +110,6 @@ if(NOT MSVC AND USE_XNNPACK)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+-    add_subdirectory(
+-      "${FXDIV_SOURCE_DIR}"
+-      "${CMAKE_BINARY_DIR}/FXdiv")
+   endif()
+ endif()
+ 
+@@ -975,7 +972,6 @@ elseif(USE_CUDA)
+ endif()
+ 
+ if(NOT MSVC AND USE_XNNPACK)
+-  TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 
+ # ==========================================================
+@@ -1314,6 +1310,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+ target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
++target_link_libraries(torch_cpu PRIVATE miniz clog)
+ target_include_directories(torch_cpu INTERFACE $<INSTALL_INTERFACE:include>)
+ target_include_directories(torch_cpu PRIVATE ${Caffe2_CPU_INCLUDE})
+ target_include_directories(torch_cpu SYSTEM PRIVATE "${Caffe2_DEPENDENCY_INCLUDE}")
+@@ -1570,7 +1567,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
+   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
+   target_link_libraries(static_runtime_bench torch_library benchmark)
+-  target_link_libraries(static_runtime_test torch_library gtest_main)
++  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
+ endif()
+ 
+ if(BUILD_TENSOREXPR_BENCHMARK)
+@@ -1601,7 +1598,7 @@ if(BUILD_MOBILE_TEST)
+   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
+@@ -1622,13 +1619,13 @@ if(BUILD_TEST)
+         if(NOT MSVC)
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
+           # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
+           if(USE_FBGEMM)
+             target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
+           endif()
+         else()
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
+         endif()
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+@@ -1645,7 +1642,7 @@ if(BUILD_TEST)
+   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+@@ -1703,7 +1700,7 @@ if(BUILD_TEST)
+     foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
+       get_filename_component(test_name ${test_src} NAME_WE)
+       add_executable(${test_name} "${test_src}")
+-      target_link_libraries(${test_name} torch_library gtest_main)
++      target_link_libraries(${test_name} torch_library gtest_main gtest)
+       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
+diff --git a/caffe2/serialize/CMakeLists.txt b/caffe2/serialize/CMakeLists.txt
+index 1552b59..67e1a9a 100644
+--- a/caffe2/serialize/CMakeLists.txt
++++ b/caffe2/serialize/CMakeLists.txt
+@@ -2,7 +2,6 @@ file(GLOB tmp *_test.cc)
+ 
+ set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
+ list(APPEND Caffe2_CPU_SRCS
+-  ${PROJECT_SOURCE_DIR}/third_party/miniz-2.1.0/miniz.c
+   ${CMAKE_CURRENT_SOURCE_DIR}/inline_container.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/istream_adapter.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/file_adapter.cc
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index 8c0e3c2..d65576a 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -298,7 +298,7 @@ endif()
+ # --- [ PocketFFT
+ set(AT_POCKETFFT_ENABLED 0)
+ if(NOT AT_MKL_ENABLED)
+-  set(POCKETFFT_INCLUDE_DIR "${Torch_SOURCE_DIR}/third_party/pocketfft/")
++  set(POCKETFFT_INCLUDE_DIR "#POCKETFFT_INCLUDE_DIR")
+   if(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}")
+     message(FATAL_ERROR "pocketfft directory not found, expected ${POCKETFFT_INCLUDE_DIR}")
+   elif(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}/pocketfft_hdronly.h")
+@@ -501,19 +501,6 @@ if(USE_QNNPACK)
+     set(QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+     set(QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+     set(QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-    add_subdirectory(
+-      "${QNNPACK_SOURCE_DIR}"
+-      "${CONFU_DEPENDENCIES_BINARY_DIR}/QNNPACK")
+-
+-    # TODO: See https://github.com/pytorch/pytorch/issues/56285
+-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+-      target_compile_options(qnnpack PRIVATE -Wno-deprecated-declarations)
+-    endif()
+-
+-    # We build static versions of QNNPACK and pthreadpool but link
+-    # them into a shared library for Caffe2, so they need PIC.
+-    set_property(TARGET qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+     if(QNNPACK_CUSTOM_THREADPOOL)
+       target_compile_definitions(
+@@ -562,13 +549,6 @@ if(USE_PYTORCH_QNNPACK)
+       set(PYTORCH_QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-      add_subdirectory(
+-        "${PYTORCH_QNNPACK_SOURCE_DIR}"
+-        "${CONFU_DEPENDENCIES_BINARY_DIR}/pytorch_qnnpack")
+-      # We build static versions of QNNPACK and pthreadpool but link
+-      # them into a shared library for Caffe2, so they need PIC.
+-      set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-      set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+       if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
+         target_compile_definitions(
+@@ -750,11 +730,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+   # this shouldn't be necessary anymore.
+   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
+-  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
+-
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
+ 
+   # We will not need to test benchmark lib itself.
+   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
+@@ -829,16 +804,6 @@ if(USE_FBGEMM)
+     else()
+       set(FBGEMM_LIBRARY_TYPE "static" CACHE STRING "")
+     endif()
+-    add_subdirectory("${FBGEMM_SOURCE_DIR}")
+-    set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
+-      # See https://github.com/pytorch/pytorch/issues/74352
+-      target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
+-      target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
+-    endif()
+   endif()
+ 
+   if(USE_FBGEMM)
+@@ -1001,7 +966,7 @@ if(NOT TARGET fp16 AND NOT USE_SYSTEM_FP16)
+     "${FP16_SOURCE_DIR}"
+     "${CONFU_DEPENDENCIES_BINARY_DIR}/FP16")
+ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
+-  add_library(fp16 STATIC "/usr/include/fp16.h")
++  add_library(fp16 STATIC "#FP16_INCLUDE_DIR")
+   set_target_properties(fp16 PROPERTIES LINKER_LANGUAGE C)
+ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
+@@ -1395,7 +1360,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ 
+     # Tensorpipe uses cuda_add_library
+     torch_update_find_cuda_flags()
+-    add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
+ 
+     list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
+     if(USE_CUDA)
+@@ -1551,7 +1515,6 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+       set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
+     endif()
+   endif()
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+ 
+   add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+   if(NOT USE_SYSTEM_ONNX)
+@@ -1582,7 +1545,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+     endif()
+     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
+     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
+-    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
++    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
+   endif()
+   include_directories(${FOXI_INCLUDE_DIRS})
+   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
+@@ -1752,9 +1715,8 @@ if(NOT INTERN_BUILD_MOBILE)
+   endif()
+   if(USE_MKLDNN)
+     include(${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake)
+-    if(MKLDNN_FOUND)
++    if(DNNL_FOUND)
+       set(AT_MKLDNN_ENABLED 1)
+-      include_directories(AFTER SYSTEM ${MKLDNN_INCLUDE_DIR})
+       if(BUILD_CAFFE2_OPS)
+         list(APPEND Caffe2_DEPENDENCY_LIBS caffe2::mkldnn)
+       endif(BUILD_CAFFE2_OPS)
+@@ -1819,7 +1781,7 @@ endif()
+ #
+ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
+-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
++find_package(fmt)
+ 
+ # Disable compiler feature checks for `fmt`.
+ #
+@@ -1828,7 +1790,6 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
+ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
+ # `fmt` is compatible with a superset of the compilers that PyTorch is, it
+ # shouldn't be too bad to just disable the checks.
+-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "")
+ 
+ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
+ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
+diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
+index a41343c..6075bdd 100644
+--- a/cmake/External/nnpack.cmake
++++ b/cmake/External/nnpack.cmake
+@@ -40,7 +40,7 @@ endif()
+ # (3) Android, iOS, Linux, macOS - supported
+ ##############################################################################
+ 
+-if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
++if(FALSE)
+   message(STATUS "Brace yourself, we are building NNPACK")
+   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
+ 
+@@ -114,6 +114,5 @@ endif()
+ # (4) Catch-all: not supported.
+ ##############################################################################
+ 
+-message(WARNING "Unknown platform - I don't know how to build NNPACK. "
+-                "See cmake/External/nnpack.cmake for details.")
+-set(USE_NNPACK OFF)
++set(NNPACK_FOUND TRUE)
++set(USE_NNPACK ON)
+diff --git a/cmake/public/mkldnn.cmake b/cmake/public/mkldnn.cmake
+index 50404d3..ca067f0 100644
+--- a/cmake/public/mkldnn.cmake
++++ b/cmake/public/mkldnn.cmake
+@@ -4,7 +4,7 @@ if(CPU_AARCH64)
+   include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake)
+ endif()
+ 
+-find_package(MKLDNN QUIET)
++find_package(DNNL REQUIRED)
+ 
+ if(NOT TARGET caffe2::mkldnn)
+   add_library(caffe2::mkldnn INTERFACE IMPORTED)
+@@ -15,7 +15,7 @@ set_property(
+   ${MKLDNN_INCLUDE_DIR})
+ set_property(
+   TARGET caffe2::mkldnn PROPERTY INTERFACE_LINK_LIBRARIES
+-  ${MKLDNN_LIBRARIES})
++  DNNL::dnnl)
+ if(BUILD_ONEDNN_GRAPH)
+   if(NOT TARGET caffe2::dnnl_graph)
+     add_library(caffe2::dnnl_graph INTERFACE IMPORTED)
+diff --git a/setup.py b/setup.py
+index 34b2854..5db117f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -418,13 +418,9 @@ def build_deps():
+     # Windows has very poor support for them.
+     sym_files = [
+         'tools/shared/_utils_internal.py',
+-        'torch/utils/benchmark/utils/valgrind_wrapper/callgrind.h',
+-        'torch/utils/benchmark/utils/valgrind_wrapper/valgrind.h',
+     ]
+     orig_files = [
+         'torch/_utils_internal.py',
+-        'third_party/valgrind-headers/callgrind.h',
+-        'third_party/valgrind-headers/valgrind.h',
+     ]
+     for sym_file, orig_file in zip(sym_files, orig_files):
+         same = False
+diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
+index 89c6b91..0c60d08 100644
+--- a/test/cpp/c10d/CMakeLists.txt
++++ b/test/cpp/c10d/CMakeLists.txt
+@@ -16,14 +16,14 @@ function(c10d_add_test test_src)
+   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
+ endfunction()
+ 
+-c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
+-c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
++c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
++c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
+ if(INSTALL_TEST)
+   install(TARGETS FileStoreTest DESTINATION bin)
+   install(TARGETS TCPStoreTest DESTINATION bin)
+ endif()
+ if(NOT WIN32)
+-  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
++  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
+   if(INSTALL_TEST)
+     install(TARGETS HashStoreTest DESTINATION bin)
+   endif()
+@@ -31,11 +31,11 @@ endif()
+ 
+ if(USE_CUDA)
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
+     endif()
+-    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+   endif()
+   if(USE_NCCL AND USE_C10D_NCCL)
+     # NCCL is a private dependency of libtorch, but the tests include some
+@@ -44,10 +44,10 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupNCCLTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     c10d_add_test(
+       ProcessGroupNCCLErrorsTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+       install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+@@ -61,7 +61,7 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupUCCTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_ucc)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_ucc)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupUCCTest DESTINATION bin)
+       install(TARGETS c10d_cuda_test DESTINATION lib)
+@@ -69,7 +69,7 @@ if(USE_CUDA)
+   endif()
+ else()
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
+   endif()
+ endif()
+ 
+diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
+index 7dff706..90b1003 100644
+--- a/test/cpp/tensorexpr/CMakeLists.txt
++++ b/test/cpp/tensorexpr/CMakeLists.txt
+@@ -54,7 +54,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+ # pthreadpool header. For some build environment we need add the dependency
+ # explicitly.
+ if(USE_PTHREADPOOL)
+-  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
++  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
+ endif()
+ if(USE_CUDA)
+   target_link_libraries(test_tensorexpr PRIVATE
diff --git a/gnu/packages/patches/python-pytorch2-system-libraries.patch b/gnu/packages/patches/python-pytorch2-system-libraries.patch
deleted file mode 100644
index c2c44badbb..0000000000
--- a/gnu/packages/patches/python-pytorch2-system-libraries.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
-
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
---- a/caffe2/CMakeLists.txt	2023-12-27 12:14:24.308751288 +0100
-+++ b/caffe2/CMakeLists.txt	2023-12-27 12:30:15.941562126 +0100
-@@ -1570,7 +1570,7 @@
-   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
-   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
-   target_link_libraries(static_runtime_bench torch_library benchmark)
--  target_link_libraries(static_runtime_test torch_library gtest_main)
-+  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
- endif()
- 
- if(BUILD_TENSOREXPR_BENCHMARK)
-@@ -1601,7 +1601,7 @@
-   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
-@@ -1628,7 +1628,7 @@
-           endif()
-         else()
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
--          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
-+          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
-         endif()
-         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
-         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-@@ -1645,7 +1645,7 @@
-   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1666,7 +1666,7 @@
-     foreach(test_src ${Caffe2_MPS_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 557ab649..ee9cf410 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -732,11 +732,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1543,7 +1538,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cb..6075bdd0 100644
---- a/cmake/External/nnpack.cmake
-+++ b/cmake/External/nnpack.cmake
-@@ -40,7 +40,7 @@ endif()
- # (3) Android, iOS, Linux, macOS - supported
- ##############################################################################
- 
--if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-+if(FALSE)
-   message(STATUS "Brace yourself, we are building NNPACK")
-   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
- 
-@@ -114,6 +114,5 @@ endif()
- # (4) Catch-all: not supported.
- ##############################################################################
- 
--message(WARNING "Unknown platform - I don't know how to build NNPACK. "
--                "See cmake/External/nnpack.cmake for details.")
--set(USE_NNPACK OFF)
-+set(NNPACK_FOUND TRUE)
-+set(USE_NNPACK ON)
-diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
-index bf91460c..ef56948f 100644
---- a/test/cpp/c10d/CMakeLists.txt
-+++ b/test/cpp/c10d/CMakeLists.txt
-@@ -16,14 +16,14 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
--c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
-+c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
- if(INSTALL_TEST)
-   install(TARGETS FileStoreTest DESTINATION bin)
-   install(TARGETS TCPStoreTest DESTINATION bin)
- endif()
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
-+  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
-   if(INSTALL_TEST)
-     install(TARGETS HashStoreTest DESTINATION bin)
-   endif()
-@@ -31,11 +31,11 @@ endif()
- 
- if(USE_CUDA)
-   if(USE_GLOO AND USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
-     if(INSTALL_TEST)
-       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
-     endif()
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_NCCL AND USE_C10D_NCCL)
-     # NCCL is a private dependency of libtorch, but the tests include some
-@@ -56,7 +56,7 @@ if(USE_CUDA)
-   endif()
- else()
-   if(USE_GLOO AND USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
-   endif()
- endif()
- 
-diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
-index 8fc5a0a1..643202f6 100644
---- a/test/cpp/tensorexpr/CMakeLists.txt
-+++ b/test/cpp/tensorexpr/CMakeLists.txt
-@@ -53,7 +53,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
- # pthreadpool header. For some build environment we need add the dependency
- # explicitly.
- if(USE_PTHREADPOOL)
--  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
-+  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
- endif()
- if(USE_CUDA)
-   target_link_libraries(test_tensorexpr PRIVATE
-- 
2.41.0






^ permalink raw reply related	[relevance 42%]

* [bug#69591] [PATCH v2 06/31] gnu: Add python-expecttest.
                     ` (3 preceding siblings ...)
  2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 05/31] gnu: Add python-pytest-shard David Elsing
@ 2024-03-12 22:51 64% ` David Elsing
  2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 07/31] gnu: Add python-pytest-rerunfailures-13 David Elsing
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-12 22:51 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-expecttest): New variable.
---
 gnu/packages/python-check.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index f876088488..dbca80652c 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2078,6 +2078,41 @@ (define-public python-eradicate
 valid Python syntax that are likely to be commented out code.")
     (license license:expat)))
 
+(define-public python-expecttest
+  (let ((commit "683b09a352cc426851adc2e3a9f46e0ab25e4dee")
+        (revision "0"))
+    (package
+      (name "python-expecttest")
+      (version (git-version "0.2.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ezyang/expecttest")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1djwxp9x1hczzxbimv1b1bmd083am88v27l82nmlkhvzyg2cmpvv"))))
+      (build-system pyproject-build-system)
+      (arguments
+       (list
+        #:phases
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  ;; The test runs tests expected to fail, so the output is
+                  ;; confusing
+                  (invoke "python3" "test_expecttest.py")))))))
+      (native-inputs (list python-hypothesis poetry))
+      (home-page "https://github.com/ezyang/expecttest")
+      (synopsis "Python module for expect tests")
+      (description "@code{expecttest} is a Python module for expect tests, where
+the initial expected value of a test can be automatically set by running the
+test itself.")
+      (license license:expat))))
+
 (define-public python-robber
   (package
     (name "python-robber")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69591] [PATCH v2 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies.
                     ` (5 preceding siblings ...)
  2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 07/31] gnu: Add python-pytest-rerunfailures-13 David Elsing
@ 2024-03-12 22:51 48% ` David Elsing
  2024-03-12 22:51 42% ` [bug#69591] [PATCH v2 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-12 22:51 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

Autogenerated files are also regenerated. The tests can be run, but are
disabled, as they require a long time.

* gnu/packages/machine-learning.scm (python-pytorch): Update to 2.2.1.
[version]: Use %python-pytorch-version.
[source]: Use %python-pytorch-src.
[arguments]: Remove 'make-things-writable phase.  Add 'cmake-patches,
'set-max-jobs, 'codegen1, 'codegen2, 'build2, 'install2 phases. Adjust
'use-system-libraries and 'check phases.
[native-inputs]: Add doxygen, ideep-pytorch, pocketfft-cpp, python-expecttest,
python-pytest-flakefinder, python-pytest-rerunfailures-13,
python-pytest-shard, python-pytest-xdist, python-hypothesis,
python-types-dataclasses, python-typing-extensions-4.10 and valgrind.
[inputs]: Add asmjit, clog, flatbuffers-next, foxi, fxdiv, libuv,
miniz-for-pytorch, qnnpack, qnnpack-pytorch, fbgemm and oneapi-dnnl. Use
nnpack, fbgemm and oneapi-dnnl only for supported systems.
[propagated-inputs]: Add python-filelock, python-fsspec, python-jinja2,
python-networkx, python-optree, python-packaging, python-psutil and
python-sympy. Remove python-cffi and python-six.
(%python-pytorch-src)[source]: Add patches.
* gnu/packages/patches/python-pytorch-runpath.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-system-libraries.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch: Remove file.
* gnu/packages/patches/python-pytorch-fix-codegen.patch: New file.
* gnu/packages/patches/python-pytorch-without-kineto: New file.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                  |   3 +-
 gnu/packages/machine-learning.scm             | 333 +++++++++++-------
 ...ython-pytorch-1.9.0-system-libraries.patch | 139 --------
 .../patches/python-pytorch-fix-codegen.patch  | 167 +++++++++
 .../patches/python-pytorch-runpath.patch      |  19 +-
 .../python-pytorch-system-libraries.patch     | 317 +++++++++++++++--
 .../python-pytorch-without-kineto.patch       |  60 ++++
 7 files changed, 737 insertions(+), 301 deletions(-)
 delete mode 100644 gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
 create mode 100644 gnu/packages/patches/python-pytorch-fix-codegen.patch
 create mode 100644 gnu/packages/patches/python-pytorch-without-kineto.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index a66d00919f..c0b9b3a150 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1929,9 +1929,10 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyan3-fix-absolute-path-bug.patch \
   %D%/packages/patches/python-pyan3-fix-positional-arguments.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch	\
+  %D%/packages/patches/python-pytorch-fix-codegen.patch		\
   %D%/packages/patches/python-pytorch-runpath.patch		\
   %D%/packages/patches/python-pytorch-system-libraries.patch	\
-  %D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
+  %D%/packages/patches/python-pytorch-without-kineto.patch	\
   %D%/packages/patches/python-robotframework-atest.patch	\
   %D%/packages/patches/python-robotframework-source-date-epoch.patch \
   %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 6b62d7016b..c1fe0e2812 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -105,6 +105,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages parallel)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -123,6 +124,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages vulkan)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
@@ -4323,6 +4325,13 @@ (define %python-pytorch-src
     (sha256
      (base32
       "03mm0pwwb5lxdsmmiw3cch9fijgjw81kmmc4ln9rlyazkm7l1r48"))
+    (patches (search-patches "python-pytorch-system-libraries.patch"
+                             "python-pytorch-runpath.patch"
+                             "python-pytorch-without-kineto.patch"
+                             ;; Some autogeneration scripts depend on the
+                             ;; compile PyTorch library. Therefore, we create
+                             ;; dummy versions which are regenerated later.
+                             "python-pytorch-fix-codegen.patch"))
     (modules '((guix build utils)))
     (snippet
      '(begin
@@ -4442,135 +4451,219 @@ (define-public qnnpack-pytorch
 (define-public python-pytorch
   (package
     (name "python-pytorch")
-    (version "1.13.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "17yxjzwp4zp75fz7czgz9acijzw7dpyqcza50v8y1x7hfg2gw369"))
-              (patches (search-patches "python-pytorch-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-enum" "python-peachpy"
-                              "python-six" "tbb" "XNNPACK" "zstd"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
+    (version %python-pytorch-version)
+    (source %python-pytorch-src)
     (build-system python-build-system)
     (arguments
-     '(#:phases (modify-phases %standard-phases
-                  (add-before 'build 'use-system-libraries
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
-                      ;; want to use "system libraries" instead of the bundled
-                      ;; ones.
-                      (setenv "USE_SYSTEM_LIBS" "1")
-
-                      (substitute* "cmake/Dependencies.cmake"
-                        (("if\\(USE_SYSTEM_BIND11\\)")
-                         "if(TRUE)"))
-
-                      ;; XXX: Disable that for simplicity for now.
-                      (setenv "USE_FBGEMM" "0")))
-                  (add-before 'build 'make-things-writable
-                    (lambda _
-                      ;; The 'build_caffe2' function in
-                      ;; 'tools/build_pytorch_libs.py', called from the
-                      ;; top-level 'setup.py', needs write access to this
-                      ;; directory.
-                      (for-each make-file-writable
-                                (find-files "caffe2/proto" "."
-                                            #:directories? #t))))
-                  (replace 'check
-                    (lambda* (#:key inputs outputs tests? #:allow-other-keys)
-                      ;; Run the test suite following the instructions in
-                      ;; 'CONTRIBUTING.md'.  XXX: Unfortunately this doesn't
-                      ;; work, unless you set GUIX_PYTHONPATH presumably.
-                      (when tests?
-                        (add-installed-pythonpath inputs outputs)
-                        (invoke "python" "test/run_test.py"))))
-                  (add-after 'install 'remove-test-executables
-                    (lambda* (#:key inputs outputs #:allow-other-keys)
-                      ;; Remove test executables, but keep other executables
-                      ;; such as 'torch_shm_manager' and and .so files such as
-                      ;; 'libtorch_global_deps.so'.
-                      (let ((python-site (site-packages inputs outputs)))
-                        (for-each delete-file
-                                  (find-files python-site
-                                              "(^test_cpp_rpc|_test)$")))))
-                  (add-after 'install 'remove-caffe2-onnx-scripts
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let* ((out (assoc-ref outputs "out"))
-                             (bin (string-append out "/bin")))
-                        ;; Remove 'convert-caffe2-to-onnx' and
-                        ;; 'convert-onnx-to-caffe2': they seem to be
-                        ;; deprecated and they cause a failure of the
-                        ;; 'sanity-check' phase:
-                        ;;
-                        ;; ImportError: cannot import name 'metanet_pb2' from partially initialized module 'caffe2.proto' (most likely due to a circular import)
-                        (for-each delete-file
-                                  (find-files bin "^convert-.*caffe2"))
-
-                        (substitute* (find-files out "^entry_points\\.txt$")
-                          (("^convert-.*" all)
-                           (string-append "# " all "\n")))))))
-
-       ;; XXX: Tests attempt to download data such as
-       ;; <https://raw.githubusercontent.com/pytorch/test-infra/master/stats/slow-tests.json>.
-       ;; We're also missing some Python modules, such as expecttest.
-       #:tests? #f))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'cmake-patches
+            (lambda _
+              (substitute* "cmake/Dependencies.cmake"
+                (("#POCKETFFT_INCLUDE_DIR")
+                 (string-append
+                  #$(this-package-native-input "pocketfft-cpp") "/include"))
+                (("#FP16_INCLUDE_DIR")
+                 (string-append
+                  #$(this-package-input "fp16") "/include")))))
+          (add-before 'build 'use-system-libraries
+            (lambda _
+              (substitute* '("caffe2/serialize/crc.cc"
+                             "caffe2/serialize/inline_container.cc")
+                (("\"miniz\\.h\"") "<miniz/miniz.h>"))
+              (substitute* "aten/src/ATen/native/vulkan/api/Allocator.h"
+                (("<include/vk_mem_alloc.h>")
+                 "<vk_mem_alloc.h>"))
+              ;; For Vulkan
+              (substitute* "CMakeLists.txt"
+                (("append_cxx_flag.*-Werror=(return-type|range-loop-construct).*") ""))
+              (substitute*
+                  (cons*
+                   "torch/csrc/Module.cpp"
+                   (map
+                    (lambda (name)
+                      (string-append
+                       "torch/utils/benchmark/utils/valgrind_wrapper/"
+                       name))
+                    '("compat_bindings.cpp" "timer_callgrind_template.cpp")))
+                (("<callgrind.h>") "<valgrind/callgrind.h>"))
+              (setenv "USE_FFMPEG" "1")
+              (setenv "USE_VULKAN" "1")
+              (setenv "USE_OPENCV" "1")
+              ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
+              ;; want to use "system libraries" instead of the bundled
+              ;; ones.
+              (setenv "USE_SYSTEM_LIBS" "1")
+              ;; For oneDNN
+              (setenv "USE_MKLDNN" "1")
+              ;; Only works with CUPTI
+              (setenv "USE_KINETO" "0")
+              ;; Prevent CMake error by disabling explicitely
+              (setenv "USE_ITT" "0")))
+          (add-after 'use-system-libraries 'set-max-jobs
+            (lambda _
+              (setenv "MAX_JOBS" (number->string (parallel-job-count)))))
+          (add-after 'set-max-jobs 'codegen1
+            (lambda _
+              (with-directory-excursion "torch/csrc/jit/tensorexpr"
+                (setenv "PYTHONPATH" "../../../..")
+                (invoke "python3" "codegen_external.py")
+                (setenv "PYTHONPATH" #f))
+
+              (invoke "python3" "aten/src/ATen/nnapi/codegen.py")
+
+              (invoke "bash" "tools/gen_flatbuffers.sh")
+
+              ;; Generate dummy files as the generation depends on the compiled
+              ;; library. They are regenerated later.
+              (setenv "PYTHONPATH" ".")
+              (invoke "python3"
+                      "torchgen/operator_versions/gen_mobile_upgraders.py"
+                      "dummy")
+              (setenv "PYTHONPATH" #f)
+
+              (invoke "python3"
+                      "torchgen/shape_functions/gen_jit_shape_functions.py"
+                      "dummy")
+
+              (invoke "python3"
+                      "torchgen/decompositions/gen_jit_decompositions.py"
+                      "dummy")))
+          ;; Properly generate autogenerated files ...
+          (add-after 'install 'codegen2
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (add-installed-pythonpath inputs outputs)
+              (invoke "python3"
+                      "torchgen/operator_versions/gen_mobile_upgraders.py")
+              (invoke "python3"
+                      "torchgen/shape_functions/gen_jit_shape_functions.py")
+              (invoke "python3"
+                      "torchgen/decompositions/gen_jit_decompositions.py")))
+          ;; ... rebuild their dependencies ...
+          (add-after 'codegen2 'build2
+            (lambda _
+              (invoke "python3" "setup.py" "build")))
+          ;; ... and install again.
+          (add-after 'build2 'install2
+            (lambda _
+              (invoke "python3" "setup.py" "install" (string-append "--prefix=" #$output)
+                      "--no-compile" "--single-version-externally-managed" "--root=/")
+              (invoke "python" "-m" "compileall"
+                      "--invalidation-mode=unchecked-hash" #$output)))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              ;; Run the test suite following the instructions in
+              ;; 'CONTRIBUTING.md'. Unfortunately this doesn't work, unless
+              ;; you set PYTHONPATH or GUIX_PYTHONPATH, but this is done in
+              ;; the codegen2 phase already.
+              (when tests?
+                (invoke "python3" "test/run_test.py" "--core"))))
+          (add-after 'install2 'remove-test-executables
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              ;; Remove test executables, but keep other executables
+              ;; such as 'torch_shm_manager' and and .so files such as
+              ;; 'libtorch_global_deps.so'.
+              (let ((python-site (site-packages inputs outputs)))
+                (for-each delete-file
+                          (find-files python-site
+                                      "(^test_cpp_rpc|_test)$")))))
+          (add-after 'install2 'remove-caffe2-onnx-scripts
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (bin (string-append out "/bin")))
+                ;; Remove 'convert-caffe2-to-onnx' and
+                ;; 'convert-onnx-to-caffe2': they seem to be
+                ;; deprecated and they cause a failure of the
+                ;; 'sanity-check' phase:
+                ;;
+                ;; ImportError: cannot import name 'metanet_pb2' from partially initialized module 'caffe2.proto' (most likely due to a circular import)
+                (for-each delete-file
+                          (find-files bin "^convert-.*caffe2"))
+
+                (substitute* (find-files out "^entry_points\\.txt$")
+                  (("^convert-.*" all)
+                   (string-append "# " all "\n")))))))
+
+      ;; Even only the core tests take a very long time to run.
+      #:tests? #f))
     (native-inputs
-     (list cmake ninja))
+     (list cmake
+           doxygen
+           ideep-pytorch
+           ninja
+           pocketfft-cpp
+           python-expecttest
+           python-pytest-flakefinder
+           python-pytest-rerunfailures-13
+           python-pytest-shard
+           python-pytest-xdist
+           python-hypothesis
+           python-types-dataclasses
+           python-typing-extensions-4.10
+           shaderc
+           valgrind))
     (inputs
-     (list eigen
-           ;; ("fmt" ,fmt)
-           fp16
-           gemmlowp
-           googletest
-           googlebenchmark
-           gloo
-           nnpack
-           openblas
-           openmpi
-           pthreadpool
-           protobuf
-           pybind11
-           sleef
-           xnnpack
-           zstd))
+     (append
+      (list asmjit
+            clog
+            eigen
+            ffmpeg
+            flatbuffers-next
+            fmt
+            foxi
+            fp16
+            fxdiv
+            gemmlowp
+            gloo
+            googletest
+            googlebenchmark
+            libuv
+            miniz-for-pytorch
+            openblas
+            opencv
+            openmpi
+            pthreadpool
+            protobuf
+            pybind11
+            qnnpack
+            qnnpack-pytorch
+            sleef
+            tensorpipe
+            vulkan-headers
+            vulkan-loader
+            vulkan-memory-allocator
+            xnnpack
+            zstd)
+      ;; TODO: fix build on 32 bit systems
+      (filter
+       (lambda (pkg)
+         (member (or (%current-target-system)
+                     (%current-system))
+                 (package-transitive-supported-systems pkg)))
+       (list
+        nnpack
+        fbgemm
+        oneapi-dnnl))))
     (propagated-inputs
-     (list python-astunparse
+     (list cpuinfo
+           onnx ;propagated for its Python modules
+           onnx-optimizer
+           python-astunparse
            python-click
+           python-filelock
+           python-fsspec
+           python-future
+           python-jinja2
+           python-networkx
            python-numpy
+           python-optree
+           python-packaging
+           python-psutil
            python-pyyaml
-           python-cffi
-           python-typing-extensions
-           python-future
-           python-six
            python-requests
-           onnx                             ;propagated for its Python modules
-           onnx-optimizer
-           cpuinfo))
+           python-sympy
+           python-typing-extensions))
     (home-page "https://pytorch.org/")
     (synopsis "Python library for tensor computation and deep neural networks")
     (description
diff --git a/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch b/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
deleted file mode 100644
index 76c06520f0..0000000000
--- a/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
-
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 5d57b9ca78..620cca4e60 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -644,11 +644,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1485,7 +1480,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 50ebb224ce..5953d9ddf7 100644
---- a/caffe2/CMakeLists.txt
-+++ b/caffe2/CMakeLists.txt
-@@ -1632,7 +1632,7 @@ if(BUILD_TEST)
-         if(NOT MSVC)
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
-           # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
--          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
-+          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
-           if(USE_FBGEMM)
-             target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
-           endif()
-@@ -1655,7 +1655,7 @@ if(BUILD_TEST)
-   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1673,7 +1673,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_GPU_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       cuda_add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1691,7 +1691,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1709,7 +1709,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_HIP_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
-       target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
-
-diff --git a/torch/lib/c10d/test/CMakeLists.txt b/torch/lib/c10d/test/CMakeLists.txt
-index b74d4b65f7..fc7c207505 100644
---- a/torch/lib/c10d/test/CMakeLists.txt
-+++ b/torch/lib/c10d/test/CMakeLists.txt
-@@ -16,24 +16,24 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp c10d gtest_main)
--c10d_add_test(TCPStoreTest.cpp c10d gtest_main)
-+c10d_add_test(FileStoreTest.cpp c10d gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp c10d gtest_main gtest)
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp c10d gtest_main)
-+  c10d_add_test(HashStoreTest.cpp c10d gtest_main gtest)
- endif()
- 
- if(USE_CUDA)
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main)
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main gtest)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_C10D_NCCL)
--    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main gtest)
-     c10d_add_test(ProcessGroupNCCLErrorsTest.cpp c10d c10d_cuda_test
--        gtest_main)
-+        gtest_main gtest)
-   endif()
- else()
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main gtest)
-   endif()
- endif()
-
-diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cbb5..6075bdd0a4 100644
---- a/cmake/External/nnpack.cmake
-+++ b/cmake/External/nnpack.cmake
-@@ -40,7 +40,7 @@ endif()
- # (3) Android, iOS, Linux, macOS - supported
- ##############################################################################
- 
--if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-+if(FALSE)
-   message(STATUS "Brace yourself, we are building NNPACK")
-   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
- 
-@@ -114,6 +114,5 @@ endif()
- # (4) Catch-all: not supported.
- ##############################################################################
- 
--message(WARNING "Unknown platform - I don't know how to build NNPACK. "
--                "See cmake/External/nnpack.cmake for details.")
--set(USE_NNPACK OFF)
-+set(NNPACK_FOUND TRUE)
-+set(USE_NNPACK ON)
diff --git a/gnu/packages/patches/python-pytorch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-fix-codegen.patch
new file mode 100644
index 0000000000..cb246b25de
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-fix-codegen.patch
@@ -0,0 +1,167 @@
+This patch fixes some scripts for generating source files.  For
+gen_jit_decompositions.py, gen_mobile_upgraders.py and
+gen_jit_shape_functions.py, which depend on the compiled PyTorch library, the
+option to generate "dummy" source files is added for the initial build, which
+is later corrected.  codegen_external.py is patched to avoid duplicate
+functions and add the static keyword as in the existing generated file.
+
+diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
+index cc0263dbbf..ac34e84b82 100644
+--- a/tools/gen_flatbuffers.sh
++++ b/tools/gen_flatbuffers.sh
+@@ -1,13 +1,13 @@
+ #!/bin/bash
+ ROOT=$(pwd)
+-FF_LOCATION="$ROOT/third_party/flatbuffers"
+-cd "$FF_LOCATION" || exit
+-mkdir build
+-cd build || exit
+-cmake ..
+-cmake --build . --target flatc
+-mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
+-./flatc --cpp --gen-mutable --scoped-enums \
++#FF_LOCATION="$ROOT/third_party/flatbuffers"
++#cd "$FF_LOCATION" || exit
++#mkdir build
++#cd build || exit
++#cmake ..
++#cmake --build . --target flatc
++#mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
++flatc --cpp --gen-mutable --scoped-enums \
+      -o "$ROOT/torch/csrc/jit/serialization" \
+      -c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
+ echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
+diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
+index bc69b05162..0f8df81de3 100644
+--- a/torch/csrc/jit/tensorexpr/codegen_external.py
++++ b/torch/csrc/jit/tensorexpr/codegen_external.py
+@@ -20,9 +20,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+     native_functions = parse_native_yaml(native_functions_path, tags_path)
+     func_decls = []
+     func_registrations = []
+-    for func in native_functions:
++    done_names = set()
++    for func in native_functions[0]:
+         schema = func.func
+         name = schema.name.name.base
++        if name in done_names:
++            continue
++        else:
++            done_names.add(name)
+         args = schema.arguments
+         # Only supports extern calls for functions with out variants
+         if not schema.is_out_fn():
+@@ -62,7 +67,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+ 
+         # print(tensor_decls, name, arg_names)
+         func_decl = f"""\
+-void nnc_aten_{name}(
++static void nnc_aten_{name}(
+     int64_t bufs_num,
+     void** buf_data,
+     int64_t* buf_ranks,
+diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
+index 7cfbb803f9..2e69bb1868 100644
+--- a/torchgen/decompositions/gen_jit_decompositions.py
++++ b/torchgen/decompositions/gen_jit_decompositions.py
+@@ -1,8 +1,12 @@
+ #!/usr/bin/env python3
+ import os
+ from pathlib import Path
++import sys
+ 
+-from torch.jit._decompositions import decomposition_table
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    from torch.jit._decompositions import decomposition_table
++else:
++    decomposition_table = {}
+ 
+ # from torchgen.code_template import CodeTemplate
+ 
+@@ -85,7 +89,7 @@ def write_decomposition_util_file(path: str) -> None:
+ 
+ 
+ def main() -> None:
+-    pytorch_dir = Path(__file__).resolve().parents[3]
++    pytorch_dir = Path(__file__).resolve().parents[2]
+     upgrader_path = pytorch_dir / "torch" / "csrc" / "jit" / "runtime"
+     write_decomposition_util_file(str(upgrader_path))
+ 
+diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
+index dab1568580..55c58715fc 100644
+--- a/torchgen/operator_versions/gen_mobile_upgraders.py
++++ b/torchgen/operator_versions/gen_mobile_upgraders.py
+@@ -2,10 +2,12 @@
+ import os
+ from enum import Enum
+ from pathlib import Path
++import sys
+ from typing import Any, Dict, List
+ 
+-import torch
+-from torch.jit.generate_bytecode import generate_upgraders_bytecode
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    import torch
++    from torch.jit.generate_bytecode import generate_upgraders_bytecode
+ 
+ from torchgen.code_template import CodeTemplate
+ from torchgen.operator_versions.gen_mobile_upgraders_constant import (
+@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+ def construct_version_maps(
+     upgrader_bytecode_function_to_index_map: Dict[str, Any]
+ ) -> str:
+-    version_map = torch._C._get_operator_version_map()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        version_map = torch._C._get_operator_version_map()
++    else:
++        version_map = {}
+     sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0])  # type: ignore[no-any-return]
+     sorted_version_map = dict(sorted_version_map_)
+ 
+@@ -378,7 +383,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ 
+ 
+ def main() -> None:
+-    upgrader_list = generate_upgraders_bytecode()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        upgrader_list = generate_upgraders_bytecode()
++    else:
++        upgrader_list = []
+     sorted_upgrader_list = sort_upgrader(upgrader_list)
+     for up in sorted_upgrader_list:
+         print("after sort upgrader : ", next(iter(up)))
+diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
+index c6336a6951..34e394d818 100644
+--- a/torchgen/shape_functions/gen_jit_shape_functions.py
++++ b/torchgen/shape_functions/gen_jit_shape_functions.py
+@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
+ if not file_path.exists():
+     raise Exception(err_msg)
+ 
+-spec = importlib.util.spec_from_file_location(module_name, file_path)
+-assert spec is not None
+-module = importlib.util.module_from_spec(spec)
+-sys.modules[module_name] = module
+-assert spec.loader is not None
+-assert module is not None
+-spec.loader.exec_module(module)
+-
+-bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
+-shape_compute_graph_mapping = module.shape_compute_graph_mapping
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    spec = importlib.util.spec_from_file_location(module_name, file_path)
++    assert spec is not None
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[module_name] = module
++    assert spec.loader is not None
++    assert module is not None
++    spec.loader.exec_module(module)
++
++    bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
++    shape_compute_graph_mapping = module.shape_compute_graph_mapping
++else:
++    bounded_compute_graph_mapping = {}
++    shape_compute_graph_mapping = {}
+ 
+ 
+ SHAPE_HEADER = r"""
diff --git a/gnu/packages/patches/python-pytorch-runpath.patch b/gnu/packages/patches/python-pytorch-runpath.patch
index 7f95b88a2b..2c1724cdb0 100644
--- a/gnu/packages/patches/python-pytorch-runpath.patch
+++ b/gnu/packages/patches/python-pytorch-runpath.patch
@@ -3,10 +3,10 @@ get installed, quite surprisingly, to 'lib/python3.8/site-packages/{bin,lib}'.
 Make sure RUNPATH matches that.
 
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 5b5622f0..30d27e57 100644
+index 74836372..c8eb69d1 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1909,7 +1909,7 @@ if(BUILD_PYTHON)
+@@ -1910,7 +1910,7 @@ if(BUILD_PYTHON)
    if(${BUILDING_WITH_TORCH_LIBS})
      # site-packages/caffe2/python/caffe2_pybind11_state
      # site-packages/torch/lib
@@ -16,7 +16,7 @@ index 5b5622f0..30d27e57 100644
  
    # Must also include `CMAKE_SHARED_LINKER_FLAGS` in linker flags for
 diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index ee9cf410..f190e69b 100644
+index acc95842..8f8fb7d7 100644
 --- a/cmake/Dependencies.cmake
 +++ b/cmake/Dependencies.cmake
 @@ -4,7 +4,7 @@ if(APPLE)
@@ -28,3 +28,16 @@ index ee9cf410..f190e69b 100644
  endif(APPLE)
  # Use separate rpaths during build and install phases
  set(CMAKE_SKIP_BUILD_RPATH  FALSE)
+diff --git a/functorch/CMakeLists.txt b/functorch/CMakeLists.txt
+index f2f32745..db21b656 100644
+--- a/functorch/CMakeLists.txt
++++ b/functorch/CMakeLists.txt
+@@ -21,7 +21,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE pybind::pybind11)
+ 
+ set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
+       ${CMAKE_BINARY_DIR}/functorch)
+-set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${_rpath_portable_origin}/../torch/lib")
++set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/../torch/lib")
+ 
+ # Copy-pasted prefix/suffix logic for Python extensions from
+ # https://github.com/pytorch/pytorch/blob/33bb8ae350611760139457b85842b1d7edf9aa11/caffe2/CMakeLists.txt#L1975
diff --git a/gnu/packages/patches/python-pytorch-system-libraries.patch b/gnu/packages/patches/python-pytorch-system-libraries.patch
index fd849fd9e2..99f999f32f 100644
--- a/gnu/packages/patches/python-pytorch-system-libraries.patch
+++ b/gnu/packages/patches/python-pytorch-system-libraries.patch
@@ -1,38 +1,104 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
+Patch build files to also system libraries instead of bundled ones for the
+libraries not supported or working only by specifying USE_SYSTEM_LIBS.  This
+includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
+ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
+For QNNPACK, two versions were bundled and are required: The upstream one and
+an internal fork (now in the package qnnpack-pytorch).
 
+diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
+index 2c2b967..5ac5fa6 100644
+--- a/aten/src/ATen/CMakeLists.txt
++++ b/aten/src/ATen/CMakeLists.txt
+@@ -371,9 +371,9 @@ if(AT_NNPACK_ENABLED)
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
+ endif()
+ 
+-if(MKLDNN_FOUND)
+-  list(APPEND ATen_CPU_DEPENDENCY_LIBS ${MKLDNN_LIBRARIES})
+-endif(MKLDNN_FOUND)
++if(USE_MKLDNN)
++  list(APPEND ATen_CPU_DEPENDENCY_LIBS DNNL::dnnl)
++endif(USE_MKLDNN)
+ 
+ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x|ppc64le)$")
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index d57d7ebb..5b5622f0 100644
+index 7483637..093de40 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1736,7 +1736,7 @@ if(BUILD_TEST)
+@@ -111,9 +111,6 @@ if(NOT MSVC AND USE_XNNPACK)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+-    add_subdirectory(
+-      "${FXDIV_SOURCE_DIR}"
+-      "${CMAKE_BINARY_DIR}/FXdiv")
+   endif()
+ endif()
+ 
+@@ -1055,7 +1052,6 @@ elseif(USE_CUDA)
+ endif()
+ 
+ if(NOT MSVC AND USE_XNNPACK)
+-  TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 
+ # ==========================================================
+@@ -1396,6 +1392,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+ target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
++target_link_libraries(torch_cpu PRIVATE miniz clog)
+ if(USE_MPI)
+   target_link_libraries(torch_cpu PRIVATE MPI::MPI_CXX)
+ endif()
+@@ -1653,7 +1650,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
+   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
+   target_link_libraries(static_runtime_bench torch_library benchmark)
+-  target_link_libraries(static_runtime_test torch_library gtest_main)
++  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
+ endif()
+ 
+ if(BUILD_TENSOREXPR_BENCHMARK)
+@@ -1680,7 +1677,7 @@ if(BUILD_MOBILE_TEST)
+   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
+@@ -1701,7 +1698,7 @@ if(BUILD_TEST)
          if(NOT MSVC)
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
            # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
 -          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
 +          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
            if(USE_FBGEMM)
              target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
            endif()
-@@ -1759,7 +1759,7 @@ if(BUILD_TEST)
+@@ -1715,7 +1712,7 @@ if(BUILD_TEST)
+           endif()
+         else()
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
+         endif()
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+@@ -1732,7 +1729,7 @@ if(BUILD_TEST)
    foreach(test_src ${Caffe2_CPU_TEST_SRCS})
      get_filename_component(test_name ${test_src} NAME_WE)
      add_executable(${test_name} "${test_src}")
 -    target_link_libraries(${test_name} torch_library gtest_main)
 +    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     if(USE_OPENMP)
-       # -fopenmp is a compile time flag and as result not guaranteed
-       # to link executable against OpenMP runtime library
-@@ -1785,7 +1785,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_GPU_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1803,7 +1803,7 @@ if(BUILD_TEST)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+@@ -1795,7 +1792,7 @@ if(BUILD_TEST)
      foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
        get_filename_component(test_name ${test_src} NAME_WE)
        add_executable(${test_name} "${test_src}")
@@ -41,20 +107,66 @@ index d57d7ebb..5b5622f0 100644
        target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
        target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
        add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1821,7 +1821,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_HIP_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
-       target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
+diff --git a/caffe2/serialize/CMakeLists.txt b/caffe2/serialize/CMakeLists.txt
+index 1552b59..67e1a9a 100644
+--- a/caffe2/serialize/CMakeLists.txt
++++ b/caffe2/serialize/CMakeLists.txt
+@@ -2,7 +2,6 @@ file(GLOB tmp *_test.cc)
+ 
+ set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
+ list(APPEND Caffe2_CPU_SRCS
+-  ${PROJECT_SOURCE_DIR}/third_party/miniz-2.1.0/miniz.c
+   ${CMAKE_CURRENT_SOURCE_DIR}/inline_container.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/istream_adapter.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/file_adapter.cc
 diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 557ab649..ee9cf410 100644
+index acc9584..97275bf 100644
 --- a/cmake/Dependencies.cmake
 +++ b/cmake/Dependencies.cmake
-@@ -732,11 +732,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+@@ -283,7 +283,7 @@ endif()
+ # --- [ PocketFFT
+ set(AT_POCKETFFT_ENABLED 0)
+ if(NOT AT_MKL_ENABLED)
+-  set(POCKETFFT_INCLUDE_DIR "${Torch_SOURCE_DIR}/third_party/pocketfft/")
++  set(POCKETFFT_INCLUDE_DIR "#POCKETFFT_INCLUDE_DIR")
+   if(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}")
+     message(FATAL_ERROR "pocketfft directory not found, expected ${POCKETFFT_INCLUDE_DIR}")
+   elif(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}/pocketfft_hdronly.h")
+@@ -489,19 +489,6 @@ if(USE_QNNPACK)
+     set(QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+     set(QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+     set(QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-    add_subdirectory(
+-      "${QNNPACK_SOURCE_DIR}"
+-      "${CONFU_DEPENDENCIES_BINARY_DIR}/QNNPACK")
+-
+-    # TODO: See https://github.com/pytorch/pytorch/issues/56285
+-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+-      target_compile_options(qnnpack PRIVATE -Wno-deprecated-declarations)
+-    endif()
+-
+-    # We build static versions of QNNPACK and pthreadpool but link
+-    # them into a shared library for Caffe2, so they need PIC.
+-    set_property(TARGET qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+     if(QNNPACK_CUSTOM_THREADPOOL)
+       target_compile_definitions(
+@@ -550,13 +537,6 @@ if(USE_PYTORCH_QNNPACK)
+       set(PYTORCH_QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-      add_subdirectory(
+-        "${PYTORCH_QNNPACK_SOURCE_DIR}"
+-        "${CONFU_DEPENDENCIES_BINARY_DIR}/pytorch_qnnpack")
+-      # We build static versions of QNNPACK and pthreadpool but link
+-      # them into a shared library for Caffe2, so they need PIC.
+-      set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-      set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+       if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
+         target_compile_definitions(
+@@ -728,11 +708,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
    # this shouldn't be necessary anymore.
    get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
    set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
@@ -66,7 +178,49 @@ index 557ab649..ee9cf410 100644
  
    # We will not need to test benchmark lib itself.
    set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1543,7 +1538,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+@@ -810,16 +785,6 @@ if(USE_FBGEMM)
+     if(USE_ASAN)
+       set(USE_SANITIZER "address,undefined" CACHE STRING "-fsanitize options for FBGEMM")
+     endif()
+-    add_subdirectory("${FBGEMM_SOURCE_DIR}")
+-    set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
+-      # See https://github.com/pytorch/pytorch/issues/74352
+-      target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
+-      target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
+-    endif()
+   endif()
+ 
+   if(USE_FBGEMM)
+@@ -979,7 +944,7 @@ if(NOT TARGET fp16 AND NOT USE_SYSTEM_FP16)
+     "${FP16_SOURCE_DIR}"
+     "${CONFU_DEPENDENCIES_BINARY_DIR}/FP16")
+ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
+-  add_library(fp16 STATIC "/usr/include/fp16.h")
++  add_library(fp16 STATIC "#FP16_INCLUDE_DIR")
+   set_target_properties(fp16 PROPERTIES LINKER_LANGUAGE C)
+ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
+@@ -1362,7 +1327,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ 
+     # Tensorpipe uses cuda_add_library
+     torch_update_find_cuda_flags()
+-    add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
+ 
+     list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
+     if(USE_CUDA)
+@@ -1529,7 +1493,6 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+       set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
+     endif()
+   endif()
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+ 
+   add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+   if(NOT USE_SYSTEM_ONNX)
+@@ -1560,7 +1523,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
      endif()
      set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
      message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
@@ -75,8 +229,36 @@ index 557ab649..ee9cf410 100644
    endif()
    include_directories(${FOXI_INCLUDE_DIRS})
    list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
+@@ -1739,9 +1702,8 @@ if(NOT INTERN_BUILD_MOBILE)
+   endif()
+   if(USE_MKLDNN)
+     include(${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake)
+-    if(MKLDNN_FOUND)
++    if(DNNL_FOUND)
+       set(AT_MKLDNN_ENABLED 1)
+-      include_directories(AFTER SYSTEM ${MKLDNN_INCLUDE_DIR})
+       if(BUILD_CAFFE2_OPS)
+         list(APPEND Caffe2_DEPENDENCY_LIBS caffe2::mkldnn)
+       endif(BUILD_CAFFE2_OPS)
+@@ -1796,7 +1758,7 @@ endif()
+ #
+ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
+-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
++find_package(fmt)
+ 
+ # Disable compiler feature checks for `fmt`.
+ #
+@@ -1805,7 +1767,6 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
+ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
+ # `fmt` is compatible with a superset of the compilers that PyTorch is, it
+ # shouldn't be too bad to just disable the checks.
+-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "")
+ 
+ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
+ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
 diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cb..6075bdd0 100644
+index 9d5f064..c3624e5 100644
 --- a/cmake/External/nnpack.cmake
 +++ b/cmake/External/nnpack.cmake
 @@ -40,7 +40,7 @@ endif()
@@ -88,7 +270,7 @@ index a41343cb..6075bdd0 100644
    message(STATUS "Brace yourself, we are building NNPACK")
    set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
  
-@@ -114,6 +114,5 @@ endif()
+@@ -112,6 +112,5 @@ endif()
  # (4) Catch-all: not supported.
  ##############################################################################
  
@@ -97,8 +279,45 @@ index a41343cb..6075bdd0 100644
 -set(USE_NNPACK OFF)
 +set(NNPACK_FOUND TRUE)
 +set(USE_NNPACK ON)
+diff --git a/cmake/public/mkldnn.cmake b/cmake/public/mkldnn.cmake
+index 8793562..9f8fa3d 100644
+--- a/cmake/public/mkldnn.cmake
++++ b/cmake/public/mkldnn.cmake
+@@ -4,7 +4,7 @@ if(CPU_AARCH64)
+   include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake)
+ endif()
+ 
+-find_package(MKLDNN QUIET)
++find_package(DNNL REQUIRED)
+ 
+ if(NOT TARGET caffe2::mkldnn)
+   add_library(caffe2::mkldnn INTERFACE IMPORTED)
+@@ -15,4 +15,4 @@ set_property(
+   ${MKLDNN_INCLUDE_DIR})
+ set_property(
+   TARGET caffe2::mkldnn PROPERTY INTERFACE_LINK_LIBRARIES
+-  ${MKLDNN_LIBRARIES})
++  DNNL::dnnl)
+diff --git a/setup.py b/setup.py
+index 81f3c6c..3251cab 100644
+--- a/setup.py
++++ b/setup.py
+@@ -482,13 +482,9 @@ def build_deps():
+     # Windows has very poor support for them.
+     sym_files = [
+         "tools/shared/_utils_internal.py",
+-        "torch/utils/benchmark/utils/valgrind_wrapper/callgrind.h",
+-        "torch/utils/benchmark/utils/valgrind_wrapper/valgrind.h",
+     ]
+     orig_files = [
+         "torch/_utils_internal.py",
+-        "third_party/valgrind-headers/callgrind.h",
+-        "third_party/valgrind-headers/valgrind.h",
+     ]
+     for sym_file, orig_file in zip(sym_files, orig_files):
+         same = False
 diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
-index bf91460c..ef56948f 100644
+index 5c89748..ef84c57 100644
 --- a/test/cpp/c10d/CMakeLists.txt
 +++ b/test/cpp/c10d/CMakeLists.txt
 @@ -16,14 +16,14 @@ function(c10d_add_test test_src)
@@ -133,7 +352,29 @@ index bf91460c..ef56948f 100644
    endif()
    if(USE_NCCL AND USE_C10D_NCCL)
      # NCCL is a private dependency of libtorch, but the tests include some
-@@ -56,7 +56,7 @@ if(USE_CUDA)
+@@ -44,10 +44,10 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupNCCLTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     c10d_add_test(
+       ProcessGroupNCCLErrorsTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+       install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+@@ -61,7 +61,7 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupUCCTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_ucc)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_ucc)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupUCCTest DESTINATION bin)
+       install(TARGETS c10d_cuda_test DESTINATION lib)
+@@ -69,7 +69,7 @@ if(USE_CUDA)
    endif()
  else()
    if(USE_GLOO AND USE_C10D_GLOO)
@@ -143,10 +384,10 @@ index bf91460c..ef56948f 100644
  endif()
  
 diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
-index 8fc5a0a1..643202f6 100644
+index 012471d..d39b625 100644
 --- a/test/cpp/tensorexpr/CMakeLists.txt
 +++ b/test/cpp/tensorexpr/CMakeLists.txt
-@@ -53,7 +53,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+@@ -54,7 +54,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
  # pthreadpool header. For some build environment we need add the dependency
  # explicitly.
  if(USE_PTHREADPOOL)
@@ -154,4 +395,4 @@ index 8fc5a0a1..643202f6 100644
 +  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
  endif()
  if(USE_CUDA)
-   target_link_libraries(test_tensorexpr PRIVATE
+   target_compile_definitions(test_tensorexpr PRIVATE USE_CUDA)
diff --git a/gnu/packages/patches/python-pytorch-without-kineto.patch b/gnu/packages/patches/python-pytorch-without-kineto.patch
new file mode 100644
index 0000000000..f956316866
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-without-kineto.patch
@@ -0,0 +1,60 @@
+Even when building without Kineto, the <ActivityType.h> header is still
+imported and the ActivityType type is used. This patch was copied from
+https://github.com/pytorch/pytorch/pull/111048.
+
+diff --git a/torch/csrc/profiler/kineto_shim.h b/torch/csrc/profiler/kineto_shim.h
+index e92cbf00..68985ab7 100644
+--- a/torch/csrc/profiler/kineto_shim.h
++++ b/torch/csrc/profiler/kineto_shim.h
+@@ -12,7 +12,51 @@
+ #undef USE_KINETO
+ #endif
+ 
++#ifdef USE_KINETO
+ #include <ActivityType.h>
++#else
++namespace libkineto {
++// copied from header
++/*
++ * Copyright (c) Meta Platforms, Inc. and affiliates.
++ * All rights reserved.
++ *
++ * This source code is licensed under the BSD-style license found in the
++ * LICENSE file in the root directory of this source tree.
++ */
++
++// Note : All activity types are not enabled by default. Please add them
++// at correct position in the enum
++enum class ActivityType {
++    // Activity types enabled by default
++    CPU_OP = 0, // cpu side ops
++    USER_ANNOTATION,
++    GPU_USER_ANNOTATION,
++    GPU_MEMCPY,
++    GPU_MEMSET,
++    CONCURRENT_KERNEL, // on-device kernels
++    EXTERNAL_CORRELATION,
++    CUDA_RUNTIME, // host side cuda runtime events
++    CUDA_DRIVER, // host side cuda driver events
++    CPU_INSTANT_EVENT, // host side point-like events
++    PYTHON_FUNCTION,
++    OVERHEAD, // CUPTI induced overhead events sampled from its overhead API.
++
++    // Optional Activity types
++    CUDA_SYNC, // synchronization events between runtime and kernels
++    GLOW_RUNTIME, // host side glow runtime events
++    MTIA_RUNTIME, // host side MTIA runtime events
++    CUDA_PROFILER_RANGE, // CUPTI Profiler range for performance metrics
++    MTIA_CCP_EVENTS, // MTIA ondevice CCP events
++    HPU_OP, // HPU host side runtime event
++    XPU_RUNTIME, // host side xpu runtime events
++
++    ENUM_COUNT, // This is to add buffer and not used for any profiling logic. Add your new type before it.
++    OPTIONAL_ACTIVITY_TYPE_START = CUDA_SYNC,
++};
++}
++
++#endif
+ 
+ #include <torch/csrc/Export.h>
+ #include <torch/csrc/profiler/api.h>
-- 
2.41.0





^ permalink raw reply related	[relevance 48%]

* [bug#69591] [PATCH v2 05/31] gnu: Add python-pytest-shard.
                     ` (2 preceding siblings ...)
  2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 04/31] gnu: Add python-pytest-flakefinder David Elsing
@ 2024-03-12 22:51 65% ` David Elsing
  2024-03-12 22:51 64% ` [bug#69591] [PATCH v2 06/31] gnu: Add python-expecttest David Elsing
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-12 22:51 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-shard): New variable.
---
 gnu/packages/python-check.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 247f8af98b..f876088488 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -210,6 +210,30 @@ (define-public python-pytest-flakefinder
 times and detect flakyness.")
     (license license:asl2.0)))
 
+(define-public python-pytest-shard
+  (let ((commit "64610a08dac6b0511b6d51cf895d0e1040d162ad")
+        (revision "0"))
+    (package
+      (name "python-pytest-shard")
+      (version (git-version "0.1.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/AdamGleave/pytest-shard")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1h31m68igz670bzl307hazjrfbr8pk14mxflllar18ydmlrnl677"))))
+      (build-system pyproject-build-system)
+      (propagated-inputs (list python-pytest))
+      (home-page "https://github.com/AdamGleave/pytest-shard")
+      (synopsis "Pytest plugin for sharding tests")
+      (description "This package provides a Pytest extension for sharding
+tests at the granularity of individual test cases, which can be run in
+parallel and on multiple machines.")
+      (license license:expat))))
+
 (define-public python-testfixtures
   (package
     (name "python-testfixtures")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v2 02/31] gnu: Add python-typing-extensions-4.10.
  @ 2024-03-12 22:51 65% ` David Elsing
  2024-03-12 22:51 63% ` [bug#69591] [PATCH v2 03/31] gnu: Add python-optree David Elsing
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-12 22:51 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-build.scm (python-typing-extensions-4.10): New variable.
---
 gnu/packages/python-build.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 2ea457cdba..dfd59d5e25 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2022 Garek Dyszel <garekdyszel@disroot.org>
 ;;; Copyright © 2022 Greg Hogan <code@greghogan.com>
-
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -252,6 +252,18 @@ (define-public python-typing-extensions
 @end enumerate\n")
     (license license:psfl)))
 
+(define-public python-typing-extensions-4.10
+  (package
+    (inherit python-typing-extensions)
+    (version "4.10.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "typing_extensions" version))
+       (sha256
+        (base32
+         "1jxkj4pni8pdyrn79sq441lsp40xzw363n0qvfc6zfcgkv4dgaxh"))))))
+
 \f
 ;;;
 ;;; Python builder packages.
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v2 04/31] gnu: Add python-pytest-flakefinder.
    2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 02/31] gnu: Add python-typing-extensions-4.10 David Elsing
  2024-03-12 22:51 63% ` [bug#69591] [PATCH v2 03/31] gnu: Add python-optree David Elsing
@ 2024-03-12 22:51 65% ` David Elsing
  2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 05/31] gnu: Add python-pytest-shard David Elsing
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-12 22:51 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-flakefinder): New variable.
---
 gnu/packages/python-check.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 51a38bbcbe..247f8af98b 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -18,6 +18,7 @@
 ;;; Copyright © 2022 Tomasz Jeneralczyk <tj@schwi.pl>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
 ;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -191,6 +192,24 @@ (define-public python-pytest-csv
 it adds to the Pytest command line interface (CLI).")
     (license license:gpl3+)))
 
+(define-public python-pytest-flakefinder
+  (package
+    (name "python-pytest-flakefinder")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-flakefinder" version))
+       (sha256
+        (base32 "03iy80xlkpgzjs2kxa9rrj8dbnp9awyhpcl3hy8fgf5x40cjlhg2"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-pytest))
+    (home-page "https://github.com/dropbox/pytest-flakefinder")
+    (synopsis "Pytest plugin for finding flaky tests")
+    (description "This package provides a Pytest plugin to run tests multiple
+times and detect flakyness.")
+    (license license:asl2.0)))
+
 (define-public python-testfixtures
   (package
     (name "python-testfixtures")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH v2 03/31] gnu: Add python-optree.
    2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 02/31] gnu: Add python-typing-extensions-4.10 David Elsing
@ 2024-03-12 22:51 63% ` David Elsing
  2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 04/31] gnu: Add python-pytest-flakefinder David Elsing
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-12 22:51 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-xyz.scm (python-optree): New variable.
---
 .../patches/python-optree-fix-32-bit.patch    | 122 ++++++++++++++++++
 gnu/packages/python-xyz.scm                   |  30 +++++
 2 files changed, 152 insertions(+)
 create mode 100644 gnu/packages/patches/python-optree-fix-32-bit.patch

diff --git a/gnu/packages/patches/python-optree-fix-32-bit.patch b/gnu/packages/patches/python-optree-fix-32-bit.patch
new file mode 100644
index 0000000000..6a32c39bd8
--- /dev/null
+++ b/gnu/packages/patches/python-optree-fix-32-bit.patch
@@ -0,0 +1,122 @@
+In include/utils.h, ssize_t is an alias for py::ssize_t, which is an alias for
+Py_ssize_t in Python, which is an alias for the system ssize_t.
+The latter is defined in glibc as int if __WORDSIZE == 32 and as long int if
+__WORDSIZE == 64.  Therefore, we need to remove the explicit template
+specialization for int in the first case.
+
+diff --git a/include/utils.h b/include/utils.h
+index 950a02b..82a9591 100644
+--- a/include/utils.h
++++ b/include/utils.h
+@@ -141,10 +141,12 @@ template <>
+ inline py::handle GET_ITEM_HANDLE<py::tuple>(const py::handle& container, const size_t& item) {
+     return PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::tuple>(const py::handle& container, const int& item) {
+     return PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#endif
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const ssize_t& item) {
+     return PyList_GET_ITEM(container.ptr(), item);
+@@ -153,10 +155,12 @@ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const size_t& item) {
+     return PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const int& item) {
+     return PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline py::object GET_ITEM_BORROW(const py::handle& container, const Item& item) {
+@@ -171,11 +175,13 @@ inline py::object GET_ITEM_BORROW<py::tuple>(const py::handle& container, const
+     return py::reinterpret_borrow<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_BORROW<py::tuple>(const py::handle& container, const int& item) {
+     return py::reinterpret_borrow<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ template <>
+ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const ssize_t& item) {
+     return py::reinterpret_borrow<py::object>(PyList_GET_ITEM(container.ptr(), item));
+@@ -185,11 +191,13 @@ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const s
+     return py::reinterpret_borrow<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const int& item) {
+     return py::reinterpret_borrow<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline py::object GET_ITEM_STEAL(const py::handle& container, const Item& item) {
+@@ -204,11 +212,13 @@ inline py::object GET_ITEM_STEAL<py::tuple>(const py::handle& container, const s
+     return py::reinterpret_steal<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_STEAL<py::tuple>(const py::handle& container, const int& item) {
+     return py::reinterpret_steal<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ template <>
+ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const ssize_t& item) {
+     return py::reinterpret_steal<py::object>(PyList_GET_ITEM(container.ptr(), item));
+@@ -218,11 +228,13 @@ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const si
+     return py::reinterpret_steal<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const int& item) {
+     return py::reinterpret_steal<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline void SET_ITEM(const py::handle& container, const Item& item, const py::handle& value) {
+@@ -240,12 +252,14 @@ inline void SET_ITEM<py::tuple>(const py::handle& container,
+                                 const py::handle& value) {
+     PyTuple_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline void SET_ITEM<py::tuple>(const py::handle& container,
+                                 const int& item,
+                                 const py::handle& value) {
+     PyTuple_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#endif
+ template <>
+ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const ssize_t& item,
+@@ -258,12 +272,14 @@ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const py::handle& value) {
+     PyList_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const int& item,
+                                const py::handle& value) {
+     PyList_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#endif
+ 
+ template <typename PyType>
+ inline void AssertExact(const py::handle& object) {
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0c72caeca0..b664aac3b7 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -148,6 +148,7 @@
 ;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
 ;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
 ;;; Copyright © 2024 Ian Eure <ian@retrospec.tv>
+;;; Copyright © 2024 David Elsing <david.elsing@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -11636,6 +11637,35 @@ (define-public python-treelib
      "This package provides a Python implementation of a tree structure.")
     (license license:asl2.0)))
 
+(define-public python-optree
+  (package
+    (name "python-optree")
+    (version "0.10.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/metaopt/optree")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1q3wljk7cyl5rsam02sfsj8zjrqx4c3x9vic8j6xx13p8czpsisg"))
+       (patches (search-patches "python-optree-fix-32-bit.patch"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-typing-extensions))
+    (native-inputs
+     (list python-pytest
+           python-pytest-cov
+           python-pytest-xdist
+           cmake
+           pybind11))
+    (home-page "https://github.com/metaopt/optree")
+    (synopsis "Optimized PyTree Utilities")
+    (description "This package contains operations on PyTrees (a tree made of
+container data structures in Python).")
+    (license license:asl2.0)))
+
 (define-public python-jupyter-core
   (package
     (name "python-jupyter-core")
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#69591] [PATCH v2 07/31] gnu: Add python-pytest-rerunfailures-13.
                     ` (4 preceding siblings ...)
  2024-03-12 22:51 64% ` [bug#69591] [PATCH v2 06/31] gnu: Add python-expecttest David Elsing
@ 2024-03-12 22:51 65% ` David Elsing
  2024-03-12 22:51 48% ` [bug#69591] [PATCH v2 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
  2024-03-12 22:51 42% ` [bug#69591] [PATCH v2 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-12 22:51 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-rerunfailures-13): New variable.
---
 gnu/packages/python-check.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index dbca80652c..347e4a4701 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2464,6 +2464,17 @@ (define-public python-pytest-rerunfailures
 eliminate flaky failures.")
     (license license:mpl2.0)))
 
+(define-public python-pytest-rerunfailures-13
+  (package
+    (inherit python-pytest-rerunfailures)
+    (version "13.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-rerunfailures" version))
+       (sha256
+        (base32 "16cin0chv59w4rvnd6r0fisp0s8avmp07rwn9da6yixw43jdncp1"))))))
+
 (define-public python-xunitparser
   (package
     (name "python-xunitparser")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69736] [PATCH 2/7] gnu: Add python-pypubsub.
    2024-03-11 18:22 65% ` [bug#69736] [PATCH 1/7] gnu: Add python-typing-extensions-4.10 Arun Isaac
@ 2024-03-11 18:22 62% ` Arun Isaac
  2024-03-11 18:22 65% ` [bug#69736] [PATCH 3/7] gnu: Add python-addict Arun Isaac
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Arun Isaac @ 2024-03-11 18:22 UTC (permalink / raw)
  To: 69736
  Cc: Arun Isaac, Arun Isaac, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-pypubsub): New variable.

Change-Id: Id8f06bd592b6273cff282aa628f05503a67519b0
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0c72caeca0..ed9b1c9140 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7768,6 +7768,32 @@ (define-public python-blinker
 interested parties to subscribe to events, or \"signals\".")
     (license license:expat)))
 
+(define-public python-pypubsub
+  (package
+    (name "python-pypubsub")
+    (version "4.0.3")
+    ;; There is no source tarball on PyPI.
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/schollii/pypubsub")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "02j74w28wzmdvxkk8i561ywjgizjifq3hgcl080yj0rvkd3wivlb"))))
+    (build-system python-build-system)
+    (home-page "https://github.com/schollii/pypubsub")
+    (synopsis "Python publish-subscribe library")
+    (description "@code{python-pypubsub} provides a pure Python
+publish-subscribe API to facilitate event-based or message-based architecture
+in a single-process application.  It is centered on the notion of a topic;
+senders publish messages of a given topic, and listeners subscribe to messages
+of a given topic, all inside the same process.  The package also supports a
+variety of advanced features that facilitate debugging and maintaining topics
+and messages in larger desktop or server-based applications.")
+    (license license:bsd-2)))
+
 (define-public pelican
   (package
     (name "pelican")
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#69736] [PATCH 1/7] gnu: Add python-typing-extensions-4.10.
  @ 2024-03-11 18:22 65% ` Arun Isaac
  2024-03-11 18:22 62% ` [bug#69736] [PATCH 2/7] gnu: Add python-pypubsub Arun Isaac
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Arun Isaac @ 2024-03-11 18:22 UTC (permalink / raw)
  To: 69736
  Cc: Arun Isaac, Arun Isaac, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-build.scm (python-typing-extensions-4.10): New variable.

Change-Id: I82d9538e76353b39cce082020a939e1a8fb7badc
---
 gnu/packages/python-build.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 2ea457cdba..adf26f7f8b 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2022 Garek Dyszel <garekdyszel@disroot.org>
 ;;; Copyright © 2022 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2024 Arun Isaac <arunisaac@systemreboot.net>
 
 ;;;
 ;;; This file is part of GNU Guix.
@@ -252,6 +253,18 @@ (define-public python-typing-extensions
 @end enumerate\n")
     (license license:psfl)))
 
+;; TODO: Remove this package once python-typing-extensions is updated.
+(define-public python-typing-extensions-4.10
+  (package
+    (inherit python-typing-extensions)
+    (version "4.10.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "typing_extensions" version))
+              (sha256
+               (base32
+                "1jxkj4pni8pdyrn79sq441lsp40xzw363n0qvfc6zfcgkv4dgaxh"))))))
+
 \f
 ;;;
 ;;; Python builder packages.
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69736] [PATCH 3/7] gnu: Add python-addict.
    2024-03-11 18:22 65% ` [bug#69736] [PATCH 1/7] gnu: Add python-typing-extensions-4.10 Arun Isaac
  2024-03-11 18:22 62% ` [bug#69736] [PATCH 2/7] gnu: Add python-pypubsub Arun Isaac
@ 2024-03-11 18:22 65% ` Arun Isaac
  2024-03-11 18:22 65% ` [bug#69736] [PATCH 4/7] gnu: Add python-prefixed Arun Isaac
  2024-03-11 18:22 64% ` [bug#69736] [PATCH 5/7] gnu: Add python-enlighten Arun Isaac
  4 siblings, 0 replies; 200+ results
From: Arun Isaac @ 2024-03-11 18:22 UTC (permalink / raw)
  To: 69736
  Cc: Arun Isaac, Arun Isaac, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-addict): New variable.

Change-Id: I1554d17495bf9337067422f2118f8b46e51abead
---
 gnu/packages/python-xyz.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ed9b1c9140..34b894a351 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -23058,6 +23058,23 @@ (define-public python-attrdict3
 both as keys and as attributes.")
     (license license:expat)))
 
+(define-public python-addict
+  (package
+    (name "python-addict")
+    (version "2.4.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "addict" version))
+              (sha256
+               (base32
+                "1574sicy5ydx9pvva3lbx8qp56z9jbdwbj26aqgjhyh61q723cmk"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/mewwts/addict")
+    (synopsis "Python dictionary with attribute accessible values")
+    (description "@code{python-addict} provides dictionaries whose items can
+be get and set using both attribute and item syntax.")
+    (license license:expat)))
+
 (define-public python-attrs
   (package
     (name "python-attrs")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69736] [PATCH 4/7] gnu: Add python-prefixed.
                     ` (2 preceding siblings ...)
  2024-03-11 18:22 65% ` [bug#69736] [PATCH 3/7] gnu: Add python-addict Arun Isaac
@ 2024-03-11 18:22 65% ` Arun Isaac
  2024-03-11 18:22 64% ` [bug#69736] [PATCH 5/7] gnu: Add python-enlighten Arun Isaac
  4 siblings, 0 replies; 200+ results
From: Arun Isaac @ 2024-03-11 18:22 UTC (permalink / raw)
  To: 69736
  Cc: Arun Isaac, Arun Isaac, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-prefixed): New variable.

Change-Id: I1398953059feb740dfdd9abe12bd0aa7abe3714e
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 34b894a351..87204b392f 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32516,6 +32516,24 @@ (define-public python-quicktions
 is the cythonized version of @code{fractions.Fraction}.")
     (license license:psfl)))
 
+(define-public python-prefixed
+  (package
+    (name "python-prefixed")
+    (version "0.7.0")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "prefixed" version))
+              (sha256
+               (base32
+                "1sdvxwy4kvcxvnq1nx70j1ccx5ga6wdb478vqd5azf1fc1gd2m0b"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/Rockhopper-Technologies/prefixed")
+    (synopsis "Prefixed alternative numeric library")
+    (description "@code{python-prefixed} provides an alternative
+implementation of the built-in float which supports formatted output with
+SI (decimal) and IEC (binary) prefixes.")
+    (license license:mpl2.0)))
+
 (define-public python-pathvalidate
   (package
     (name "python-pathvalidate")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69736] [PATCH 5/7] gnu: Add python-enlighten.
                     ` (3 preceding siblings ...)
  2024-03-11 18:22 65% ` [bug#69736] [PATCH 4/7] gnu: Add python-prefixed Arun Isaac
@ 2024-03-11 18:22 64% ` Arun Isaac
  4 siblings, 0 replies; 200+ results
From: Arun Isaac @ 2024-03-11 18:22 UTC (permalink / raw)
  To: 69736
  Cc: Arun Isaac, Arun Isaac, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-enlighten): New variable.

Change-Id: Ifcc1e71cf012eb3b7e2c0ceef7d288cea9fa6a91
---
 gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 87204b392f..755f64e361 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17869,6 +17869,28 @@ (define-public python-progressbar33
     ;; Either or both of these licenses may be selected.
     (license (list license:lgpl2.1+ license:bsd-3))))
 
+(define-public python-enlighten
+  (package
+    (name "python-enlighten")
+    (version "1.12.4")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "enlighten" version))
+              (sha256
+               (base32
+                "0psvglhi0c7d7pdk9rfb8scnv3xbq2fz78619x2mxvz094mxkwvm"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs
+     (list python-blessed python-prefixed))
+    (home-page "https://github.com/Rockhopper-Technologies/enlighten")
+    (synopsis "Console progress bar library")
+    (description "@code{python-enlighten} is a console progress bar library
+for Python.  The main advantage of Enlighten is that it allows writing to
+stdout and stderr without any redirection or additional code---just print or
+log as you normally would.  Enlighten also includes experimental support for
+Jupyter Notebooks.")
+    (license license:mpl2.0)))
+
 (define-public python-colorama
   (package
    (name "python-colorama")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69716] [PATCH] gnu: python-3.12: Enable loadable sqlite extensions.
@ 2024-03-10 21:22 65% Felix Gruber
  0 siblings, 0 replies; 200+ results
From: Felix Gruber @ 2024-03-10 21:22 UTC (permalink / raw)
  To: 69716
  Cc: Felix Gruber, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

This change makes it possible to load sqlite extensions with

import sqlite3
con = sqlite3.connect(":memory:")
con.enable_load_extension(True)
con.load_extension(path_to_extension)

* gnu/packages/python.scm (python-3.12)[arguments]: Add
--enable-loadable-sqlite-extensions to configure-flags.

Change-Id: I4fb0a5482c96a12a71c88bc48fffc4c3abe78544
---
 gnu/packages/python.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 12a5148cb1..e7df4d86ce 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -633,6 +633,7 @@ (define-public python-3.12
                                "--with-computed-gotos" ;main interpreter loop optimization
                                "--enable-unicode=ucs4"
                                "--without-static-libpython"
+                               "--enable-loadable-sqlite-extensions"
 
                                ;; FIXME: These flags makes Python significantly faster,
                                ;; but leads to non-reproducible binaries.

base-commit: c7836393be4d134861d652b2fcf09cf4e68275ca
-- 
2.43.0





^ permalink raw reply related	[relevance 65%]

* [bug#69074] [PATCH v2 14/14] gnu: Add python-angr.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
                     ` (8 preceding siblings ...)
  2024-03-10 20:09 70%   ` [bug#69074] [PATCH v2 13/14] gnu: capstone: Backport upstream fix for Python bindings soeren
@ 2024-03-10 20:09 69%   ` soeren
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/patches/python-angr-addition-type-error.patch:
New patch.
* gnu/packages/patches/python-angr-check-exec-deps.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/python-xyz.scm (python-angr): New variable.
---
 gnu/local.mk                                  |  2 +
 .../python-angr-addition-type-error.patch     | 18 ++++
 .../patches/python-angr-check-exec-deps.patch | 93 ++++++++++++++++++
 gnu/packages/python-xyz.scm                   | 96 +++++++++++++++++++
 4 files changed, 209 insertions(+)
 create mode 100644 gnu/packages/patches/python-angr-addition-type-error.patch
 create mode 100644 gnu/packages/patches/python-angr-check-exec-deps.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ce0f1994c5..8bbf66cc1e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1899,6 +1899,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-3-search-paths.patch		\
   %D%/packages/patches/python-3-fix-tests.patch			\
   %D%/packages/patches/python-3-hurd-configure.patch		\
+  %D%/packages/patches/python-angr-addition-type-error.patch	\
+  %D%/packages/patches/python-angr-check-exec-deps.patch	\
   %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch	\
   %D%/packages/patches/python-argcomplete-1.11.1-fish31.patch	\
   %D%/packages/patches/python-capstone-fix-python-constants.patch	\
diff --git a/gnu/packages/patches/python-angr-addition-type-error.patch b/gnu/packages/patches/python-angr-addition-type-error.patch
new file mode 100644
index 0000000000..7301d8b505
--- /dev/null
+++ b/gnu/packages/patches/python-angr-addition-type-error.patch
@@ -0,0 +1,18 @@
+This fixes failures of the test_ln_gcc_O2 and other related tests
+in the angr test suite.  The patch has been proposed upstream.
+
+Taken form: https://github.com/angr/angr/pull/4443
+
+diff --git a/angr/analyses/reassembler.py b/angr/analyses/reassembler.py
+index 7a2399a60..b09b3a8cb 100644
+--- a/angr/analyses/reassembler.py
++++ b/angr/analyses/reassembler.py
+@@ -730,7 +730,7 @@ class Instruction:
+             elif operand.type == capstone.CS_OP_MEM:
+                 operand_offsets.append(capstone_instr.disp_offset)
+             else:
+-                operand_offsets.append(None)
++                operand_offsets.append(0)
+ 
+         if self.addr is not None:
+             self._initialize(capstone_instr.operands, operand_offsets)
diff --git a/gnu/packages/patches/python-angr-check-exec-deps.patch b/gnu/packages/patches/python-angr-check-exec-deps.patch
new file mode 100644
index 0000000000..438f8ef183
--- /dev/null
+++ b/gnu/packages/patches/python-angr-check-exec-deps.patch
@@ -0,0 +1,93 @@
+The angr test suite performs analysis on several pre-compiled binaries
+to ensure its binary analysis capabilities are working as intended.
+Some of these binaries are also executed as part of the test suite to
+test if the simulation engine provided by angr results in the same
+output as native execution of the binary.
+
+For Guix, this files as the glibc shared objects cannot be found.
+Additionally, we don't really want to execute pre-compiled binaries
+on Guix, hence we disable those tests.
+
+diff --git a/tests/test_ctype_locale.py b/tests/test_ctype_locale.py
+index 08cb89836..2b9233558 100644
+--- a/tests/test_ctype_locale.py
++++ b/tests/test_ctype_locale.py
+@@ -14,7 +14,7 @@ test_location = os.path.dirname(os.path.abspath(__file__))
+ 
+ 
+ class TestCtypeLocale(unittest.TestCase):
+-    @skip_if_not_linux
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_ctype_b_loc(self):
+         """
+         test_ctype_locale.test_ctype_b_loc
+@@ -60,7 +60,7 @@ class TestCtypeLocale(unittest.TestCase):
+         output = subprocess.check_output(bin_path, shell=True)
+         assert result == output
+ 
+-    @skip_if_not_linux
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_ctype_tolower_loc(self):
+         """
+         test_ctype_locale.test_ctype_tolower_loc
+@@ -109,7 +109,7 @@ class TestCtypeLocale(unittest.TestCase):
+         output = subprocess.check_output(bin_path, shell=True)
+         assert result == output
+ 
+-    @skip_if_not_linux
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_ctype_toupper_loc(self):
+         """
+         test_ctype_locale.test_ctype_toupper_loc
+diff --git a/tests/test_signed_div.py b/tests/test_signed_div.py
+index 59cb9b8d1..994ed9c65 100644
+--- a/tests/test_signed_div.py
++++ b/tests/test_signed_div.py
+@@ -1,6 +1,7 @@
+ import angr
+ import subprocess
+ import sys
++import pytest
+ 
+ import logging
+ 
+@@ -13,7 +14,7 @@ import os
+ test_location = os.path.dirname(os.path.realpath(__file__))
+ 
+ 
+-@skipUnless(sys.platform.startswith("linux"), "linux only")
++@pytest.mark.skip(reason="test executes pre-compiled binaries")
+ def test_signed_div():
+     test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "test_signed_div")
+     b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_sscanf.py b/tests/test_sscanf.py
+index 29d2c8403..ea799b310 100644
+--- a/tests/test_sscanf.py
++++ b/tests/test_sscanf.py
+@@ -1,3 +1,4 @@
++import pytest
+ import angr
+ import subprocess
+ import sys
+@@ -14,7 +15,7 @@ test_location = os.path.dirname(os.path.realpath(__file__))
+ 
+ 
+ class TestSscanf(unittest.TestCase):
+-    @unittest.skipUnless(sys.platform.startswith("linux"), "linux only")
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_sscanf(self):
+         test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "sscanf_test")
+         b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_strtol.py b/tests/test_strtol.py
+index 6c29cab22..f36181407 100644
+--- a/tests/test_strtol.py
++++ b/tests/test_strtol.py
+@@ -11,7 +11,7 @@ class TestStrtol(unittest.TestCase):
+     # pylint: disable=no-self-use
+ 
+     @slow_test
+-    @unittest.skipUnless(sys.platform.startswith("linux"), "linux-only")
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_strtol(self, threads=None):
+         test_bin = os.path.join(bin_location, "tests", "x86_64", "strtol_test")
+         # disabling auto_load_libs increases the execution time of the test case.
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7c85404c2a..f4b0501187 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32577,6 +32577,102 @@ (define-public python-itanium-demangle
 extracting type information.")
     (license license:bsd-0)))
 
+(define-public python-angr
+  (package
+    (name "python-angr")
+    (version "9.2.46")
+    (source
+     (origin
+       (method git-fetch)
+       (patches (search-patches "python-angr-addition-type-error.patch"
+                                "python-angr-check-exec-deps.patch"))
+       (uri (git-reference
+             (url "https://github.com/angr/angr")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "18y9wyf7va7gvp9zd6lhw82j9a2x2ajsvbawh96xnxzml0jwlwjm"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'patch-tests
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (let ((coreutils (assoc-ref inputs "coreutils")))
+                         (substitute* "tests/test_vault.py"
+                           (("/bin/false")
+                            (which "false")))
+                         (substitute* "tests/common.py"
+                           (("\\[\"cc\"\\]")
+                            "[\"gcc\"]")))))
+                   (replace 'check
+                     (lambda* (#:key inputs tests? #:allow-other-keys)
+                       (when tests?
+                         (copy-recursively #$(this-package-native-input "binaries")
+                                           "../binaries")
+                         (with-directory-excursion "tests"
+                           ;; test_mips32_missing_offset_in_instructions fails
+                           ;; with capstone 5 and passes with capstone 4. Might
+                           ;; be a capstone regressions, needs investigation.
+                           ;;
+                           ;; test_concrete_memset is a non-deterministic benchmark.
+                           (invoke "pytest" "-vv" "-x" "--dist" "loadfile"
+                                   "-k" "not test_mips32_missing_offset_in_instructions and not test_concrete_memset"
+                                   "-n" (number->string (parallel-job-count)))))))
+                   (add-before 'build 'set-cc
+                     (lambda _
+                       (setenv "CC" "gcc"))))))
+    (propagated-inputs (list python-ailment
+                             python-archinfo
+                             python-cachetools
+                             python-cffi
+                             python-claripy
+                             python-cle
+                             python-colorama
+                             python-cppheaderparser
+                             python-dpkt
+                             python-gitpython
+                             python-mulpyplexer
+                             python-nampa
+                             python-networkx
+                             python-protobuf
+                             python-psutil
+                             python-itanium-demangle
+                             python-pycparser
+                             python-pyvex
+                             python-progressbar2
+                             python-rpyc
+                             python-sortedcontainers
+                             python-sqlalchemy
+                             python-sympy
+                             unicorn))
+    (native-inputs `(("python-pytest" ,python-pytest)
+                     ("python-pytest-xdist" ,python-pytest-xdist)
+                     ("binaries"
+                      ;; This repository ships several binaries used only for testing
+                      ;; purpose.  The binaries are not executed and not part of the
+                      ;; angr distribution, they are only used to test angr's binary
+                      ;; analysis capabilities.  In the context of the GNU FSDG, these
+                      ;; files should be considered non-functional data.
+                      ,(origin
+                         (method git-fetch)
+                         (uri (git-reference (url
+                                              "https://github.com/angr/binaries")
+                                             (commit (string-append "v"
+                                                                    version))))
+                         (file-name (git-file-name "angr-binaries" version))
+                         (sha256 (base32
+                                  "1f286b2239zavxzwg1184hj1zs380cr9qr549mvy3vywvm8bsmgr"))))))
+    (home-page "https://github.com/angr/angr")
+    (synopsis "Multi-architecture binary analysis toolkit")
+    (description
+     "This package provides a versatile binary analysis platform with the
+ability to perform dynamic symbolic execution as well as various
+static analyses directly on binaries.  As such, it can be used for all
+kinds of reverse engineering, vulnerability discovery, exploit
+generation, and software testing purposes.")
+    (license license:bsd-2)))
+
 (define-public python-peachpy
   ;; There is no tag in this repo.
   (let ((commit "913d74c35a6b1d330e90bfc055208ce5b06b35a0")




^ permalink raw reply related	[relevance 69%]

* [bug#69074] [PATCH v2 13/14] gnu: capstone: Backport upstream fix for Python bindings.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
                     ` (7 preceding siblings ...)
  2024-03-10 20:09 64%   ` [bug#69074] [PATCH v2 11/14] gnu: Add python-ailment soeren
@ 2024-03-10 20:09 70%   ` soeren
  2024-03-10 20:09 69%   ` [bug#69074] [PATCH v2 14/14] gnu: Add python-angr soeren
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074; +Cc: troy

From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/patches/python-capstone-fix-python-constants.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/engineering.scm (capstone): New patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/engineering.scm                  |  2 +
 ...python-capstone-fix-python-constants.patch | 84 +++++++++++++++++++
 3 files changed, 87 insertions(+)
 create mode 100644 gnu/packages/patches/python-capstone-fix-python-constants.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ecbae4bb53..ce0f1994c5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1901,6 +1901,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-3-hurd-configure.patch		\
   %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch	\
   %D%/packages/patches/python-argcomplete-1.11.1-fish31.patch	\
+  %D%/packages/patches/python-capstone-fix-python-constants.patch	\
   %D%/packages/patches/python-cross-compile.patch		\
   %D%/packages/patches/python-configobj-setuptools.patch	\
   %D%/packages/patches/python-dateutil-pytest-compat.patch	\
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 16f572909c..336c8b0e38 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -39,6 +39,7 @@
 ;;; Copyright © 2023 Theofilos Pechlivanis <theofilos.pechlivanis@gmail.com>
 ;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2023 pinoaffe <pinoaffe@gmail.com>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1815,6 +1816,7 @@ (define-public capstone
     (version "5.0.1")
     (source (origin
               (method git-fetch)
+              (patches (search-patches "python-capstone-fix-python-constants.patch"))
               (uri (git-reference
                     (url "https://github.com/capstone-engine/capstone")
                     (commit version)))
diff --git a/gnu/packages/patches/python-capstone-fix-python-constants.patch b/gnu/packages/patches/python-capstone-fix-python-constants.patch
new file mode 100644
index 0000000000..75100c6652
--- /dev/null
+++ b/gnu/packages/patches/python-capstone-fix-python-constants.patch
@@ -0,0 +1,84 @@
+Backport upstream patch fixing various constants in the Python bindings.
+
+Taken from: https://github.com/capstone-engine/capstone/commit/f180e176de3efb060db62820ff981d0291ea8525
+
+diff --git a/bindings/python/capstone/__init__.py b/bindings/python/capstone/__init__.py
+index bda2fdb6..52353c28 100755
+--- a/bindings/python/capstone/__init__.py
++++ b/bindings/python/capstone/__init__.py
+@@ -113,7 +113,6 @@ __all__ = [
+     'CS_OPT_SYNTAX_NOREGNAME',
+     'CS_OPT_SYNTAX_MASM',
+     'CS_OPT_SYNTAX_MOTOROLA',
+-    'CS_OPT_SYNTAX_CS_REG_ALIAS',
+ 
+     'CS_OPT_DETAIL',
+     'CS_OPT_MODE',
+@@ -152,19 +151,6 @@ __all__ = [
+     'CS_OP_REG',
+     'CS_OP_IMM',
+     'CS_OP_FP',
+-    'CS_OP_PRED',
+-    'CS_OP_RESERVED_5',
+-    'CS_OP_RESERVED_6',
+-    'CS_OP_RESERVED_7',
+-    'CS_OP_RESERVED_8',
+-    'CS_OP_RESERVED_9',
+-    'CS_OP_RESERVED_10',
+-    'CS_OP_RESERVED_11',
+-    'CS_OP_RESERVED_12',
+-    'CS_OP_RESERVED_13',
+-    'CS_OP_RESERVED_14',
+-    'CS_OP_RESERVED_15',
+-    'CS_OP_SPECIAL',
+     'CS_OP_MEM',
+ 
+     'CS_GRP_INVALID',
+@@ -298,26 +284,13 @@ CS_OPT_NO_BRANCH_OFFSET = 9  # ARM, prints branch immediates without offset.
+ 
+ # Capstone option value
+ CS_OPT_OFF = 0             # Turn OFF an option - default option of CS_OPT_DETAIL
+-CS_OPT_ON = 1 << 0              # Turn ON an option (CS_OPT_DETAIL)
++CS_OPT_ON = 3              # Turn ON an option (CS_OPT_DETAIL)
+ 
+ # Common instruction operand types - to be consistent across all architectures.
+ CS_OP_INVALID = 0  # uninitialized/invalid operand.
+ CS_OP_REG = 1  # Register operand.
+ CS_OP_IMM = 2  # Immediate operand.
+ CS_OP_FP  = 3  # Floating-Point operand.
+-CS_OP_PRED = 4  # Predicate operand.
+-CS_OP_RESERVED_5 = 5
+-CS_OP_RESERVED_6 = 6
+-CS_OP_RESERVED_7 = 7
+-CS_OP_RESERVED_8 = 8
+-CS_OP_RESERVED_9 = 9
+-CS_OP_RESERVED_10 = 10
+-CS_OP_RESERVED_11 = 11
+-CS_OP_RESERVED_12 = 12
+-CS_OP_RESERVED_13 = 13
+-CS_OP_RESERVED_14 = 14
+-CS_OP_RESERVED_15 = 15
+-CS_OP_SPECIAL = 0x10  # Special operands from archs
+ CS_OP_MEM = 0x80  # Memory operand. Can be ORed with another operand type.
+ 
+ # Common instruction groups - to be consistent across all architectures.
+@@ -336,13 +309,12 @@ CS_AC_READ     = (1 << 0) # Operand that is read from.
+ CS_AC_WRITE    = (1 << 1) # Operand that is written to.
+ 
+ # Capstone syntax value
+-CS_OPT_SYNTAX_DEFAULT = 1 << 1  # Default assembly syntax of all platforms (CS_OPT_SYNTAX)
+-CS_OPT_SYNTAX_INTEL = 1 << 2  # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_ATT = 1 << 3  # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_NOREGNAME = 1 << 4  # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM)
+-CS_OPT_SYNTAX_MASM = 1 << 5  # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_MOTOROLA = 1 << 6  # MOS65XX use $ as hex prefix
+-CS_OPT_SYNTAX_CS_REG_ALIAS = 1 << 7  # Prints common register alias which are not defined in LLVM (ARM: r9 = sb etc.)
++CS_OPT_SYNTAX_DEFAULT = 0    # Default assembly syntax of all platforms (CS_OPT_SYNTAX)
++CS_OPT_SYNTAX_INTEL = 1    # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_ATT = 2      # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_NOREGNAME = 3   # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM)
++CS_OPT_SYNTAX_MASM = 4      # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_MOTOROLA = 5 # MOS65XX use $ as hex prefix
+ 
+ # Capstone error type
+ CS_ERR_OK = 0      # No error: everything was fine




^ permalink raw reply related	[relevance 70%]

* [bug#69074] [PATCH v2 03/14] gnu: Add python-mulpyplexer.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
@ 2024-03-10 20:09 65%   ` soeren
  2024-03-10 20:09 65%   ` [bug#69074] [PATCH v2 04/14] gnu: Add python-nampa soeren
                     ` (8 subsequent siblings)
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e630bdb6a6..ddb0224b53 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,29 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-mulpyplexer
+  (package
+    (name "python-mulpyplexer")
+    (version "0.09")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "mulpyplexer" version))
+       (sha256
+        (base32 "0c5xzci1djy1yi9hxxh8g67l6ms8r7ad7ja20pv8hfbdysdrwkhl"))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (invoke "python" "mulpyplexer.py")))))))
+    (home-page "https://github.com/zardus/mulpyplexer/")
+    (synopsis "Multiplexes interactions with lists of Python objects")
+    (description "This module provides utilities for multiplexing
+interactions with lists of Python objects.")
+    (license license:bsd-2)))
+
 (define-public python-itanium-demangle
   (package
     (name "python-itanium-demangle")




^ permalink raw reply related	[relevance 65%]

* [bug#69074] [PATCH v2 11/14] gnu: Add python-ailment.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
                     ` (6 preceding siblings ...)
  2024-03-10 20:09 63%   ` [bug#69074] [PATCH v2 10/14] gnu: Add python-cle soeren
@ 2024-03-10 20:09 64%   ` soeren
  2024-03-10 20:09 70%   ` [bug#69074] [PATCH v2 13/14] gnu: capstone: Backport upstream fix for Python bindings soeren
  2024-03-10 20:09 69%   ` [bug#69074] [PATCH v2 14/14] gnu: Add python-angr soeren
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 76f115f6d0..7c85404c2a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32304,6 +32304,34 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-ailment
+  (package
+    (name "python-ailment")
+    ;; Must be the same version as python-angr.
+    (version "9.2.46")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ailment" version))
+       (sha256
+        (base32 "073fcssbjis1ckwv2w0dcz2dfl6715bj4d4qdhspajj911mvng2f"))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    ;; Many tests are skipped due to cyclic dependencies.
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (with-directory-excursion "tests"
+                          (invoke "python" "-m" "unittest"))))))))
+    (home-page "https://github.com/angr/ailment")
+    (synopsis "The angr intermediate language")
+    (description
+     "This Python module implements an @acronym{IL, Intermediate Language},
+also known as @acronym{IR, Intermediate Representation}, used by the angr
+binary analysis platform.")
+    (license license:bsd-2)))
+
 (define-public python-cle
   (package
     (name "python-cle")




^ permalink raw reply related	[relevance 64%]

* [bug#69074] [PATCH v2 09/14] gnu: Add python-pyvex.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
                     ` (4 preceding siblings ...)
  2024-03-10 20:09 62%   ` [bug#69074] [PATCH v2 07/14] gnu: Add python-claripy soeren
@ 2024-03-10 20:09 66%   ` soeren
  2024-03-10 20:09 63%   ` [bug#69074] [PATCH v2 10/14] gnu: Add python-cle soeren
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/patches/python-pyvex-remove-angr-dependency.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/python-xyz.scm (python-pyvex): New variable.
---
 gnu/local.mk                                  |  1 +
 .../python-pyvex-remove-angr-dependency.patch | 80 +++++++++++++++++++
 gnu/packages/python-xyz.scm                   | 37 +++++++++
 3 files changed, 118 insertions(+)
 create mode 100644 gnu/packages/patches/python-pyvex-remove-angr-dependency.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1946fdcbb6..ecbae4bb53 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1930,6 +1930,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pytorch-runpath.patch		\
   %D%/packages/patches/python-pytorch-system-libraries.patch	\
   %D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
+  %D%/packages/patches/python-pyvex-remove-angr-dependency.patch	\
   %D%/packages/patches/python-robotframework-atest.patch	\
   %D%/packages/patches/python-robotframework-source-date-epoch.patch \
   %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
diff --git a/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch b/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
new file mode 100644
index 0000000000..dccf22bbc6
--- /dev/null
+++ b/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
@@ -0,0 +1,80 @@
+This patch removes the angr dependency from the pyvex these, thus
+resolving a circular dependency (as angr depends on pyvex). This
+patch has been taken from upstream.
+
+This patch is a squashed version of the following upstream patches:
+
+* https://github.com/angr/pyvex/commit/61fb26f223a8d8a276b702d2448a12e02c5c9c6b
+* https://github.com/angr/pyvex/commit/a1fb2a4d0826b0e43bd8bbdd00b6db032643ec95
+
+diff --git a/tests/test_spotter.py b/tests/test_spotter.py
+index 9271ccd..bed7dd4 100644
+--- a/tests/test_spotter.py
++++ b/tests/test_spotter.py
+@@ -1,6 +1,5 @@
+ import os
+ 
+-import angr
+ import archinfo
+ 
+ import pyvex
+@@ -98,53 +97,28 @@ class CortexSpotter(GymratLifter):
+ register(CortexSpotter, "ARMEL")
+ 
+ 
+-def test_full_binary():
+-    p = angr.Project(
+-        os.path.join(test_location, "armel", "RTOSDemo.axf.issue_685"),
+-        arch="ARMEL",
+-        auto_load_libs=False,
+-    )
+-    st = p.factory.call_state(0x000013CE + 1)
+-    b = st.block().vex
+-    simgr = p.factory.simulation_manager(st)
+-    simgr.step()
+-    assert b.jumpkind == "Ijk_Sys_syscall"
+-    assert simgr.active[0].regs.ip_at_syscall.args[0] == 0x13FB
+-
+-
+ def test_tmrs():
+-    test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
+-    p = angr.Project(
+-        os.path.join(test_location, "armel", "helloworld"),
+-        arch="ARMEL",
+-        auto_load_libs=False,
+-    )
++    arch = archinfo.arch_from_id("ARMEL")
+     ins = b"\xef\xf3\x08\x82"
+-    b = pyvex.block.IRSB(ins, 1, p.arch)
++    b = pyvex.block.IRSB(ins, 1, arch)
+     assert b.jumpkind == "Ijk_Boring"
+     assert type(b.statements[1].data) == pyvex.expr.Get
+-    assert p.arch.register_names.get(b.statements[1].data.offset, "") == "sp"
++    assert arch.register_names.get(b.statements[1].data.offset, "") == "sp"
+     assert type(b.statements[2]) == pyvex.stmt.Put
+ 
+ 
+ def test_tmsr():
+-    test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
+-    p = angr.Project(
+-        os.path.join(test_location, "armel", "helloworld"),
+-        arch="ARMEL",
+-        auto_load_libs=False,
+-    )
++    arch = archinfo.arch_from_id("ARMEL")
+     inss = b"\x82\xf3\x08\x88"
+-    b = pyvex.block.IRSB(inss, 1, p.arch, opt_level=3)
++    b = pyvex.block.IRSB(inss, 1, arch, opt_level=3)
+     assert b.jumpkind == "Ijk_Boring"
+     assert type(b.statements[1].data) == pyvex.expr.Get
+-    assert p.arch.register_names.get(b.statements[1].data.offset, "") == "r2"
++    assert arch.register_names.get(b.statements[1].data.offset, "") == "r2"
+     assert type(b.statements[2]) == pyvex.stmt.Put
+ 
+ 
+ if __name__ == "__main__":
+     test_basic()
+     test_embedded()
+-    test_full_binary()
+     test_tmrs()
+     test_tmsr()
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 58a6855850..392df37f2b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -189,6 +189,7 @@ (define-module (gnu packages python-xyz)
   #:use-module (gnu packages djvu)
   #:use-module (gnu packages docker)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages emulators)
   #:use-module (gnu packages enchant)
   #:use-module (gnu packages file)
   #:use-module (gnu packages fonts)
@@ -32303,6 +32304,42 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-pyvex
+  (package
+    (name "python-pyvex")
+    ;; Must be the same version as python-angr.
+    (version "9.2.46")
+    (source
+     (origin
+       (method url-fetch)
+       (patches (search-patches "python-pyvex-remove-angr-dependency.patch"))
+       (uri (pypi-uri "pyvex" version))
+       (sha256
+        (base32 "1v64rn7gxy6fg065bgsy38z6r494k5ri5r6sn4g08hjj32ihx1ka"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (replace 'check
+                     (lambda* (#:key tests? #:allow-other-keys)
+                       (when tests?
+                         (with-directory-excursion "tests"
+                           (invoke "python" "-m" "unittest")))))
+
+                   (add-before 'build 'set-cc-native
+                     (lambda _
+                       (setenv "CC" #$(cc-for-target))
+                       (setenv "CC_NATIVE" "gcc"))))))
+    (propagated-inputs (list python-archinfo python-bitstring python-cffi))
+    (home-page "https://github.com/angr/pyvex")
+    (synopsis "Python interface to libVEX and VEX IR")
+    (description
+     "This package provides a Python interface the libVEX and VEX IR.
+VEX is the intermediate representation (also known as intermediate
+language) used by the Valgrind analysis tool.  As such, VEX is designed
+to enable all kinds of binary analysis tasks.")
+    (license license:bsd-2)))
+
 (define-public python-claripy
   (package
     (name "python-claripy")




^ permalink raw reply related	[relevance 66%]

* [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle.
    2024-02-12 14:58 81% ` [bug#69074] [PATCH] gnu: Add python-pysmt Troy Figiel
  2024-02-12 14:58 69% ` [bug#69074] [PATCH] gnu: Add python-angr Troy Figiel
@ 2024-03-10 20:09 61% ` soeren
  2024-03-10 20:09 65%   ` [bug#69074] [PATCH v2 03/14] gnu: Add python-mulpyplexer soeren
                     ` (9 more replies)
  2 siblings, 10 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c68b17b0ab..e630bdb6a6 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -146,6 +146,7 @@
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2023 Attila Lendvai <attila@lendvai.name>
 ;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32302,6 +32303,36 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-itanium-demangle
+  (package
+    (name "python-itanium-demangle")
+    (version "1.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/whitequark/python-itanium_demangler")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1q47aqm5z3db6pasdzw05d6236vnb8hnapfy88fcmn9dr5ym98r3"))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (with-directory-excursion "tests"
+                          (invoke "python" "-m" "unittest"))))))))
+    (home-page "https://github.com/whitequark/python-itanium_demangler")
+    (synopsis "Pure Python Itanium C++ ABI demangler")
+    (description
+     "This Python module provides an implementation of the Itanium C++
+ABI symbol mangling language.  The demangler generates an abstract
+syntax tree from mangled symbols, which can be used for directly
+extracting type information.")
+    (license license:bsd-0)))
+
 (define-public python-peachpy
   ;; There is no tag in this repo.
   (let ((commit "913d74c35a6b1d330e90bfc055208ce5b06b35a0")

base-commit: 179bb57d2532ee6b81791e078b0f782cbf88cb84




^ permalink raw reply related	[relevance 61%]

* [bug#69074] [PATCH v2 05/14] gnu: Add python-rpyc.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
  2024-03-10 20:09 65%   ` [bug#69074] [PATCH v2 03/14] gnu: Add python-mulpyplexer soeren
  2024-03-10 20:09 65%   ` [bug#69074] [PATCH v2 04/14] gnu: Add python-nampa soeren
@ 2024-03-10 20:09 61%   ` soeren
  2024-03-10 20:09 62%   ` [bug#69074] [PATCH v2 06/14] gnu: Add python-pysmt soeren
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-rpyc): 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 f713e27c64..f9bd733ecd 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,45 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-rpyc
+  (package
+    (name "python-rpyc")
+    (version "5.3.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tomerfiliba-org/rpyc")
+             (commit version)))
+       (sha256
+        (base32 "15mnp9qkyw3mmxmr5y4kf3xkvxyp00n892vqaqwznr7al35apgnr"))
+       (snippet '(begin
+                   ;; Disable deploy tests, these rely on OpenSSH and require
+                   ;; configuring the SSH client manually to accept the host key.
+                   (delete-file "tests/test_deploy.py")
+                   ;; Disable tests requiring network access.  These tests
+                   ;; presently fail with the error "Network is unreachable".
+                   (delete-file "tests/test_registry.py")))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (with-directory-excursion "tests"
+                          (invoke "python" "-m" "unittest"))))))))
+    (propagated-inputs (list python-hatchling python-plumbum))
+    (home-page "https://github.com/tomerfiliba-org/rpyc")
+    (synopsis
+     "Remote Python Call (RPyC) is a symmetric distributed computing library")
+    (description
+     "This Python module enables remote procedure calls, clustering, and
+distributed-computing.  For this purpose, it makes use of object-proxying, a technique
+that employs python's dynamic nature, to overcome the physical boundaries between
+processes and computers, so that remote objects can be manipulated as if they
+were local.")
+    (license license:expat)))
+
 (define-public python-nampa
   (package
     (name "python-nampa")




^ permalink raw reply related	[relevance 61%]

* [bug#69074] [PATCH v2 07/14] gnu: Add python-claripy.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
                     ` (3 preceding siblings ...)
  2024-03-10 20:09 62%   ` [bug#69074] [PATCH v2 06/14] gnu: Add python-pysmt soeren
@ 2024-03-10 20:09 62%   ` soeren
  2024-03-10 20:09 66%   ` [bug#69074] [PATCH v2 09/14] gnu: Add python-pyvex soeren
                     ` (4 subsequent siblings)
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-claripy): 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 0c6265f60e..58a6855850 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,45 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-claripy
+  (package
+    (name "python-claripy")
+    ;; Must be the same version as python-angr.
+    (version "9.2.46")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/angr/claripy")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0nmawpi1596d9plafrp2db36cjsidy2fagkzkja51jwlx2m1ngai"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   (substitute* "setup.cfg"
+                     ;; Relax the z3 version constraint.
+                     ;; See https://github.com/angr/claripy/commit/d1fe2df
+                     (("z3-solver==4.10.2.0")
+                      ""))))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys)
+                      (when tests?
+                        (with-directory-excursion "tests"
+                          (invoke "python" "-m" "unittest"))))))))
+    (propagated-inputs (list python-cachetools python-decorator python-pysmt
+                             z3))
+    (home-page "https://github.com/angr/claripy")
+    (synopsis "Abstraction layer for constraint solvers")
+    (description
+     "This Python module provides an abstraction layer for interacting
+with constraint solvers.  Specifically, it is intended to be used with
+SMT solvers and is built on top of the Z3 solver.")
+    (license license:bsd-2)))
+
 (define-public python-pysmt
   (package
     (name "python-pysmt")




^ permalink raw reply related	[relevance 62%]

* [bug#69074] [PATCH v2 06/14] gnu: Add python-pysmt.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
                     ` (2 preceding siblings ...)
  2024-03-10 20:09 61%   ` [bug#69074] [PATCH v2 05/14] gnu: Add python-rpyc soeren
@ 2024-03-10 20:09 62%   ` soeren
  2024-03-10 20:09 62%   ` [bug#69074] [PATCH v2 07/14] gnu: Add python-claripy soeren
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/patches/python-pysmt-fix-pow-return-type.patch:
New patch.
* gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/python-xyz.scm (python-pysmt): New variable.
---
 gnu/local.mk                                  |   2 +
 .../python-pysmt-fix-pow-return-type.patch    | 258 ++++++++++++++++++
 ...-pysmt-fix-smtlib-serialization-test.patch |  86 ++++++
 gnu/packages/python-xyz.scm                   |  32 +++
 4 files changed, 378 insertions(+)
 create mode 100644 gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
 create mode 100644 gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index fbdb285695..1946fdcbb6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1925,6 +1925,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyan3-fix-absolute-path-bug.patch \
   %D%/packages/patches/python-pyan3-fix-positional-arguments.patch \
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch	\
+  %D%/packages/patches/python-pysmt-fix-pow-return-type.patch	\
+  %D%/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch	\
   %D%/packages/patches/python-pytorch-runpath.patch		\
   %D%/packages/patches/python-pytorch-system-libraries.patch	\
   %D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
diff --git a/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch b/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
new file mode 100644
index 0000000000..0ec2d41b3c
--- /dev/null
+++ b/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
@@ -0,0 +1,258 @@
+Backport of an upstream patch which fixes a test failure with our
+packaged version of the Z3 SMT solver.
+
+Taken from: https://github.com/pysmt/pysmt/commit/f522e8cd8f3e75ff85f5eae29b427e18a6701859
+
+diff --git a/pysmt/formula.py b/pysmt/formula.py
+index ea4b46c..6cb9cbf 100644
+--- a/pysmt/formula.py
++++ b/pysmt/formula.py
+@@ -252,11 +252,7 @@ class FormulaManager(object):
+ 
+         if base.is_constant():
+             val = base.constant_value() ** exponent.constant_value()
+-            if base.is_constant(types.REAL):
+-                return self.Real(val)
+-            else:
+-                assert base.is_constant(types.INT)
+-                return self.Int(val)
++            return self.Real(val)
+         return self.create_node(node_type=op.POW, args=(base, exponent))
+ 
+     def Div(self, left, right):
+diff --git a/pysmt/logics.py b/pysmt/logics.py
+index ef88dd6..9dc45b1 100644
+--- a/pysmt/logics.py
++++ b/pysmt/logics.py
+@@ -495,6 +495,12 @@ QF_NRA = Logic(name="QF_NRA",
+                real_arithmetic=True,
+                linear=False)
+ 
++QF_NIRA = Logic(name="QF_NIRA",
++                description="""Quantifier-free integer and real arithmetic.""",
++                quantifier_free=True,
++                integer_arithmetic=True,
++                real_arithmetic=True,
++                linear=False)
+ 
+ QF_RDL = Logic(name="QF_RDL",
+                description=\
+@@ -619,41 +625,41 @@ QF_AUFBVLIRA = Logic(name="QF_AUFBVLIRA",
+ AUTO = Logic(name="Auto",
+              description="Special logic used to indicate that the logic to be used depends on the formula.")
+ 
+-SMTLIB2_LOGICS = frozenset([ AUFLIA,
+-                             AUFLIRA,
+-                             AUFNIRA,
+-                             ALIA,
+-                             LRA,
+-                             LIA,
+-                             NIA,
+-                             NRA,
+-                             UFLRA,
+-                             UFNIA,
+-                             UFLIRA,
+-                             QF_ABV,
+-                             QF_AUFBV,
+-                             QF_AUFLIA,
+-                             QF_ALIA,
+-                             QF_AX,
+-                             QF_BV,
+-                             QF_IDL,
+-                             QF_LIA,
+-                             QF_LRA,
+-                             QF_NIA,
+-                             QF_NRA,
+-                             QF_RDL,
+-                             QF_UF,
+-                             QF_UFBV ,
+-                             QF_UFIDL,
+-                             QF_UFLIA,
+-                             QF_UFLRA,
+-                             QF_UFNRA,
+-                             QF_UFNIA,
+-                             QF_UFLIRA,
+-                             QF_SLIA
+-                         ])
+-
+-LOGICS = SMTLIB2_LOGICS | frozenset([ QF_BOOL, BOOL, QF_AUFBVLIRA])
++SMTLIB2_LOGICS = frozenset([AUFLIA,
++                            AUFLIRA,
++                            AUFNIRA,
++                            ALIA,
++                            LRA,
++                            LIA,
++                            NIA,
++                            NRA,
++                            UFLRA,
++                            UFNIA,
++                            UFLIRA,
++                            QF_ABV,
++                            QF_AUFBV,
++                            QF_AUFLIA,
++                            QF_ALIA,
++                            QF_AX,
++                            QF_BV,
++                            QF_IDL,
++                            QF_LIA,
++                            QF_LRA,
++                            QF_NIA,
++                            QF_NRA,
++                            QF_RDL,
++                            QF_UF,
++                            QF_UFBV,
++                            QF_UFIDL,
++                            QF_UFLIA,
++                            QF_UFLRA,
++                            QF_UFNRA,
++                            QF_UFNIA,
++                            QF_UFLIRA,
++                            QF_SLIA
++                            ])
++
++LOGICS = SMTLIB2_LOGICS | frozenset([QF_BOOL, BOOL, QF_AUFBVLIRA, QF_NIRA])
+ 
+ QF_LOGICS = frozenset(_l for _l in LOGICS if _l.quantifier_free)
+ 
+@@ -668,8 +674,8 @@ PYSMT_LOGICS = frozenset([QF_BOOL, QF_IDL, QF_LIA, QF_LRA, QF_RDL, QF_UF, QF_UFI
+                           QF_BV, QF_UFBV,
+                           QF_ABV, QF_AUFBV, QF_AUFLIA, QF_ALIA, QF_AX,
+                           QF_AUFBVLIRA,
+-                          QF_NRA, QF_NIA, UFBV, BV,
+-                      ])
++                          QF_NRA, QF_NIA, QF_NIRA, UFBV, BV,
++                          ])
+ 
+ # PySMT Logics includes additional features:
+ #  - constant arrays: QF_AUFBV  becomes QF_AUFBV*
+@@ -697,7 +703,6 @@ for l in PYSMT_LOGICS:
+         ext_logics.add(nl)
+ 
+ 
+-
+ LOGICS = LOGICS | frozenset(ext_logics)
+ PYSMT_LOGICS = PYSMT_LOGICS | frozenset(ext_logics)
+ 
+diff --git a/pysmt/solvers/z3.py b/pysmt/solvers/z3.py
+index 3fb42b9..210b771 100644
+--- a/pysmt/solvers/z3.py
++++ b/pysmt/solvers/z3.py
+@@ -595,6 +595,8 @@ class Z3Converter(Converter, DagWalker):
+                                              None, None,
+                                              0, None,
+                                              expr.ast)
++        print("Z3: SMTLIB")
++        print(s)
+         stream_in = StringIO(s)
+         r = parser.get_script(stream_in).get_last_formula(self.mgr)
+         key = (askey(expr), None)
+diff --git a/pysmt/test/examples.py b/pysmt/test/examples.py
+index 73455ee..b653185 100644
+--- a/pysmt/test/examples.py
++++ b/pysmt/test/examples.py
+@@ -898,12 +898,12 @@ def get_full_example_formulae(environment=None):
+                     logic=pysmt.logics.QF_NRA
+                 ),
+ 
+-            Example(hr="((p ^ 2) = 0)",
+-                    expr=Equals(Pow(p, Int(2)), Int(0)),
++            Example(hr="((p ^ 2) = 0.0)",
++                    expr=Equals(Pow(p, Int(2)), Real(0)),
+                     is_valid=False,
+                     is_sat=True,
+-                    logic=pysmt.logics.QF_NIA
+-                ),
++                    logic=pysmt.logics.QF_NIRA
++                    ),
+ 
+             Example(hr="((r ^ 2.0) = 0.0)",
+                     expr=Equals(Pow(r, Real(2)), Real(0)),
+diff --git a/pysmt/test/test_back.py b/pysmt/test/test_back.py
+index bceb45b..7a0ad63 100644
+--- a/pysmt/test/test_back.py
++++ b/pysmt/test/test_back.py
+@@ -55,10 +55,10 @@ class TestBasic(TestCase):
+         res = msat.converter.back(term)
+         self.assertFalse(f == res)
+ 
+-    def do_back(self, solver_name, z3_string_buffer=False):
++    def do_back(self, solver_name, via_smtlib=False):
+         for formula, _, _, logic in get_example_formulae():
+             if logic.quantifier_free:
+-                if logic.theory.custom_type and z3_string_buffer:
++                if logic.theory.custom_type and via_smtlib:
+                     # Printing of declare-sort from Z3 is not conformant
+                     # with the SMT-LIB. We might consider extending our
+                     # parser.
+@@ -67,7 +67,7 @@ class TestBasic(TestCase):
+                     s = Solver(name=solver_name, logic=logic)
+                     term = s.converter.convert(formula)
+                     if solver_name == "z3":
+-                        if z3_string_buffer:
++                        if via_smtlib:
+                             res = s.converter.back_via_smtlib(term)
+                         else:
+                             res = s.converter.back(term)
+@@ -84,8 +84,8 @@ class TestBasic(TestCase):
+ 
+     @skipIfSolverNotAvailable("z3")
+     def test_z3_back_formulae(self):
+-        self.do_back("z3", z3_string_buffer=False)
+-        self.do_back("z3", z3_string_buffer=True)
++        self.do_back("z3", via_smtlib=True)
++        self.do_back("z3", via_smtlib=False)
+ 
+ 
+ if __name__ == '__main__':
+diff --git a/pysmt/type_checker.py b/pysmt/type_checker.py
+index b700fcf..7ce05aa 100644
+--- a/pysmt/type_checker.py
++++ b/pysmt/type_checker.py
+@@ -33,6 +33,8 @@ class SimpleTypeChecker(walkers.DagWalker):
+ 
+     def __init__(self, env=None):
+         walkers.DagWalker.__init__(self, env=env)
++        # Return None if the type cannot be computed rather than
++        # raising an exception.
+         self.be_nice = False
+ 
+     def _get_key(self, formula, **kwargs):
+@@ -42,7 +44,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+         """ Returns the pysmt.types type of the formula """
+         res = self.walk(formula)
+         if not self.be_nice and res is None:
+-            raise PysmtTypeError("The formula '%s' is not well-formed" \
++            raise PysmtTypeError("The formula '%s' is not well-formed"
+                                  % str(formula))
+         return res
+ 
+@@ -114,7 +116,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+ 
+     def walk_bv_comp(self, formula, args, **kwargs):
+         # We check that all children are BV and the same size
+-        a,b = args
++        a, b = args
+         if a != b or (not a.is_bv_type()):
+             return None
+         return BVType(1)
+@@ -187,7 +189,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+         if args[0].is_bool_type():
+             raise PysmtTypeError("The formula '%s' is not well-formed."
+                                  "Equality operator is not supported for Boolean"
+-                                 " terms. Use Iff instead." \
++                                 " terms. Use Iff instead."
+                                  % str(formula))
+         elif args[0].is_bv_type():
+             return self.walk_bv_to_bool(formula, args)
+@@ -324,10 +326,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+     def walk_pow(self, formula, args, **kwargs):
+         if args[0] != args[1]:
+             return None
+-        # Exponent must be positive for INT
+-        if args[0].is_int_type() and formula.arg(1).constant_value() < 0 :
+-            return None
+-        return args[0]
++        return REAL
+ 
+ # EOC SimpleTypeChecker
+ 
diff --git a/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch b/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch
new file mode 100644
index 0000000000..eee555f807
--- /dev/null
+++ b/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch
@@ -0,0 +1,86 @@
+Backport of an upstream patch fixing a test suite failure.
+
+Taken from: https://github.com/pysmt/pysmt/commit/a246669a487aff69f5da34570ef867841d18508a
+
+diff --git a/pysmt/test/smtlib/test_parser_examples.py b/pysmt/test/smtlib/test_parser_examples.py
+index cca4194..c0852be 100644
+--- a/pysmt/test/smtlib/test_parser_examples.py
++++ b/pysmt/test/smtlib/test_parser_examples.py
+@@ -29,6 +29,7 @@ from pysmt.shortcuts import Iff
+ from pysmt.shortcuts import read_smtlib, write_smtlib, get_env
+ from pysmt.exceptions import PysmtSyntaxError
+ 
++
+ class TestSMTParseExamples(TestCase):
+ 
+     def test_parse_examples(self):
+@@ -41,7 +42,6 @@ class TestSMTParseExamples(TestCase):
+             buf = StringIO()
+             script_out = smtlibscript_from_formula(f_out)
+             script_out.serialize(outstream=buf)
+-            #print(buf)
+ 
+             buf.seek(0)
+             parser = SmtLibParser()
+@@ -49,7 +49,6 @@ class TestSMTParseExamples(TestCase):
+             f_in = script_in.get_last_formula()
+             self.assertEqual(f_in.simplify(), f_out.simplify())
+ 
+-
+     @skipIfNoSolverForLogic(logics.QF_BV)
+     def test_parse_examples_bv(self):
+         """For BV we represent a superset of the operators defined in SMT-LIB.
+@@ -108,7 +107,18 @@ class TestSMTParseExamples(TestCase):
+             self.assertValid(Iff(f_in, f_out), f_in.serialize())
+ 
+     def test_dumped_logic(self):
+-        # Dumped logic matches the logic in the example
++        # Dumped logic matches the logic in the example.
++        #
++        # There are a few cases where we use a logic
++        # that does not exist in SMT-LIB, and the SMT-LIB
++        # serialization logic will find a logic that
++        # is more expressive. We need to adjust the test
++        # for those cases (see rewrite dict below).
++        rewrite = {
++            logics.QF_BOOL: logics.QF_UF,
++            logics.BOOL: logics.LRA,
++            logics.QF_NIRA: logics.AUFNIRA,
++        }
+         fs = get_example_formulae()
+ 
+         for (f_out, _, _, logic) in fs:
+@@ -121,14 +131,9 @@ class TestSMTParseExamples(TestCase):
+             for cmd in script_in:
+                 if cmd.name == "set-logic":
+                     logic_in = cmd.args[0]
+-                    if logic == logics.QF_BOOL:
+-                        self.assertEqual(logic_in, logics.QF_UF)
+-                    elif logic == logics.BOOL:
+-                        self.assertEqual(logic_in, logics.LRA)
+-                    else:
+-                        self.assertEqual(logic_in, logic, script_in)
++                    self.assertEqual(logic_in, rewrite.get(logic, logic))
+                     break
+-            else: # Loops exited normally
++            else:  # Loops exited normally
+                 print("-"*40)
+                 print(script_in)
+ 
+@@ -136,7 +141,7 @@ class TestSMTParseExamples(TestCase):
+         fs = get_example_formulae()
+ 
+         fdi, tmp_fname = mkstemp()
+-        os.close(fdi) # Close initial file descriptor
++        os.close(fdi)  # Close initial file descriptor
+         for (f_out, _, _, _) in fs:
+             write_smtlib(f_out, tmp_fname)
+             # with open(tmp_fname) as fin:
+@@ -197,7 +202,6 @@ class TestSMTParseExamples(TestCase):
+         f_in = script.get_last_formula()
+         self.assertSat(f_in)
+ 
+-
+     def test_int_promotion_define_fun(self):
+         script = """
+         (define-fun x () Int 8)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f9bd733ecd..0c6265f60e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,38 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-pysmt
+  (package
+    (name "python-pysmt")
+    (version "0.9.5")
+    (source
+     (origin
+       (method git-fetch)
+       (patches (search-patches "python-pysmt-fix-pow-return-type.patch"
+                 "python-pysmt-fix-smtlib-serialization-test.patch"))
+       (uri (git-reference
+             (url "https://github.com/pysmt/pysmt")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0hrxv23y5ip4ijfx5pvbwc2fq4zg9jz42wc9zqgqm0g0mjc9ckvh"))))
+    (build-system pyproject-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (add-before 'check 'set-pysmt-solver
+                    (lambda _
+                      (setenv "PYSMT_SOLVER" "z3"))))))
+    (native-inputs (list python-pytest))
+    (propagated-inputs (list z3))
+    (home-page "https://github.com/pysmt/pysmt")
+    (synopsis
+     "Solver-agnostic library for SMT formula manipulation and solving")
+    (description
+     "This Python module provides a solver-agnostic abstraction for
+working with @acronym{SMT, Satisfiability Modulo Theory} formulas.  For example,
+it allows manipulation and solving such formulas.")
+    (license license:asl2.0)))
+
 (define-public python-rpyc
   (package
     (name "python-rpyc")




^ permalink raw reply related	[relevance 62%]

* [bug#69074] [PATCH v2 04/14] gnu: Add python-nampa.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
  2024-03-10 20:09 65%   ` [bug#69074] [PATCH v2 03/14] gnu: Add python-mulpyplexer soeren
@ 2024-03-10 20:09 65%   ` soeren
  2024-03-10 20:09 61%   ` [bug#69074] [PATCH v2 05/14] gnu: Add python-rpyc soeren
                     ` (7 subsequent siblings)
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ddb0224b53..f713e27c64 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,26 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-nampa
+  (package
+    (name "python-nampa")
+    (version "0.1.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "nampa" version))
+       (sha256
+        (base32 "0k6cq2gflpkm40qhgqbbcjmq5lq589c15bmk567qyh3d08062hvd"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-future))
+    (home-page "https://github.com/thebabush/nampa")
+    (synopsis "Python implementation of IDA Pro's FLIRT technology")
+    (description
+     "This Python module implements the @acronym{FLIRT, Fast Library Identification
+and Recognition Technology}.  This technology is useful for identifying
+common library subroutines in disassembled binaries.")
+    (license license:lgpl3)))
+
 (define-public python-mulpyplexer
   (package
     (name "python-mulpyplexer")




^ permalink raw reply related	[relevance 65%]

* [bug#69074] [PATCH v2 10/14] gnu: Add python-cle.
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
                     ` (5 preceding siblings ...)
  2024-03-10 20:09 66%   ` [bug#69074] [PATCH v2 09/14] gnu: Add python-pyvex soeren
@ 2024-03-10 20:09 63%   ` soeren
  2024-03-10 20:09 64%   ` [bug#69074] [PATCH v2 11/14] gnu: Add python-ailment soeren
                     ` (2 subsequent siblings)
  9 siblings, 0 replies; 200+ results
From: soeren @ 2024-03-10 20:09 UTC (permalink / raw)
  To: 69074
  Cc: troy, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-cle): New variable.
---
 gnu/packages/python-xyz.scm | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 392df37f2b..76f115f6d0 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32304,6 +32304,32 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-cle
+  (package
+    (name "python-cle")
+    ;; Must be the same version as python-angr.
+    (version "9.2.46")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cle" version))
+       (sha256
+        (base32 "0mswv9gd2p2ws7zfsshqv5ybbj27wkdwakdcknq4vsrx9ry9k4yc"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:tests? #f))
+    (propagated-inputs (list python-pefile python-pyelftools python-pyvex
+                             python-sortedcontainers))
+    (native-inputs (list python-cffi))
+    (home-page "https://github.com/angr/cle")
+    (synopsis "Python loader for binaries and their associated libraries")
+    (description
+     "CLE loads binaries and their associated libraries, resolves
+imports and provides an abstraction of process memory the same way as if
+it was loader by the operating system's loader.")
+    (license license:bsd-2)))
+
 (define-public python-pyvex
   (package
     (name "python-pyvex")
@@ -32326,7 +32352,7 @@ (define-public python-pyvex
                          (with-directory-excursion "tests"
                            (invoke "python" "-m" "unittest")))))
 
-                   (add-before 'build 'set-cc-native
+                   (add-before 'build 'set-cc
                      (lambda _
                        (setenv "CC" #$(cc-for-target))
                        (setenv "CC_NATIVE" "gcc"))))))




^ permalink raw reply related	[relevance 63%]

* [bug#60240] [PATCH v5] gnu: Add python-3.12 and python-next.
                     ` (2 preceding siblings ...)
  2024-03-07 18:45 34% ` [bug#60240] [PATCH v4] " Tanguy Le Carrour
@ 2024-03-07 18:58 35% ` Tanguy Le Carrour
  3 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-03-07 18:58 UTC (permalink / raw)
  To: 60240
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

Patch v5 **actually** contains **all** the modifications announced
in v4. Sooooorry!

* gnu/packages/python.scm (python-3.12, python-next): New variables.
* gnu/packages/patches/python-3.12-fix-tests.patch: New file.

Change-Id: Ie393b732a8863569578e72e62603b75a1655a34e
Signed-off-by: Tanguy Le Carrour <tanguy@bioneland.org>
---
 .../patches/python-3.12-fix-tests.patch       | 334 +++++++++++++++
 gnu/packages/python.scm                       | 387 +++++++++++++++++-
 2 files changed, 720 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/python-3.12-fix-tests.patch

diff --git a/gnu/packages/patches/python-3.12-fix-tests.patch b/gnu/packages/patches/python-3.12-fix-tests.patch
new file mode 100644
index 0000000000..fa5c8027ce
--- /dev/null
+++ b/gnu/packages/patches/python-3.12-fix-tests.patch
@@ -0,0 +1,334 @@
+From f0698133e7d6c353a3e6ae0fc62e57ba558a9bc0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 28 Oct 2020 22:55:05 -0400
+Subject: [PATCH] Skip problematic Python 3 tests in Guix.
+
+A subset of the hunks in this patch is tracked upstream at
+https://bugs.python.org/issue38845, which was contributed by Tanguy Le
+Carrour <tanguy@bioneland.org>.
+
+diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
+index e42c7ab4bd..8087c84dab 100644
+--- a/Lib/test/_test_multiprocessing.py
++++ b/Lib/test/_test_multiprocessing.py
+@@ -1695,6 +1695,7 @@ def _test_wait_result(cls, c, pid):
+         if pid is not None:
+             os.kill(pid, signal.SIGINT)
+
++    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
+     def test_wait_result(self):
+         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
+             pid = os.getpid()
+@@ -4150,6 +4151,7 @@ def test_shared_memory_across_processes(self):
+         sms.close()
+
+     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
+         # bpo-36368: protect SharedMemoryManager server process from
+         # KeyboardInterrupt signals.
+diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
+index 85c8152d49..e35cfffe84 100644
+--- a/Lib/test/test_asyncio/test_base_events.py
++++ b/Lib/test/test_asyncio/test_base_events.py
+@@ -1377,6 +1377,8 @@ def test_create_connection_no_inet_pton(self, m_socket):
+         self._test_create_connection_ip_addr(m_socket, False)
+
+     @patch_socket
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_create_connection_service_name(self, m_socket):
+         m_socket.getaddrinfo = socket.getaddrinfo
+         sock = m_socket.socket.return_value
+diff --git a/Lib/test/test_ctypes/test_find.py b/Lib/test/test_ctypes/test_find.py
+index a41e94971d..1291af3057 100644
+--- a/Lib/test/test_ctypes/test_find.py
++++ b/Lib/test/test_ctypes/test_find.py
+@@ -117,6 +117,7 @@ def test_find_library_with_gcc(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
+             self.assertNotEqual(find_library('c'), None)
+
++    @unittest.skipIf(True, 'Fails on Guix.')
+     def test_find_library_with_ld(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
+              unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
+diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
+index 1ee9958445..ab6b41befe 100644
+--- a/Lib/test/test_generators.py
++++ b/Lib/test/test_generators.py
+@@ -34,6 +34,7 @@ def generator2(self):
+         else:
+             return "FAILED"
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
+     def test_raise_and_yield_from(self):
+         gen = self.generator1()
+         gen.send(None)
+diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
+index ec105ae1a0..ae4c5b672e 100644
+--- a/Lib/test/test_pathlib.py
++++ b/Lib/test/test_pathlib.py
+@@ -3069,6 +3069,7 @@ def test_rglob(self):
+                          'pwd module does not expose getpwall()')
+     @unittest.skipIf(sys.platform == "vxworks",
+                      "no home directory on VxWorks")
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         import_helper.import_module('pwd')
+diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
+index 51b844262e..004d3133cf 100644
+--- a/Lib/test/test_pdb.py
++++ b/Lib/test/test_pdb.py
+@@ -1580,6 +1580,7 @@ def test_pdb_next_command_subiterator():
+     (Pdb) continue
+     """
+
++@unittest.skipIf(True, 'Fails on Guix… but skipIf not taken into account?!')
+ def test_pdb_issue_20766():
+     """Test for reference leaks when the SIGINT handler is set.
+
+@@ -1598,11 +1599,11 @@ def test_pdb_issue_20766():
+     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
+     (Pdb) continue
+-    pdb 1: <built-in function default_int_handler>
++    pdb 1: 1
+     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
+     (Pdb) continue
+-    pdb 2: <built-in function default_int_handler>
++    pdb 2: 1
+     """
+
+ def test_pdb_issue_43318():
+diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index 2ab6f6a986..8cf6b4d1c8 100644
+--- a/Lib/test/test_regrtest.py
++++ b/Lib/test/test_regrtest.py
+@@ -1049,6 +1049,7 @@ def test_fromfile(self):
+         output = self.run_tests('--fromfile', filename)
+         self.check_executed_tests(output, tests, stats=stats)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_interrupted(self):
+         code = TEST_INTERRUPTED
+         test = self.create_test('sigint', code=code)
+@@ -1066,6 +1067,7 @@ def test_slowest(self):
+                  % (self.TESTNAME_REGEX, len(tests)))
+         self.check_line(output, regex)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_slowest_interrupted(self):
+         # Issue #25373: test --slowest with an interrupted test
+         code = TEST_INTERRUPTED
+diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
+index 317e7ca8f8..7f272daf24 100644
+--- a/Lib/test/test_resource.py
++++ b/Lib/test/test_resource.py
+@@ -151,6 +151,7 @@ def test_freebsd_contants(self):
+
+     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
+     @support.requires_linux_version(2, 6, 36)
++    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
+     def test_prlimit(self):
+         self.assertRaises(TypeError, resource.prlimit)
+         self.assertRaises(ProcessLookupError, resource.prlimit,
+diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+index bf60f37934..5e3a96380a 100644
+--- a/Lib/test/test_shutil.py
++++ b/Lib/test/test_shutil.py
+@@ -1743,6 +1743,7 @@ def test_make_archive(self):
+         base_name = os.path.join(tmpdir, 'archive')
+         self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
+     def test_make_archive_owner_group(self):
+         # testing make_archive with owner and group, with various combinations
+@@ -1771,6 +1772,7 @@ def test_make_archive_owner_group(self):
+         self.assertTrue(os.path.isfile(res))
+
+
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
+     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+     def test_tarfile_root_owner(self):
+diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
+index 637a0ca3b3..2fb804e340 100644
+--- a/Lib/test/test_signal.py
++++ b/Lib/test/test_signal.py
+@@ -160,6 +160,7 @@ def test_valid_signals(self):
+                 self.assertLess(signum, signal.NSIG)
+
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @support.requires_subprocess()
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers exit via SIGINT."""
+@@ -211,6 +212,7 @@ def test_issue9324(self):
+             signal.signal(7, handler)
+
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @support.requires_subprocess()
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
+@@ -1407,6 +1409,7 @@ def cycle_handlers():
+
+ class RaiseSignalTest(unittest.TestCase):
+
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_sigint(self):
+         with self.assertRaises(KeyboardInterrupt):
+             signal.raise_signal(signal.SIGINT)
+@@ -1452,6 +1455,7 @@ def __del__(self):
+
+ class PidfdSignalTest(unittest.TestCase):
+
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @unittest.skipUnless(
+         hasattr(signal, "pidfd_send_signal"),
+         "pidfd support not built in",
+diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+index 4eb5af99d6..9c7b8f6dbc 100644
+--- a/Lib/test/test_socket.py
++++ b/Lib/test/test_socket.py
+@@ -1016,6 +1016,8 @@ def testHostnameRes(self):
+         if not fqhn in all_host_names:
+             self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
+
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_host_resolution(self):
+         for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']:
+             self.assertEqual(socket.gethostbyname(addr), addr)
+@@ -1161,6 +1163,8 @@ def testNtoHErrors(self):
+             self.assertRaises(OverflowError, socket.ntohl, k)
+             self.assertRaises(OverflowError, socket.htonl, k)
+
++    @unittest.skipUnless(os.path.exists("/etc/services"),
++                         "getservbyname uses /etc/services, which is not in the chroot")
+     def testGetServBy(self):
+         eq = self.assertEqual
+         # Find one service that exists, then check all the related interfaces.
+@@ -1521,6 +1525,8 @@ def test_sio_loopback_fast_path(self):
+             raise
+         self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
+
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     def testGetaddrinfo(self):
+         try:
+             socket.getaddrinfo('localhost', 80)
+@@ -1653,6 +1659,8 @@ def test_getnameinfo(self):
+         # only IP addresses are allowed
+         self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
+
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     @unittest.skipUnless(support.is_resource_enabled('network'),
+                          'network is not enabled')
+     def test_idna(self):
+diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+index 50766c2548..0c7eb7a83a 100644
+--- a/Lib/test/test_spwd.py
++++ b/Lib/test/test_spwd.py
+@@ -9,8 +9,7 @@
+     spwd = import_helper.import_module('spwd')
+
+
+-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
+-                     'root privileges required')
++@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
+ class TestSpwdRoot(unittest.TestCase):
+
+     def test_getspall(self):
+@@ -60,8 +59,7 @@ def test_getspnam(self):
+             self.assertRaises(TypeError, spwd.getspnam, bytes_name)
+
+
+-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
+-                     'non-root user required')
++@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
+ class TestSpwdNonRoot(unittest.TestCase):
+
+     def test_getspnam_exception(self):
+diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
+index 71489ea493..33351919fe 100644
+--- a/Lib/test/test_tarfile.py
++++ b/Lib/test/test_tarfile.py
+@@ -2911,9 +2911,12 @@ def root_is_uid_gid_0():
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+
+diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+index 00d9e591c7..2515603715 100644
+--- a/Lib/test/test_threading.py
++++ b/Lib/test/test_threading.py
+@@ -1962,6 +1962,7 @@ def check_interrupt_main_noerror(self, signum):
+             # Restore original handler
+             signal.signal(signum, handler)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_subthread(self):
+         # Calling start_new_thread with a function that executes interrupt_main
+         # should raise KeyboardInterrupt upon completion.
+@@ -1973,6 +1974,8 @@ def call_interrupt():
+             t.join()
+         t.join()
+
++
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_mainthread(self):
+         # Make sure that if interrupt_main is called in main thread that
+         # KeyboardInterrupt is raised instantly.
+diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py
+index 0e7ed67de7..6539a2983b 100644
+--- a/Lib/test/test_tools/test_freeze.py
++++ b/Lib/test/test_tools/test_freeze.py
+@@ -23,6 +23,7 @@
+                  'test is too slow with PGO')
+ class TestFreeze(unittest.TestCase):
+
++    @unittest.skipIf(True, 'Fails on Guix.')
+     @support.requires_resource('cpu') # Building Python is slow
+     def test_freeze_simple_script(self):
+         script = textwrap.dedent("""
+diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
+index 515c3840cb..a96dfad0fe 100644
+--- a/Lib/test/test_unicodedata.py
++++ b/Lib/test/test_unicodedata.py
+@@ -342,6 +342,7 @@ def test_linebreak_7643(self):
+                 self.assertEqual(len(lines), 1,
+                                  r"\u%.4x should not be a linebreak" % i)
+
++@requires_resource('network')
+ class NormalizationTest(unittest.TestCase):
+     @staticmethod
+     def check_version(testfile):
+diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+index 445a34ae3e..8f750537c3 100644
+--- a/Tools/scripts/run_tests.py
++++ b/Tools/scripts/run_tests.py
+@@ -69,7 +69,7 @@ def main(regrtest_args):
+         else:
+             args.extend(['-j', '0'])  # Use all CPU cores
+     if not any(is_resource_use_flag(arg) for arg in regrtest_args):
+-        args.extend(['-u', 'all,-largefile,-audio,-gui'])
++        args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
+
+     if cross_compile and hostrunner:
+         # If HOSTRUNNER is set and -p/--python option is not given, then
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 51d5f598d7..df3ea7ca9a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -55,7 +55,7 @@
 ;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
 ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
-;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2024 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
@@ -596,6 +596,391 @@ (define-public python-3.10
             (variable "PYTHONTZPATH")
             (files (list "share/zoneinfo")))))))
 
+(define-public python-3.12
+  (package
+    (name "python-next")
+    (version "3.12.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.python.org/ftp/python/" version
+                           "/Python-" version ".tar.xz"))
+       (sha256
+        (base32 "0w6qyfhc912xxav9x9pifwca40b4l49vy52wai9j0gc1mhni2a5y"))
+       (patches (search-patches "python-3-deterministic-build-info.patch"
+                                "python-3.12-fix-tests.patch"
+                                "python-3-hurd-configure.patch"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Delete the bundled copy of libexpat.
+                   (delete-file-recursively "Modules/expat")
+                   (substitute* "Modules/Setup"
+                     ;; Link Expat instead of embedding the bundled one.
+                     (("^#pyexpat.*")
+                      "pyexpat pyexpat.c -lexpat\n"))
+                   ;; Delete windows binaries
+                   (for-each delete-file
+                             (find-files "Lib/distutils/command" "\\.exe$"))))))
+    (outputs '("out" "tk" ;tkinter; adds 50 MiB to the closure
+               "idle")) ;programming environment; weighs 5MB
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:configure-flags (list "--enable-shared" ;allow embedding
+                               "--with-system-expat" ;for XML support
+                               "--with-system-ffi" ;build ctypes
+                               "--with-ensurepip=install" ;install pip and setuptools
+                               "--with-computed-gotos" ;main interpreter loop optimization
+                               "--enable-unicode=ucs4"
+                               "--without-static-libpython"
+
+                               ;; FIXME: These flags makes Python significantly faster,
+                               ;; but leads to non-reproducible binaries.
+                               ;; "--with-lto"   ;increase size by 20MB, but 15% speedup
+                               ;; "--enable-optimizations"
+                               
+                               ;; Prevent the installed _sysconfigdata.py from retaining
+                               ;; a reference to coreutils.
+                               "INSTALL=install -c"
+                               "MKDIR_P=mkdir -p"
+
+                               ;; Disable runtime check failing if cross-compiling, see:
+                               ;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
+                               ,@(if (%current-target-system)
+                                     '("ac_cv_buggy_getaddrinfo=no"
+                                       "ac_cv_file__dev_ptmx=no"
+                                       "ac_cv_file__dev_ptc=no")
+                                     '())
+                               ;; -fno-semantic-interposition reinstates some
+                               ;; optimizations by gcc leading to around 15% speedup.
+                               ;; This is the default starting from python 3.10.
+                               "CFLAGS=-fno-semantic-interposition"
+                               (string-append "LDFLAGS=-Wl,-rpath="
+                                              (assoc-ref %outputs "out")
+                                              "/lib"
+                                              " -fno-semantic-interposition"))
+       ;; With no -j argument tests use all available cpus, so provide one.
+       #:make-flags (list (string-append (format #f "TESTOPTS=-j~d"
+                                                 (parallel-job-count))
+                           ;; those tests fail on low-memory systems
+                           " --exclude test_mmap test_socket test_threading test_asyncio"
+                           ,@(if (system-hurd?)
+                                 '(" test_posix" ;multiple errors
+                                   " test_time"
+                                   " test_pty"
+                                   " test_shutil"
+                                   " test_tempfile" ;chflags: invalid argument:
+                                   ;; tbv14c9t/dir0/dir0/dir0/test0.txt
+                                   " test_os" ;stty: 'standard input':
+                                   ;; Inappropriate ioctl for device
+                                   " test_openpty" ;No such file or directory
+                                   " test_selectors" ;assertEqual(NUM_FDS // 2, len(fds))
+                                   ;; 32752 != 4
+                                   " test_compileall" ;multiple errors
+                                   " test_poll" ;list index out of range
+                                   " test_subprocess" ;runs over 10min
+                                   " test_asyncore" ;multiple errors
+                                   " test_threadsignals"
+                                   " test_eintr" ;Process return code is -14
+                                   " test_io" ;multiple errors
+                                   " test_logging"
+                                   " test_signal"
+                                   " test_flags" ;ERROR
+                                   " test_bidirectional_pty"
+                                   " test_create_unix_connection"
+                                   " test_unix_sock_client_ops"
+                                   " test_open_unix_connection"
+                                   " test_open_unix_connection_error"
+                                   " test_read_pty_output"
+                                   " test_write_pty"
+                                   " test_concurrent_futures" ;freeze
+                                   " test_venv" ;freeze
+                                   " test_multiprocessing_forkserver" ;runs over 10min
+                                   " test_multiprocessing_spawn" ;runs over 10min
+                                   " test_builtin"
+                                   " test_capi"
+                                   " test_dbm_ndbm"
+                                   " test_exceptions"
+                                   " test_faulthandler"
+                                   " test_getopt"
+                                   " test_importlib"
+                                   " test_json"
+                                   " test_multiprocessing_fork"
+                                   " test_multiprocessing_main_handling"
+                                   " test_pdb "
+                                   " test_regrtest"
+                                   " test_sqlite")
+                                 '())))
+
+       #:modules ((ice-9 ftw)
+                  (ice-9 match)
+                  (guix build utils)
+                  (guix build gnu-build-system))
+
+       #:phases (modify-phases %standard-phases
+                  ,@(if (system-hurd?)
+                        `((add-after 'unpack
+                                     'disable-multi-processing
+                                     (lambda _
+                                       (substitute* "Makefile.pre.in"
+                                         (("-j0")
+                                          "-j1")))))
+                        '())
+                  (add-before 'configure 'patch-lib-shells
+                    (lambda _
+                      ;; This variable is used in setup.py to enable cross compilation
+                      ;; specific switches. As it is not set properly by configure
+                      ;; script, set it manually.
+                      ,@(if (%current-target-system)
+                            '((setenv "_PYTHON_HOST_PLATFORM" ""))
+                            '())
+                      ;; Filter for existing files, since some may not exist in all
+                      ;; versions of python that are built with this recipe.
+                      (substitute* (filter file-exists?
+                                           '("Lib/subprocess.py"
+                                             "Lib/popen2.py"
+                                             "Lib/distutils/tests/test_spawn.py"
+                                             "Lib/test/support/__init__.py"
+                                             "Lib/test/test_subprocess.py"))
+                        (("/bin/sh")
+                         (which "sh")))))
+                  (add-before 'configure 'do-not-record-configure-flags
+                    (lambda* (#:key configure-flags #:allow-other-keys)
+                      ;; Remove configure flags from the installed '_sysconfigdata.py'
+                      ;; and 'Makefile' so we don't end up keeping references to the
+                      ;; build tools.
+                      ;;
+                      ;; Preserve at least '--with-system-ffi' since otherwise the
+                      ;; thing tries to build libffi, fails, and we end up with a
+                      ;; Python that lacks ctypes.
+                      (substitute* "configure"
+                        (("^CONFIG_ARGS=.*$")
+                         (format #f "CONFIG_ARGS='~a'\n"
+                                 (if (member "--with-system-ffi"
+                                             configure-flags)
+                                     "--with-system-ffi" ""))))))
+                  (add-before 'check 'pre-check
+                    (lambda _
+                      ;; 'Lib/test/test_site.py' needs a valid $HOME
+                      (setenv "HOME"
+                              (getcwd))))
+                  (add-after 'unpack 'set-source-file-times-to-1980
+                    ;; XXX One of the tests uses a ZIP library to pack up some of the
+                    ;; source tree, and fails with "ZIP does not support timestamps
+                    ;; before 1980".  Work around this by setting the file times in the
+                    ;; source tree to sometime in early 1980.
+                    (lambda _
+                      (let ((circa-1980 (* 10 366 24 60 60)))
+                        (ftw "."
+                             (lambda (file stat flag)
+                               (utime file circa-1980 circa-1980) #t)))))
+                  (add-after 'unpack 'remove-windows-binaries
+                    (lambda _
+                      ;; Delete .exe from embedded .whl (zip) files
+                      (for-each (lambda (whl)
+                                  (let ((dir "whl-content")
+                                        (circa-1980 (* 10 366 24 60 60)))
+                                    (mkdir-p dir)
+                                    (with-directory-excursion dir
+                                      (let ((whl (string-append "../" whl)))
+                                        (invoke "unzip" whl)
+                                        (for-each delete-file
+                                                  (find-files "." "\\.exe$"))
+                                        (delete-file whl)
+                                        ;; Reset timestamps to prevent them from ending
+                                        ;; up in the Zip archive.
+                                        (ftw "."
+                                             (lambda (file stat flag)
+                                               (utime file circa-1980
+                                                      circa-1980) #t))
+                                        (apply invoke "zip" "-X" whl
+                                               (find-files "."
+                                                           #:directories? #t))))
+                                    (delete-file-recursively dir)))
+                                (find-files "Lib/ensurepip" "\\.whl$"))))
+                  (add-after 'install 'remove-tests
+                    ;; Remove 25 MiB of unneeded unit tests.  Keep test_support.*
+                    ;; because these files are used by some libraries out there.
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (match (scandir (string-append out "/lib")
+                                        (lambda (name)
+                                          (string-prefix? "python" name)))
+                          ((pythonX.Y)
+                           (let ((testdir (string-append out "/lib/" pythonX.Y
+                                                         "/test")))
+                             (with-directory-excursion testdir
+                               (for-each delete-file-recursively
+                                         (scandir testdir
+                                                  (match-lambda
+                                                    ((or "." "..")
+                                                     #f)
+                                                    ("support" #f)
+                                                    (file (not (string-prefix?
+                                                                "test_support."
+                                                                file))))))
+                               (call-with-output-file "__init__.py"
+                                 (const #t))))
+                           (let ((libdir (string-append out "/lib/" pythonX.Y)))
+                             (for-each (lambda (directory)
+                                         (let ((dir (string-append libdir "/"
+                                                                   directory)))
+                                           (when (file-exists? dir)
+                                             (delete-file-recursively dir))))
+                                       '("email/test" "ctypes/test"
+                                         "unittest/test"
+                                         "tkinter/test"
+                                         "sqlite3/test"
+                                         "bsddb/test"
+                                         "lib-tk/test"
+                                         "json/tests"
+                                         "distutils/tests"))))))))
+                  (add-after 'remove-tests 'move-tk-inter
+                    (lambda* (#:key outputs inputs #:allow-other-keys)
+                      ;; When Tkinter support is built move it to a separate output so
+                      ;; that the main output doesn't contain a reference to Tcl/Tk.
+                      (let ((out (assoc-ref outputs "out"))
+                            (tk (assoc-ref outputs "tk")))
+                        (when tk
+                          (match (find-files out "tkinter.*\\.so")
+                            ((tkinter.so)
+                             ;; The .so is in OUT/lib/pythonX.Y/lib-dynload, but we
+                             ;; want it under TK/lib/pythonX.Y/site-packages.
+                             (let* ((len (string-length out))
+                                    (target (string-append tk "/"
+                                                           (string-drop (dirname
+                                                                         (dirname
+                                                                          tkinter.so))
+                                                                        len)
+                                                           "/site-packages")))
+                               (install-file tkinter.so target)
+                               (delete-file tkinter.so))))
+                          ;; Remove explicit store path references.
+                          (let ((tcl (assoc-ref inputs "tcl"))
+                                (tk (assoc-ref inputs "tk")))
+                            (substitute* (find-files (string-append out "/lib")
+                                          "^(_sysconfigdata_.*\\.py|Makefile)$")
+                              (((string-append "-L" tk "/lib"))
+                               "")
+                              (((string-append "-L" tcl "/lib"))
+                               "")))))))
+                  (add-after 'move-tk-inter 'move-idle
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; when idle is built, move it to a separate output to save some
+                      ;; space (5MB)
+                      (let ((out (assoc-ref outputs "out"))
+                            (idle (assoc-ref outputs "idle")))
+                        (when idle
+                          (for-each (lambda (file)
+                                      (let ((target (string-append idle
+                                                                   "/bin/"
+                                                                   (basename
+                                                                    file))))
+                                        (install-file file
+                                                      (dirname target))
+                                        (delete-file file)))
+                                    (find-files (string-append out "/bin")
+                                                "^idle"))
+                          (match (find-files out "^idlelib$"
+                                             #:directories? #t)
+                            ((idlelib)
+                             (let* ((len (string-length out))
+                                    (target (string-append idle "/"
+                                                           (string-drop
+                                                            idlelib len)
+                                                           "/site-packages")))
+                               (mkdir-p (dirname target))
+                               (rename-file idlelib target))))))))
+                  (add-after 'move-idle 'rebuild-bytecode
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        ;; Disable hash randomization to ensure the generated .pycs
+                        ;; are reproducible.
+                        (setenv "PYTHONHASHSEED" "0")
+
+                        (for-each (lambda (output)
+                                    ;; XXX: Delete existing pycs generated by the build
+                                    ;; system beforehand because the -f argument does
+                                    ;; not necessarily overwrite all files, leading to
+                                    ;; indeterministic results.
+                                    (for-each (lambda (pyc)
+                                                (delete-file pyc))
+                                              (find-files output "\\.pyc$"))
+
+                                    (apply invoke
+                                           `(,,(if (%current-target-system)
+                                                   "python3"
+                                                   '(string-append out
+                                                     "/bin/python3")) "-m"
+                                             "compileall"
+                                             "-o"
+                                             "0"
+                                             "-o"
+                                             "1"
+                                             "-o"
+                                             "2"
+                                             "-f" ;force rebuild
+                                             "--invalidation-mode=unchecked-hash"
+                                             ;; Don't build lib2to3, because it's
+                                             ;; Python 2 code.
+                                             "-x"
+                                             "lib2to3/.*"
+                                             ,output)))
+                                  (map cdr outputs)))))
+                  (add-before 'check 'set-TZDIR
+                    (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                      ;; test_email requires the Olson time zone database.
+                      (setenv "TZDIR"
+                              (string-append (assoc-ref (or native-inputs
+                                                            inputs) "tzdata")
+                                             "/share/zoneinfo"))))
+                  (add-after 'install 'install-sitecustomize.py
+                    ,(customize-site version)))))
+    (inputs (list bzip2
+                  expat
+                  gdbm
+                  libffi ;for ctypes
+                  sqlite ;for sqlite extension
+                  openssl
+                  readline
+                  zlib
+                  tcl
+                  tk)) ;for tkinter
+    (native-inputs `(("tzdata" ,tzdata-for-tests)
+                     ("unzip" ,unzip)
+                     ("zip" ,(@ (gnu packages compression) zip))
+                     ("pkg-config" ,pkg-config)
+                     ("sitecustomize.py" ,(local-file (search-auxiliary-file
+                                                       "python/sitecustomize.py")))
+                     ;; When cross-compiling, a native version of Python itself is needed.
+                     ,@(if (%current-target-system)
+                           `(("python" ,this-package)
+                             ("which" ,which))
+                           '())))
+    (native-search-paths
+     (list (guix-pythonpath-search-path version)
+           ;; Used to locate tzdata by the zoneinfo module introduced in
+           ;; Python 3.9.
+           (search-path-specification
+            (variable "PYTHONTZPATH")
+            (files (list "share/zoneinfo")))))
+    (home-page "https://www.python.org")
+    (synopsis "High-level, dynamically-typed programming language")
+    (description
+     "Python is a remarkably powerful dynamic programming language that
+is used in a wide variety of application domains.  Some of its key
+distinguishing features include: clear, readable syntax; strong
+introspection capabilities; intuitive object orientation; natural
+expression of procedural code; full modularity, supporting hierarchical
+packages; exception-based error handling; and very high level dynamic
+data types.")
+    (properties '((cpe-name . "python")))
+    (license license:psfl)))
+
+
+;; Next 3.x version.
+(define-public python-next python-3.12)
+
 ;; Current 3.x version.
 (define-public python-3 python-3.10)
 

base-commit: a3a7d51a31957f185e4e6e3059610769d48ffd70
-- 
2.41.0





^ permalink raw reply related	[relevance 35%]

* [bug#60240] [PATCH v4] gnu: Add python-3.12 and python-next.
    2024-02-21 12:13 34% ` [bug#60240] [PATCH v2] gnu: Add python-3.12 and python-next Tanguy Le Carrour
  2024-03-06 12:55 35% ` [bug#60240] [PATCH v3] " Tanguy Le Carrour
@ 2024-03-07 18:45 34% ` Tanguy Le Carrour
  2024-03-07 18:58 35% ` [bug#60240] [PATCH v5] " Tanguy Le Carrour
  3 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-03-07 18:45 UTC (permalink / raw)
  To: 60240
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

Thanks to public shaming during the patch review session 😅,
I’m sending this v4 that fixes some linter warnings.
Most of them were "line too long" that I wrongly thought
were taken care of by `guix style`. My bad!

The remaining problems are:

```
gnu/packages/python.scm:600:2: python-next@3.12.2: file names of patches should start with the package name
```

But I think the naming follows the convention used for other Python patches.

```
gnu/packages/python.scm:648:0: python-next@3.12.2: line 648 is way too long (101 characters)
```

It’s an URL that I cannot split.

```
gnu/packages/python.scm:604:5: python-next@3.12.2: updater 'generic-html' failed to find upstream releases
```

Don’t know what that means.

```
gnu/packages/python.scm:604:5: python-next@3.12.2: source not archived on Software Heritage and missing from the Disarchive database
```

Not **yet** archived by SWH.

* gnu/packages/python.scm (python-3.12, python-next): New variables.
* gnu/packages/patches/python-3.12-fix-tests.patch: New file.

Change-Id: Ie393b732a8863569578e72e62603b75a1655a34e
Signed-off-by: Tanguy Le Carrour <tanguy@bioneland.org>
---
 .../patches/python-3.12-fix-tests.patch       | 334 +++++++++++++++
 gnu/packages/python.scm                       | 385 +++++++++++++++++-
 2 files changed, 718 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/python-3.12-fix-tests.patch

diff --git a/gnu/packages/patches/python-3.12-fix-tests.patch b/gnu/packages/patches/python-3.12-fix-tests.patch
new file mode 100644
index 0000000000..fa5c8027ce
--- /dev/null
+++ b/gnu/packages/patches/python-3.12-fix-tests.patch
@@ -0,0 +1,334 @@
+From f0698133e7d6c353a3e6ae0fc62e57ba558a9bc0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 28 Oct 2020 22:55:05 -0400
+Subject: [PATCH] Skip problematic Python 3 tests in Guix.
+
+A subset of the hunks in this patch is tracked upstream at
+https://bugs.python.org/issue38845, which was contributed by Tanguy Le
+Carrour <tanguy@bioneland.org>.
+
+diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
+index e42c7ab4bd..8087c84dab 100644
+--- a/Lib/test/_test_multiprocessing.py
++++ b/Lib/test/_test_multiprocessing.py
+@@ -1695,6 +1695,7 @@ def _test_wait_result(cls, c, pid):
+         if pid is not None:
+             os.kill(pid, signal.SIGINT)
+
++    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
+     def test_wait_result(self):
+         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
+             pid = os.getpid()
+@@ -4150,6 +4151,7 @@ def test_shared_memory_across_processes(self):
+         sms.close()
+
+     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
+         # bpo-36368: protect SharedMemoryManager server process from
+         # KeyboardInterrupt signals.
+diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
+index 85c8152d49..e35cfffe84 100644
+--- a/Lib/test/test_asyncio/test_base_events.py
++++ b/Lib/test/test_asyncio/test_base_events.py
+@@ -1377,6 +1377,8 @@ def test_create_connection_no_inet_pton(self, m_socket):
+         self._test_create_connection_ip_addr(m_socket, False)
+
+     @patch_socket
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_create_connection_service_name(self, m_socket):
+         m_socket.getaddrinfo = socket.getaddrinfo
+         sock = m_socket.socket.return_value
+diff --git a/Lib/test/test_ctypes/test_find.py b/Lib/test/test_ctypes/test_find.py
+index a41e94971d..1291af3057 100644
+--- a/Lib/test/test_ctypes/test_find.py
++++ b/Lib/test/test_ctypes/test_find.py
+@@ -117,6 +117,7 @@ def test_find_library_with_gcc(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
+             self.assertNotEqual(find_library('c'), None)
+
++    @unittest.skipIf(True, 'Fails on Guix.')
+     def test_find_library_with_ld(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
+              unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
+diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
+index 1ee9958445..ab6b41befe 100644
+--- a/Lib/test/test_generators.py
++++ b/Lib/test/test_generators.py
+@@ -34,6 +34,7 @@ def generator2(self):
+         else:
+             return "FAILED"
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
+     def test_raise_and_yield_from(self):
+         gen = self.generator1()
+         gen.send(None)
+diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
+index ec105ae1a0..ae4c5b672e 100644
+--- a/Lib/test/test_pathlib.py
++++ b/Lib/test/test_pathlib.py
+@@ -3069,6 +3069,7 @@ def test_rglob(self):
+                          'pwd module does not expose getpwall()')
+     @unittest.skipIf(sys.platform == "vxworks",
+                      "no home directory on VxWorks")
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         import_helper.import_module('pwd')
+diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
+index 51b844262e..004d3133cf 100644
+--- a/Lib/test/test_pdb.py
++++ b/Lib/test/test_pdb.py
+@@ -1580,6 +1580,7 @@ def test_pdb_next_command_subiterator():
+     (Pdb) continue
+     """
+
++@unittest.skipIf(True, 'Fails on Guix… but skipIf not taken into account?!')
+ def test_pdb_issue_20766():
+     """Test for reference leaks when the SIGINT handler is set.
+
+@@ -1598,11 +1599,11 @@ def test_pdb_issue_20766():
+     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
+     (Pdb) continue
+-    pdb 1: <built-in function default_int_handler>
++    pdb 1: 1
+     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
+     (Pdb) continue
+-    pdb 2: <built-in function default_int_handler>
++    pdb 2: 1
+     """
+
+ def test_pdb_issue_43318():
+diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index 2ab6f6a986..8cf6b4d1c8 100644
+--- a/Lib/test/test_regrtest.py
++++ b/Lib/test/test_regrtest.py
+@@ -1049,6 +1049,7 @@ def test_fromfile(self):
+         output = self.run_tests('--fromfile', filename)
+         self.check_executed_tests(output, tests, stats=stats)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_interrupted(self):
+         code = TEST_INTERRUPTED
+         test = self.create_test('sigint', code=code)
+@@ -1066,6 +1067,7 @@ def test_slowest(self):
+                  % (self.TESTNAME_REGEX, len(tests)))
+         self.check_line(output, regex)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_slowest_interrupted(self):
+         # Issue #25373: test --slowest with an interrupted test
+         code = TEST_INTERRUPTED
+diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
+index 317e7ca8f8..7f272daf24 100644
+--- a/Lib/test/test_resource.py
++++ b/Lib/test/test_resource.py
+@@ -151,6 +151,7 @@ def test_freebsd_contants(self):
+
+     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
+     @support.requires_linux_version(2, 6, 36)
++    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
+     def test_prlimit(self):
+         self.assertRaises(TypeError, resource.prlimit)
+         self.assertRaises(ProcessLookupError, resource.prlimit,
+diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+index bf60f37934..5e3a96380a 100644
+--- a/Lib/test/test_shutil.py
++++ b/Lib/test/test_shutil.py
+@@ -1743,6 +1743,7 @@ def test_make_archive(self):
+         base_name = os.path.join(tmpdir, 'archive')
+         self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
+     def test_make_archive_owner_group(self):
+         # testing make_archive with owner and group, with various combinations
+@@ -1771,6 +1772,7 @@ def test_make_archive_owner_group(self):
+         self.assertTrue(os.path.isfile(res))
+
+
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
+     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+     def test_tarfile_root_owner(self):
+diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
+index 637a0ca3b3..2fb804e340 100644
+--- a/Lib/test/test_signal.py
++++ b/Lib/test/test_signal.py
+@@ -160,6 +160,7 @@ def test_valid_signals(self):
+                 self.assertLess(signum, signal.NSIG)
+
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @support.requires_subprocess()
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers exit via SIGINT."""
+@@ -211,6 +212,7 @@ def test_issue9324(self):
+             signal.signal(7, handler)
+
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @support.requires_subprocess()
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
+@@ -1407,6 +1409,7 @@ def cycle_handlers():
+
+ class RaiseSignalTest(unittest.TestCase):
+
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_sigint(self):
+         with self.assertRaises(KeyboardInterrupt):
+             signal.raise_signal(signal.SIGINT)
+@@ -1452,6 +1455,7 @@ def __del__(self):
+
+ class PidfdSignalTest(unittest.TestCase):
+
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @unittest.skipUnless(
+         hasattr(signal, "pidfd_send_signal"),
+         "pidfd support not built in",
+diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+index 4eb5af99d6..9c7b8f6dbc 100644
+--- a/Lib/test/test_socket.py
++++ b/Lib/test/test_socket.py
+@@ -1016,6 +1016,8 @@ def testHostnameRes(self):
+         if not fqhn in all_host_names:
+             self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
+
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_host_resolution(self):
+         for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']:
+             self.assertEqual(socket.gethostbyname(addr), addr)
+@@ -1161,6 +1163,8 @@ def testNtoHErrors(self):
+             self.assertRaises(OverflowError, socket.ntohl, k)
+             self.assertRaises(OverflowError, socket.htonl, k)
+
++    @unittest.skipUnless(os.path.exists("/etc/services"),
++                         "getservbyname uses /etc/services, which is not in the chroot")
+     def testGetServBy(self):
+         eq = self.assertEqual
+         # Find one service that exists, then check all the related interfaces.
+@@ -1521,6 +1525,8 @@ def test_sio_loopback_fast_path(self):
+             raise
+         self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
+
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     def testGetaddrinfo(self):
+         try:
+             socket.getaddrinfo('localhost', 80)
+@@ -1653,6 +1659,8 @@ def test_getnameinfo(self):
+         # only IP addresses are allowed
+         self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
+
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     @unittest.skipUnless(support.is_resource_enabled('network'),
+                          'network is not enabled')
+     def test_idna(self):
+diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+index 50766c2548..0c7eb7a83a 100644
+--- a/Lib/test/test_spwd.py
++++ b/Lib/test/test_spwd.py
+@@ -9,8 +9,7 @@
+     spwd = import_helper.import_module('spwd')
+
+
+-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
+-                     'root privileges required')
++@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
+ class TestSpwdRoot(unittest.TestCase):
+
+     def test_getspall(self):
+@@ -60,8 +59,7 @@ def test_getspnam(self):
+             self.assertRaises(TypeError, spwd.getspnam, bytes_name)
+
+
+-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
+-                     'non-root user required')
++@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
+ class TestSpwdNonRoot(unittest.TestCase):
+
+     def test_getspnam_exception(self):
+diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
+index 71489ea493..33351919fe 100644
+--- a/Lib/test/test_tarfile.py
++++ b/Lib/test/test_tarfile.py
+@@ -2911,9 +2911,12 @@ def root_is_uid_gid_0():
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+
+diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+index 00d9e591c7..2515603715 100644
+--- a/Lib/test/test_threading.py
++++ b/Lib/test/test_threading.py
+@@ -1962,6 +1962,7 @@ def check_interrupt_main_noerror(self, signum):
+             # Restore original handler
+             signal.signal(signum, handler)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_subthread(self):
+         # Calling start_new_thread with a function that executes interrupt_main
+         # should raise KeyboardInterrupt upon completion.
+@@ -1973,6 +1974,8 @@ def call_interrupt():
+             t.join()
+         t.join()
+
++
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_mainthread(self):
+         # Make sure that if interrupt_main is called in main thread that
+         # KeyboardInterrupt is raised instantly.
+diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py
+index 0e7ed67de7..6539a2983b 100644
+--- a/Lib/test/test_tools/test_freeze.py
++++ b/Lib/test/test_tools/test_freeze.py
+@@ -23,6 +23,7 @@
+                  'test is too slow with PGO')
+ class TestFreeze(unittest.TestCase):
+
++    @unittest.skipIf(True, 'Fails on Guix.')
+     @support.requires_resource('cpu') # Building Python is slow
+     def test_freeze_simple_script(self):
+         script = textwrap.dedent("""
+diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
+index 515c3840cb..a96dfad0fe 100644
+--- a/Lib/test/test_unicodedata.py
++++ b/Lib/test/test_unicodedata.py
+@@ -342,6 +342,7 @@ def test_linebreak_7643(self):
+                 self.assertEqual(len(lines), 1,
+                                  r"\u%.4x should not be a linebreak" % i)
+
++@requires_resource('network')
+ class NormalizationTest(unittest.TestCase):
+     @staticmethod
+     def check_version(testfile):
+diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+index 445a34ae3e..8f750537c3 100644
+--- a/Tools/scripts/run_tests.py
++++ b/Tools/scripts/run_tests.py
+@@ -69,7 +69,7 @@ def main(regrtest_args):
+         else:
+             args.extend(['-j', '0'])  # Use all CPU cores
+     if not any(is_resource_use_flag(arg) for arg in regrtest_args):
+-        args.extend(['-u', 'all,-largefile,-audio,-gui'])
++        args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
+
+     if cross_compile and hostrunner:
+         # If HOSTRUNNER is set and -p/--python option is not given, then
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 51d5f598d7..25fe83ea69 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -55,7 +55,7 @@
 ;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
 ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
-;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2024 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
@@ -596,6 +596,389 @@ (define-public python-3.10
             (variable "PYTHONTZPATH")
             (files (list "share/zoneinfo")))))))
 
+(define-public python-3.12
+  (package
+    (name "python-next")
+    (version "3.12.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.python.org/ftp/python/" version
+                           "/Python-" version ".tar.xz"))
+       (sha256
+        (base32 "0w6qyfhc912xxav9x9pifwca40b4l49vy52wai9j0gc1mhni2a5y"))
+       (patches (search-patches "python-3-deterministic-build-info.patch"
+                                "python-3.12-fix-tests.patch"
+                                "python-3-hurd-configure.patch"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Delete the bundled copy of libexpat.
+                   (delete-file-recursively "Modules/expat")
+                   (substitute* "Modules/Setup"
+                     ;; Link Expat instead of embedding the bundled one.
+                     (("^#pyexpat.*")
+                      "pyexpat pyexpat.c -lexpat\n"))
+                   ;; Delete windows binaries
+                   (for-each delete-file
+                             (find-files "Lib/distutils/command" "\\.exe$"))))))
+    (outputs '("out" "tk" ;tkinter; adds 50 MiB to the closure
+               "idle")) ;programming environment; weighs 5MB
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:configure-flags (list "--enable-shared" ;allow embedding
+                               "--with-system-expat" ;for XML support
+                               "--with-system-ffi" ;build ctypes
+                               "--with-ensurepip=install" ;install pip and setuptools
+                               "--with-computed-gotos" ;main interpreter loop optimization
+                               "--enable-unicode=ucs4"
+                               "--without-static-libpython"
+
+                               ;; FIXME: These flags makes Python significantly faster, but
+                               ;; leads to non-reproducible binaries.
+                               ;; "--with-lto"               ;increase size by 20MB, but 15% speedup
+                               ;; "--enable-optimizations"
+
+                               ;; Prevent the installed _sysconfigdata.py from retaining a reference
+                               ;; to coreutils.
+                               "INSTALL=install -c"
+                               "MKDIR_P=mkdir -p"
+
+                               ;; Disable runtime check failing if cross-compiling, see:
+                               ;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
+                               ,@(if (%current-target-system)
+                                     '("ac_cv_buggy_getaddrinfo=no"
+                                       "ac_cv_file__dev_ptmx=no"
+                                       "ac_cv_file__dev_ptc=no")
+                                     '())
+                               ;; -fno-semantic-interposition reinstates some optimizations by gcc
+                               ;; leading to around 15% speedup. This is the default starting from
+                               ;; python 3.10.
+                               "CFLAGS=-fno-semantic-interposition"
+                               (string-append "LDFLAGS=-Wl,-rpath="
+                                              (assoc-ref %outputs "out")
+                                              "/lib"
+                                              " -fno-semantic-interposition"))
+       ;; With no -j argument tests use all available cpus, so provide one.
+       #:make-flags (list (string-append (format #f "TESTOPTS=-j~d"
+                                                 (parallel-job-count))
+                           ;; those tests fail on low-memory systems
+                           " --exclude test_mmap test_socket test_threading test_asyncio"
+                           ,@(if (system-hurd?)
+                                 '(" test_posix" ;multiple errors
+                                   " test_time"
+                                   " test_pty"
+                                   " test_shutil"
+                                   " test_tempfile" ;chflags: invalid argument:
+                                   ;; tbv14c9t/dir0/dir0/dir0/test0.txt
+                                   " test_os" ;stty: 'standard input':
+                                   ;; Inappropriate ioctl for device
+                                   " test_openpty" ;No such file or directory
+                                   " test_selectors" ;assertEqual(NUM_FDS // 2, len(fds))
+                                   ;; 32752 != 4
+                                   " test_compileall" ;multiple errors
+                                   " test_poll" ;list index out of range
+                                   " test_subprocess" ;runs over 10min
+                                   " test_asyncore" ;multiple errors
+                                   " test_threadsignals"
+                                   " test_eintr" ;Process return code is -14
+                                   " test_io" ;multiple errors
+                                   " test_logging"
+                                   " test_signal"
+                                   " test_flags" ;ERROR
+                                   " test_bidirectional_pty"
+                                   " test_create_unix_connection"
+                                   " test_unix_sock_client_ops"
+                                   " test_open_unix_connection"
+                                   " test_open_unix_connection_error"
+                                   " test_read_pty_output"
+                                   " test_write_pty"
+                                   " test_concurrent_futures" ;freeze
+                                   " test_venv" ;freeze
+                                   " test_multiprocessing_forkserver" ;runs over 10min
+                                   " test_multiprocessing_spawn" ;runs over 10min
+                                   " test_builtin"
+                                   " test_capi"
+                                   " test_dbm_ndbm"
+                                   " test_exceptions"
+                                   " test_faulthandler"
+                                   " test_getopt"
+                                   " test_importlib"
+                                   " test_json"
+                                   " test_multiprocessing_fork"
+                                   " test_multiprocessing_main_handling"
+                                   " test_pdb "
+                                   " test_regrtest"
+                                   " test_sqlite")
+                                 '())))
+
+       #:modules ((ice-9 ftw)
+                  (ice-9 match)
+                  (guix build utils)
+                  (guix build gnu-build-system))
+
+       #:phases (modify-phases %standard-phases
+                  ,@(if (system-hurd?)
+                        `((add-after 'unpack
+                                     'disable-multi-processing
+                                     (lambda _
+                                       (substitute* "Makefile.pre.in"
+                                         (("-j0")
+                                          "-j1")))))
+                        '())
+                  (add-before 'configure 'patch-lib-shells
+                    (lambda _
+                      ;; This variable is used in setup.py to enable cross compilation
+                      ;; specific switches. As it is not set properly by configure
+                      ;; script, set it manually.
+                      ,@(if (%current-target-system)
+                            '((setenv "_PYTHON_HOST_PLATFORM" ""))
+                            '())
+                      ;; Filter for existing files, since some may not exist in all
+                      ;; versions of python that are built with this recipe.
+                      (substitute* (filter file-exists?
+                                           '("Lib/subprocess.py"
+                                             "Lib/popen2.py"
+                                             "Lib/distutils/tests/test_spawn.py"
+                                             "Lib/test/support/__init__.py"
+                                             "Lib/test/test_subprocess.py"))
+                        (("/bin/sh")
+                         (which "sh")))))
+                  (add-before 'configure 'do-not-record-configure-flags
+                    (lambda* (#:key configure-flags #:allow-other-keys)
+                      ;; Remove configure flags from the installed '_sysconfigdata.py'
+                      ;; and 'Makefile' so we don't end up keeping references to the
+                      ;; build tools.
+                      ;;
+                      ;; Preserve at least '--with-system-ffi' since otherwise the
+                      ;; thing tries to build libffi, fails, and we end up with a
+                      ;; Python that lacks ctypes.
+                      (substitute* "configure"
+                        (("^CONFIG_ARGS=.*$")
+                         (format #f "CONFIG_ARGS='~a'\n"
+                                 (if (member "--with-system-ffi"
+                                             configure-flags)
+                                     "--with-system-ffi" ""))))))
+                  (add-before 'check 'pre-check
+                    (lambda _
+                      ;; 'Lib/test/test_site.py' needs a valid $HOME
+                      (setenv "HOME"
+                              (getcwd))))
+                  (add-after 'unpack 'set-source-file-times-to-1980
+                    ;; XXX One of the tests uses a ZIP library to pack up some of the
+                    ;; source tree, and fails with "ZIP does not support timestamps
+                    ;; before 1980".  Work around this by setting the file times in the
+                    ;; source tree to sometime in early 1980.
+                    (lambda _
+                      (let ((circa-1980 (* 10 366 24 60 60)))
+                        (ftw "."
+                             (lambda (file stat flag)
+                               (utime file circa-1980 circa-1980) #t)))))
+                  (add-after 'unpack 'remove-windows-binaries
+                    (lambda _
+                      ;; Delete .exe from embedded .whl (zip) files
+                      (for-each (lambda (whl)
+                                  (let ((dir "whl-content")
+                                        (circa-1980 (* 10 366 24 60 60)))
+                                    (mkdir-p dir)
+                                    (with-directory-excursion dir
+                                      (let ((whl (string-append "../" whl)))
+                                        (invoke "unzip" whl)
+                                        (for-each delete-file
+                                                  (find-files "." "\\.exe$"))
+                                        (delete-file whl)
+                                        ;; Reset timestamps to prevent them from ending
+                                        ;; up in the Zip archive.
+                                        (ftw "."
+                                             (lambda (file stat flag)
+                                               (utime file circa-1980
+                                                      circa-1980) #t))
+                                        (apply invoke "zip" "-X" whl
+                                               (find-files "."
+                                                           #:directories? #t))))
+                                    (delete-file-recursively dir)))
+                                (find-files "Lib/ensurepip" "\\.whl$"))))
+                  (add-after 'install 'remove-tests
+                    ;; Remove 25 MiB of unneeded unit tests.  Keep test_support.*
+                    ;; because these files are used by some libraries out there.
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (match (scandir (string-append out "/lib")
+                                        (lambda (name)
+                                          (string-prefix? "python" name)))
+                          ((pythonX.Y)
+                           (let ((testdir (string-append out "/lib/" pythonX.Y
+                                                         "/test")))
+                             (with-directory-excursion testdir
+                               (for-each delete-file-recursively
+                                         (scandir testdir
+                                                  (match-lambda
+                                                    ((or "." "..")
+                                                     #f)
+                                                    ("support" #f)
+                                                    (file (not (string-prefix?
+                                                                "test_support."
+                                                                file))))))
+                               (call-with-output-file "__init__.py"
+                                 (const #t))))
+                           (let ((libdir (string-append out "/lib/" pythonX.Y)))
+                             (for-each (lambda (directory)
+                                         (let ((dir (string-append libdir "/"
+                                                                   directory)))
+                                           (when (file-exists? dir)
+                                             (delete-file-recursively dir))))
+                                       '("email/test" "ctypes/test"
+                                         "unittest/test"
+                                         "tkinter/test"
+                                         "sqlite3/test"
+                                         "bsddb/test"
+                                         "lib-tk/test"
+                                         "json/tests"
+                                         "distutils/tests"))))))))
+                  (add-after 'remove-tests 'move-tk-inter
+                    (lambda* (#:key outputs inputs #:allow-other-keys)
+                      ;; When Tkinter support is built move it to a separate output so
+                      ;; that the main output doesn't contain a reference to Tcl/Tk.
+                      (let ((out (assoc-ref outputs "out"))
+                            (tk (assoc-ref outputs "tk")))
+                        (when tk
+                          (match (find-files out "tkinter.*\\.so")
+                            ((tkinter.so)
+                             ;; The .so is in OUT/lib/pythonX.Y/lib-dynload, but we
+                             ;; want it under TK/lib/pythonX.Y/site-packages.
+                             (let* ((len (string-length out))
+                                    (target (string-append tk "/"
+                                                           (string-drop (dirname
+                                                                         (dirname
+                                                                          tkinter.so))
+                                                                        len)
+                                                           "/site-packages")))
+                               (install-file tkinter.so target)
+                               (delete-file tkinter.so))))
+                          ;; Remove explicit store path references.
+                          (let ((tcl (assoc-ref inputs "tcl"))
+                                (tk (assoc-ref inputs "tk")))
+                            (substitute* (find-files (string-append out "/lib")
+                                                     "^(_sysconfigdata_.*\\.py|Makefile)$")
+                                         (((string-append "-L" tk "/lib")) "")
+                                         (((string-append "-L" tcl "/lib")) "")))))))
+                  (add-after 'move-tk-inter 'move-idle
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; when idle is built, move it to a separate output to save some
+                      ;; space (5MB)
+                      (let ((out (assoc-ref outputs "out"))
+                            (idle (assoc-ref outputs "idle")))
+                        (when idle
+                          (for-each (lambda (file)
+                                      (let ((target (string-append idle
+                                                                   "/bin/"
+                                                                   (basename
+                                                                    file))))
+                                        (install-file file
+                                                      (dirname target))
+                                        (delete-file file)))
+                                    (find-files (string-append out "/bin")
+                                                "^idle"))
+                          (match (find-files out "^idlelib$"
+                                             #:directories? #t)
+                            ((idlelib)
+                             (let* ((len (string-length out))
+                                    (target (string-append idle "/"
+                                                           (string-drop
+                                                            idlelib len)
+                                                           "/site-packages")))
+                               (mkdir-p (dirname target))
+                               (rename-file idlelib target))))))))
+                  (add-after 'move-idle 'rebuild-bytecode
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        ;; Disable hash randomization to ensure the generated .pycs
+                        ;; are reproducible.
+                        (setenv "PYTHONHASHSEED" "0")
+
+                        (for-each (lambda (output)
+                                    ;; XXX: Delete existing pycs generated by the build
+                                    ;; system beforehand because the -f argument does
+                                    ;; not necessarily overwrite all files, leading to
+                                    ;; indeterministic results.
+                                    (for-each (lambda (pyc)
+                                                (delete-file pyc))
+                                              (find-files output "\\.pyc$"))
+
+                                    (apply invoke
+                                           `(,,(if (%current-target-system)
+                                                   "python3"
+                                                   '(string-append out
+                                                     "/bin/python3")) "-m"
+                                             "compileall"
+                                             "-o"
+                                             "0"
+                                             "-o"
+                                             "1"
+                                             "-o"
+                                             "2"
+                                             "-f" ;force rebuild
+                                             "--invalidation-mode=unchecked-hash"
+                                             ;; Don't build lib2to3, because it's
+                                             ;; Python 2 code.
+                                             "-x"
+                                             "lib2to3/.*"
+                                             ,output)))
+                                  (map cdr outputs)))))
+                  (add-before 'check 'set-TZDIR
+                    (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                      ;; test_email requires the Olson time zone database.
+                      (setenv "TZDIR"
+                              (string-append (assoc-ref (or native-inputs
+                                                            inputs) "tzdata")
+                                             "/share/zoneinfo"))))
+                  (add-after 'install 'install-sitecustomize.py
+                    ,(customize-site version)))))
+    (inputs (list bzip2
+                  expat
+                  gdbm
+                  libffi ;for ctypes
+                  sqlite ;for sqlite extension
+                  openssl
+                  readline
+                  zlib
+                  tcl
+                  tk)) ;for tkinter
+    (native-inputs `(("tzdata" ,tzdata-for-tests)
+                     ("unzip" ,unzip)
+                     ("zip" ,(@ (gnu packages compression) zip))
+                     ("pkg-config" ,pkg-config)
+                     ("sitecustomize.py" ,(local-file (search-auxiliary-file
+                                                       "python/sitecustomize.py")))
+                     ;; When cross-compiling, a native version of Python itself is needed.
+                     ,@(if (%current-target-system)
+                           `(("python" ,this-package)
+                             ("which" ,which))
+                           '())))
+    (native-search-paths
+     (list (guix-pythonpath-search-path version)
+           ;; Used to locate tzdata by the zoneinfo module introduced in
+           ;; Python 3.9.
+           (search-path-specification
+            (variable "PYTHONTZPATH")
+            (files (list "share/zoneinfo")))))
+    (home-page "https://www.python.org")
+    (synopsis "High-level, dynamically-typed programming language")
+    (description
+     "Python is a remarkably powerful dynamic programming language that
+is used in a wide variety of application domains.  Some of its key
+distinguishing features include: clear, readable syntax; strong
+introspection capabilities; intuitive object orientation; natural
+expression of procedural code; full modularity, supporting hierarchical
+packages; exception-based error handling; and very high level dynamic
+data types.")
+    (properties '((cpe-name . "python")))
+    (license license:psfl)))
+
+
+;; Next 3.x version.
+(define-public python-next python-3.12)
+
 ;; Current 3.x version.
 (define-public python-3 python-3.10)
 

base-commit: a3a7d51a31957f185e4e6e3059610769d48ffd70
-- 
2.41.0





^ permalink raw reply related	[relevance 34%]

* [bug#69591] [PATCH 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch.
                     ` (6 preceding siblings ...)
  2024-03-06 19:40 48% ` [bug#69591] [PATCH 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
@ 2024-03-06 19:40 43% ` David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-06 19:40 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/machine-learning.scm (%python-pytorch-for-r-torch-src): Add
patches.
(python-pytorch-for-r-torch)[version]: Use
%python-pytorch-for-r-torch-version.
[source]: Use %python-pytorch-for-r-torch-src.
[native-inputs]: Use 'modify-inputs'.
[inputs]: Don't replace xnnpack. Replace qnnpack-pytorch with
qnnpack-pytorch-for-r-torch and oneapi-dnnl with oneapi-dnnl-for-r-torch.
[propagated-inputs]: Don't replace onnx and onnx-optimizer.
[supported-systems]: New field.
* gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen: New file.
* gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch: New file.
* gnu/packages/patches/python-pytorch2-system-libraries.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                  |   1 -
 gnu/packages/machine-learning.scm             |  61 +--
 ...thon-pytorch-for-r-torch-fix-codegen.patch | 167 ++++++++
 ...pytorch-for-r-torch-system-libraries.patch | 390 ++++++++++++++++++
 .../python-pytorch2-system-libraries.patch    | 156 -------
 5 files changed, 576 insertions(+), 199 deletions(-)
 create mode 100644 gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
 create mode 100644 gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
 delete mode 100644 gnu/packages/patches/python-pytorch2-system-libraries.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 84eeb39c8b..6b3af883b6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1809,7 +1809,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyreadstat-link-libiconv.patch	\
   %D%/packages/patches/python-pyls-black-41.patch		\
   %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch	\
-  %D%/packages/patches/python-pytorch2-system-libraries.patch	\
   %D%/packages/patches/python-sip-include-dirs.patch	\
   %D%/packages/patches/python-sgmllib3k-assertions.patch	\
   %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch	\
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 4413ecad13..f85e0b5a93 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4691,7 +4691,15 @@ (define %python-pytorch-for-r-torch-src
                               %python-pytorch-for-r-torch-version))
     (sha256
      (base32
-      "0iirrn687i7sfv0p0i7dn89x3rf13a7l8y1y5h190h51yjxpxqxa"))))
+      "0iirrn687i7sfv0p0i7dn89x3rf13a7l8y1y5h190h51yjxpxqxa"))
+    (patches (search-patches
+              "python-pytorch-for-r-torch-system-libraries.patch"
+              "python-pytorch-runpath.patch"
+              "python-pytorch-without-kineto.patch"
+              ;; Some autogeneration scripts depend on the
+              ;; compile PyTorch library. Therefore, we create
+              ;; dummy versions which are regenerated later.
+              "python-pytorch-for-r-torch-fix-codegen.patch"))))
 
 (define-public qnnpack-pytorch-for-r-torch
   (package
@@ -4707,59 +4715,28 @@ (define-public qnnpack-pytorch-for-r-torch
        (snippet
         (origin-snippet (package-source qnnpack-pytorch)))))))
 
+;; Keep in sync with r-torch
 (define-public python-pytorch-for-r-torch
   (package
     (inherit python-pytorch)
     (name "python-pytorch")
-    (version "2.0.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "14m7v54zyd2qg2xk9mqdpbf4ps7091mdzinzh4vq9p5k4bpznj65"))
-              (patches (search-patches "python-pytorch2-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-enum" "python-peachpy"
-                              "python-six" "tbb" "XNNPACK" "zstd"))
-                  (substitute* "caffe2/CMakeLists.txt"
-                    (("target_link_libraries\\(\\$\\{test_name\\}_\\$\\{CPU_CAPABILITY\\} c10 sleef gtest_main\\)")
-                     "target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest gtest_main)"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
+    (version %python-pytorch-for-r-torch-version)
+    (source %python-pytorch-for-r-torch-src)
+    (native-inputs
+     (modify-inputs (package-native-inputs python-pytorch)
+       (replace "ideep-pytorch" ideep-pytorch-for-r-torch)))
     (inputs
      (modify-inputs (package-inputs python-pytorch)
-       (replace "xnnpack" xnnpack-for-torch2)))
+       (replace "qnnpack-pytorch" qnnpack-pytorch-for-r-torch)
+       (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch)))
     (propagated-inputs
      (modify-inputs (package-propagated-inputs python-pytorch)
        (append python-filelock
                python-jinja2
                python-networkx
                python-opt-einsum
-               python-sympy)
-       (replace "onnx" onnx-for-torch2)
-       (replace "onnx-optimizer" onnx-optimizer-for-torch2)))))
+               python-sympy)))
+    (supported-systems %64bit-supported-systems)))
 
 (define-public python-pytorch-geometric
   (package
diff --git a/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
new file mode 100644
index 0000000000..8515e5ab13
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-for-r-torch-fix-codegen.patch
@@ -0,0 +1,167 @@
+This patch fixes some scripts for generating source files.  For
+gen_jit_decompositions.py, gen_mobile_upgraders.py and
+gen_jit_shape_functions.py, which depend on the compiled PyTorch library, the
+option to generate "dummy" source files is added for the initial build, which
+is later corrected.  codegen_external.py is patched to avoid duplicate
+functions and add the static keyword as in the existing generated file.
+
+diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
+index cc0263dbbf..ac34e84b82 100644
+--- a/tools/gen_flatbuffers.sh
++++ b/tools/gen_flatbuffers.sh
+@@ -1,13 +1,13 @@
+ #!/bin/bash
+ ROOT=$(pwd)
+-FF_LOCATION="$ROOT/third_party/flatbuffers"
+-cd "$FF_LOCATION" || exit
+-mkdir build
+-cd build || exit
+-cmake ..
+-cmake --build . --target flatc
+-mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
+-./flatc --cpp --gen-mutable --scoped-enums \
++#FF_LOCATION="$ROOT/third_party/flatbuffers"
++#cd "$FF_LOCATION" || exit
++#mkdir build
++#cd build || exit
++#cmake ..
++#cmake --build . --target flatc
++#mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
++flatc --cpp --gen-mutable --scoped-enums \
+      -o "$ROOT/torch/csrc/jit/serialization" \
+      -c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
+ echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
+diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
+index 120520b139..0c8587f02d 100644
+--- a/torch/csrc/jit/tensorexpr/codegen_external.py
++++ b/torch/csrc/jit/tensorexpr/codegen_external.py
+@@ -16,9 +16,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+     native_functions = parse_native_yaml(native_functions_path, tags_path)
+     func_decls = []
+     func_registrations = []
+-    for func in native_functions:
++    done_names = set()
++    for func in native_functions[0]:
+         schema = func.func
+         name = schema.name.name.base
++        if name in done_names:
++            continue
++        else:
++            done_names.add(name)
+         args = schema.arguments
+         # Only supports extern calls for functions with out variants
+         if not schema.is_out_fn():
+@@ -48,7 +53,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+ 
+         # print(tensor_decls, name, arg_names)
+         func_decl = f"""\
+-void nnc_aten_{name}(
++static void nnc_aten_{name}(
+     int64_t bufs_num,
+     void** buf_data,
+     int64_t* buf_ranks,
+diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
+index 7cfbb803f9..2e69bb1868 100644
+--- a/torchgen/decompositions/gen_jit_decompositions.py
++++ b/torchgen/decompositions/gen_jit_decompositions.py
+@@ -1,8 +1,12 @@
+ #!/usr/bin/env python3
+ import os
+ from pathlib import Path
++import sys
+ 
+-from torch.jit._decompositions import decomposition_table
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    from torch.jit._decompositions import decomposition_table
++else:
++    decomposition_table = {}
+ 
+ # from torchgen.code_template import CodeTemplate
+ 
+@@ -85,7 +89,7 @@ def write_decomposition_util_file(path: str) -> None:
+ 
+ 
+ def main() -> None:
+-    pytorch_dir = Path(__file__).resolve().parents[3]
++    pytorch_dir = Path(__file__).resolve().parents[2]
+     upgrader_path = pytorch_dir / "torch" / "csrc" / "jit" / "runtime"
+     write_decomposition_util_file(str(upgrader_path))
+ 
+diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
+index e5287cffc5..57f3c38096 100644
+--- a/torchgen/operator_versions/gen_mobile_upgraders.py
++++ b/torchgen/operator_versions/gen_mobile_upgraders.py
+@@ -2,10 +2,12 @@
+ import os
+ from enum import Enum
+ from pathlib import Path
++import sys
+ from typing import Any, Dict, List
+ 
+-import torch
+-from torch.jit.generate_bytecode import generate_upgraders_bytecode
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    import torch
++    from torch.jit.generate_bytecode import generate_upgraders_bytecode
+ 
+ from torchgen.code_template import CodeTemplate
+ from torchgen.operator_versions.gen_mobile_upgraders_constant import (
+@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+ def construct_version_maps(
+     upgrader_bytecode_function_to_index_map: Dict[str, Any]
+ ) -> str:
+-    version_map = torch._C._get_operator_version_map()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        version_map = torch._C._get_operator_version_map()
++    else:
++        version_map = {}
+     sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0])  # type: ignore[no-any-return]
+     sorted_version_map = {name: lst for name, lst in sorted_version_map_}
+ 
+@@ -379,7 +384,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ 
+ def main() -> None:
+ 
+-    upgrader_list = generate_upgraders_bytecode()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        upgrader_list = generate_upgraders_bytecode()
++    else:
++        upgrader_list = []
+     sorted_upgrader_list = sort_upgrader(upgrader_list)
+     for up in sorted_upgrader_list:
+         print("after sort upgrader : ", next(iter(up)))
+diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
+index c6336a6951..34e394d818 100644
+--- a/torchgen/shape_functions/gen_jit_shape_functions.py
++++ b/torchgen/shape_functions/gen_jit_shape_functions.py
+@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
+ if not file_path.exists():
+     raise Exception(err_msg)
+ 
+-spec = importlib.util.spec_from_file_location(module_name, file_path)
+-assert spec is not None
+-module = importlib.util.module_from_spec(spec)
+-sys.modules[module_name] = module
+-assert spec.loader is not None
+-assert module is not None
+-spec.loader.exec_module(module)
+-
+-bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
+-shape_compute_graph_mapping = module.shape_compute_graph_mapping
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    spec = importlib.util.spec_from_file_location(module_name, file_path)
++    assert spec is not None
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[module_name] = module
++    assert spec.loader is not None
++    assert module is not None
++    spec.loader.exec_module(module)
++
++    bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
++    shape_compute_graph_mapping = module.shape_compute_graph_mapping
++else:
++    bounded_compute_graph_mapping = {}
++    shape_compute_graph_mapping = {}
+ 
+ 
+ SHAPE_HEADER = r"""
diff --git a/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch b/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
new file mode 100644
index 0000000000..6e448ce5c5
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-for-r-torch-system-libraries.patch
@@ -0,0 +1,390 @@
+Patch build files to also system libraries instead of bundled ones for the
+libraries not supported or working only by specifying USE_SYSTEM_LIBS.  This
+includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
+ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
+For QNNPACK, two versions were bundled and are required: The upstream one and
+an internal fork (now in the package qnnpack-pytorch).
+
+diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
+index 96fc29782b..7f27b6654b 100644
+--- a/aten/src/ATen/CMakeLists.txt
++++ b/aten/src/ATen/CMakeLists.txt
+@@ -362,9 +362,9 @@ if(AT_NNPACK_ENABLED)
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
+ endif()
+ 
+-if(MKLDNN_FOUND)
+-  list(APPEND ATen_CPU_DEPENDENCY_LIBS ${MKLDNN_LIBRARIES})
+-endif(MKLDNN_FOUND)
++if(USE_MKLDNN)
++  list(APPEND ATen_CPU_DEPENDENCY_LIBS DNNL::dnnl)
++endif(USE_MKLDNN)
+ 
+ list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
+ 
+diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
+index 221e3f32b2..3bad9d2f9e 100644
+--- a/caffe2/CMakeLists.txt
++++ b/caffe2/CMakeLists.txt
+@@ -110,9 +110,6 @@ if(NOT MSVC AND USE_XNNPACK)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+-    add_subdirectory(
+-      "${FXDIV_SOURCE_DIR}"
+-      "${CMAKE_BINARY_DIR}/FXdiv")
+   endif()
+ endif()
+ 
+@@ -975,7 +972,6 @@ elseif(USE_CUDA)
+ endif()
+ 
+ if(NOT MSVC AND USE_XNNPACK)
+-  TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 
+ # ==========================================================
+@@ -1314,6 +1310,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+ target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
++target_link_libraries(torch_cpu PRIVATE miniz clog)
+ target_include_directories(torch_cpu INTERFACE $<INSTALL_INTERFACE:include>)
+ target_include_directories(torch_cpu PRIVATE ${Caffe2_CPU_INCLUDE})
+ target_include_directories(torch_cpu SYSTEM PRIVATE "${Caffe2_DEPENDENCY_INCLUDE}")
+@@ -1570,7 +1567,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
+   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
+   target_link_libraries(static_runtime_bench torch_library benchmark)
+-  target_link_libraries(static_runtime_test torch_library gtest_main)
++  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
+ endif()
+ 
+ if(BUILD_TENSOREXPR_BENCHMARK)
+@@ -1601,7 +1598,7 @@ if(BUILD_MOBILE_TEST)
+   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
+@@ -1622,13 +1619,13 @@ if(BUILD_TEST)
+         if(NOT MSVC)
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
+           # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
+           if(USE_FBGEMM)
+             target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
+           endif()
+         else()
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
+         endif()
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+@@ -1645,7 +1642,7 @@ if(BUILD_TEST)
+   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+diff --git a/caffe2/serialize/CMakeLists.txt b/caffe2/serialize/CMakeLists.txt
+index 1552b59d0d..67e1a9a1a3 100644
+--- a/caffe2/serialize/CMakeLists.txt
++++ b/caffe2/serialize/CMakeLists.txt
+@@ -2,7 +2,6 @@ file(GLOB tmp *_test.cc)
+ 
+ set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
+ list(APPEND Caffe2_CPU_SRCS
+-  ${PROJECT_SOURCE_DIR}/third_party/miniz-2.1.0/miniz.c
+   ${CMAKE_CURRENT_SOURCE_DIR}/inline_container.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/istream_adapter.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/file_adapter.cc
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index 8c0e3c24bc..d65576ada2 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -298,7 +298,7 @@ endif()
+ # --- [ PocketFFT
+ set(AT_POCKETFFT_ENABLED 0)
+ if(NOT AT_MKL_ENABLED)
+-  set(POCKETFFT_INCLUDE_DIR "${Torch_SOURCE_DIR}/third_party/pocketfft/")
++  set(POCKETFFT_INCLUDE_DIR "#POCKETFFT_INCLUDE_DIR")
+   if(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}")
+     message(FATAL_ERROR "pocketfft directory not found, expected ${POCKETFFT_INCLUDE_DIR}")
+   elif(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}/pocketfft_hdronly.h")
+@@ -501,19 +501,6 @@ if(USE_QNNPACK)
+     set(QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+     set(QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+     set(QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-    add_subdirectory(
+-      "${QNNPACK_SOURCE_DIR}"
+-      "${CONFU_DEPENDENCIES_BINARY_DIR}/QNNPACK")
+-
+-    # TODO: See https://github.com/pytorch/pytorch/issues/56285
+-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+-      target_compile_options(qnnpack PRIVATE -Wno-deprecated-declarations)
+-    endif()
+-
+-    # We build static versions of QNNPACK and pthreadpool but link
+-    # them into a shared library for Caffe2, so they need PIC.
+-    set_property(TARGET qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+     if(QNNPACK_CUSTOM_THREADPOOL)
+       target_compile_definitions(
+@@ -562,13 +549,6 @@ if(USE_PYTORCH_QNNPACK)
+       set(PYTORCH_QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-      add_subdirectory(
+-        "${PYTORCH_QNNPACK_SOURCE_DIR}"
+-        "${CONFU_DEPENDENCIES_BINARY_DIR}/pytorch_qnnpack")
+-      # We build static versions of QNNPACK and pthreadpool but link
+-      # them into a shared library for Caffe2, so they need PIC.
+-      set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-      set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+       if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
+         target_compile_definitions(
+@@ -750,11 +730,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+   # this shouldn't be necessary anymore.
+   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
+   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
+-  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
+-
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
+-  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
+ 
+   # We will not need to test benchmark lib itself.
+   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
+@@ -829,16 +804,6 @@ if(USE_FBGEMM)
+     else()
+       set(FBGEMM_LIBRARY_TYPE "static" CACHE STRING "")
+     endif()
+-    add_subdirectory("${FBGEMM_SOURCE_DIR}")
+-    set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
+-      # See https://github.com/pytorch/pytorch/issues/74352
+-      target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
+-      target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
+-    endif()
+   endif()
+ 
+   if(USE_FBGEMM)
+@@ -1001,7 +966,7 @@ if(NOT TARGET fp16 AND NOT USE_SYSTEM_FP16)
+     "${FP16_SOURCE_DIR}"
+     "${CONFU_DEPENDENCIES_BINARY_DIR}/FP16")
+ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
+-  add_library(fp16 STATIC "/usr/include/fp16.h")
++  add_library(fp16 STATIC "#FP16_INCLUDE_DIR")
+   set_target_properties(fp16 PROPERTIES LINKER_LANGUAGE C)
+ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
+@@ -1395,7 +1360,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ 
+     # Tensorpipe uses cuda_add_library
+     torch_update_find_cuda_flags()
+-    add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
+ 
+     list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
+     if(USE_CUDA)
+@@ -1551,7 +1515,6 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+       set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
+     endif()
+   endif()
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+ 
+   add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+   if(NOT USE_SYSTEM_ONNX)
+@@ -1582,7 +1545,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+     endif()
+     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
+     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
+-    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
++    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
+   endif()
+   include_directories(${FOXI_INCLUDE_DIRS})
+   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
+@@ -1752,9 +1715,8 @@ if(NOT INTERN_BUILD_MOBILE)
+   endif()
+   if(USE_MKLDNN)
+     include(${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake)
+-    if(MKLDNN_FOUND)
++    if(DNNL_FOUND)
+       set(AT_MKLDNN_ENABLED 1)
+-      include_directories(AFTER SYSTEM ${MKLDNN_INCLUDE_DIR})
+       if(BUILD_CAFFE2_OPS)
+         list(APPEND Caffe2_DEPENDENCY_LIBS caffe2::mkldnn)
+       endif(BUILD_CAFFE2_OPS)
+@@ -1819,7 +1781,7 @@ endif()
+ #
+ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
+-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
++find_package(fmt)
+ 
+ # Disable compiler feature checks for `fmt`.
+ #
+@@ -1828,7 +1790,6 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
+ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
+ # `fmt` is compatible with a superset of the compilers that PyTorch is, it
+ # shouldn't be too bad to just disable the checks.
+-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "")
+ 
+ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
+ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
+diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
+index a41343cbb5..6075bdd0a4 100644
+--- a/cmake/External/nnpack.cmake
++++ b/cmake/External/nnpack.cmake
+@@ -40,7 +40,7 @@ endif()
+ # (3) Android, iOS, Linux, macOS - supported
+ ##############################################################################
+ 
+-if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
++if(FALSE)
+   message(STATUS "Brace yourself, we are building NNPACK")
+   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
+ 
+@@ -114,6 +114,5 @@ endif()
+ # (4) Catch-all: not supported.
+ ##############################################################################
+ 
+-message(WARNING "Unknown platform - I don't know how to build NNPACK. "
+-                "See cmake/External/nnpack.cmake for details.")
+-set(USE_NNPACK OFF)
++set(NNPACK_FOUND TRUE)
++set(USE_NNPACK ON)
+diff --git a/cmake/public/mkldnn.cmake b/cmake/public/mkldnn.cmake
+index 50404d3b30..ca067f0087 100644
+--- a/cmake/public/mkldnn.cmake
++++ b/cmake/public/mkldnn.cmake
+@@ -4,7 +4,7 @@ if(CPU_AARCH64)
+   include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake)
+ endif()
+ 
+-find_package(MKLDNN QUIET)
++find_package(DNNL REQUIRED)
+ 
+ if(NOT TARGET caffe2::mkldnn)
+   add_library(caffe2::mkldnn INTERFACE IMPORTED)
+@@ -15,7 +15,7 @@ set_property(
+   ${MKLDNN_INCLUDE_DIR})
+ set_property(
+   TARGET caffe2::mkldnn PROPERTY INTERFACE_LINK_LIBRARIES
+-  ${MKLDNN_LIBRARIES})
++  DNNL::dnnl)
+ if(BUILD_ONEDNN_GRAPH)
+   if(NOT TARGET caffe2::dnnl_graph)
+     add_library(caffe2::dnnl_graph INTERFACE IMPORTED)
+diff --git a/setup.py b/setup.py
+index 34b2854747..5db117f8e7 100644
+--- a/setup.py
++++ b/setup.py
+@@ -418,13 +418,9 @@ def build_deps():
+     # Windows has very poor support for them.
+     sym_files = [
+         'tools/shared/_utils_internal.py',
+-        'torch/utils/benchmark/utils/valgrind_wrapper/callgrind.h',
+-        'torch/utils/benchmark/utils/valgrind_wrapper/valgrind.h',
+     ]
+     orig_files = [
+         'torch/_utils_internal.py',
+-        'third_party/valgrind-headers/callgrind.h',
+-        'third_party/valgrind-headers/valgrind.h',
+     ]
+     for sym_file, orig_file in zip(sym_files, orig_files):
+         same = False
+diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
+index 89c6b9155f..0c60d08452 100644
+--- a/test/cpp/c10d/CMakeLists.txt
++++ b/test/cpp/c10d/CMakeLists.txt
+@@ -16,14 +16,14 @@ function(c10d_add_test test_src)
+   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
+ endfunction()
+ 
+-c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
+-c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
++c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
++c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
+ if(INSTALL_TEST)
+   install(TARGETS FileStoreTest DESTINATION bin)
+   install(TARGETS TCPStoreTest DESTINATION bin)
+ endif()
+ if(NOT WIN32)
+-  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
++  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
+   if(INSTALL_TEST)
+     install(TARGETS HashStoreTest DESTINATION bin)
+   endif()
+@@ -31,11 +31,11 @@ endif()
+ 
+ if(USE_CUDA)
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
+     endif()
+-    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
++    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
+   endif()
+   if(USE_NCCL AND USE_C10D_NCCL)
+     # NCCL is a private dependency of libtorch, but the tests include some
+@@ -44,10 +44,10 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupNCCLTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     c10d_add_test(
+       ProcessGroupNCCLErrorsTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+       install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+@@ -61,7 +61,7 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupUCCTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_ucc)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_ucc)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupUCCTest DESTINATION bin)
+       install(TARGETS c10d_cuda_test DESTINATION lib)
+@@ -69,7 +69,7 @@ if(USE_CUDA)
+   endif()
+ else()
+   if(USE_GLOO AND USE_C10D_GLOO)
+-    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
++    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
+   endif()
+ endif()
+ 
+diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
+index 7dff70630d..90b1003591 100644
+--- a/test/cpp/tensorexpr/CMakeLists.txt
++++ b/test/cpp/tensorexpr/CMakeLists.txt
+@@ -54,7 +54,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+ # pthreadpool header. For some build environment we need add the dependency
+ # explicitly.
+ if(USE_PTHREADPOOL)
+-  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
++  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
+ endif()
+ if(USE_CUDA)
+   target_link_libraries(test_tensorexpr PRIVATE
diff --git a/gnu/packages/patches/python-pytorch2-system-libraries.patch b/gnu/packages/patches/python-pytorch2-system-libraries.patch
deleted file mode 100644
index c2c44badbb..0000000000
--- a/gnu/packages/patches/python-pytorch2-system-libraries.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
-
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
---- a/caffe2/CMakeLists.txt	2023-12-27 12:14:24.308751288 +0100
-+++ b/caffe2/CMakeLists.txt	2023-12-27 12:30:15.941562126 +0100
-@@ -1570,7 +1570,7 @@
-   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
-   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
-   target_link_libraries(static_runtime_bench torch_library benchmark)
--  target_link_libraries(static_runtime_test torch_library gtest_main)
-+  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
- endif()
- 
- if(BUILD_TENSOREXPR_BENCHMARK)
-@@ -1601,7 +1601,7 @@
-   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
-@@ -1628,7 +1628,7 @@
-           endif()
-         else()
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
--          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
-+          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
-         endif()
-         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
-         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-@@ -1645,7 +1645,7 @@
-   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1666,7 +1666,7 @@
-     foreach(test_src ${Caffe2_MPS_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 557ab649..ee9cf410 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -732,11 +732,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1543,7 +1538,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cb..6075bdd0 100644
---- a/cmake/External/nnpack.cmake
-+++ b/cmake/External/nnpack.cmake
-@@ -40,7 +40,7 @@ endif()
- # (3) Android, iOS, Linux, macOS - supported
- ##############################################################################
- 
--if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-+if(FALSE)
-   message(STATUS "Brace yourself, we are building NNPACK")
-   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
- 
-@@ -114,6 +114,5 @@ endif()
- # (4) Catch-all: not supported.
- ##############################################################################
- 
--message(WARNING "Unknown platform - I don't know how to build NNPACK. "
--                "See cmake/External/nnpack.cmake for details.")
--set(USE_NNPACK OFF)
-+set(NNPACK_FOUND TRUE)
-+set(USE_NNPACK ON)
-diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
-index bf91460c..ef56948f 100644
---- a/test/cpp/c10d/CMakeLists.txt
-+++ b/test/cpp/c10d/CMakeLists.txt
-@@ -16,14 +16,14 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main)
--c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main)
-+c10d_add_test(FileStoreTest.cpp torch_cpu gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp torch_cpu gtest_main gtest)
- if(INSTALL_TEST)
-   install(TARGETS FileStoreTest DESTINATION bin)
-   install(TARGETS TCPStoreTest DESTINATION bin)
- endif()
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main)
-+  c10d_add_test(HashStoreTest.cpp torch_cpu gtest_main gtest)
-   if(INSTALL_TEST)
-     install(TARGETS HashStoreTest DESTINATION bin)
-   endif()
-@@ -31,11 +31,11 @@ endif()
- 
- if(USE_CUDA)
-   if(USE_GLOO AND USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
-     if(INSTALL_TEST)
-       install(TARGETS ProcessGroupGlooTest DESTINATION bin)
-     endif()
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp torch_cpu c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_NCCL AND USE_C10D_NCCL)
-     # NCCL is a private dependency of libtorch, but the tests include some
-@@ -56,7 +56,7 @@ if(USE_CUDA)
-   endif()
- else()
-   if(USE_GLOO AND USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp torch_cpu gtest_main gtest)
-   endif()
- endif()
- 
-diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
-index 8fc5a0a1..643202f6 100644
---- a/test/cpp/tensorexpr/CMakeLists.txt
-+++ b/test/cpp/tensorexpr/CMakeLists.txt
-@@ -53,7 +53,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
- # pthreadpool header. For some build environment we need add the dependency
- # explicitly.
- if(USE_PTHREADPOOL)
--  target_link_libraries(test_tensorexpr PRIVATE pthreadpool_interface)
-+  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
- endif()
- if(USE_CUDA)
-   target_link_libraries(test_tensorexpr PRIVATE
-- 
2.41.0






^ permalink raw reply related	[relevance 43%]

* [bug#69591] [PATCH 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies.
                     ` (5 preceding siblings ...)
  2024-03-06 19:40 65% ` [bug#69591] [PATCH 07/31] gnu: Add python-pytest-rerunfailures-13 David Elsing
@ 2024-03-06 19:40 48% ` David Elsing
  2024-03-06 19:40 43% ` [bug#69591] [PATCH 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-06 19:40 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

Autogenerated files are also regenerated. The tests can be run, but are
disabled, as they require a long time.

* gnu/packages/machine-learning.scm (python-pytorch): Update to 2.2.1.
[version]: Use %python-pytorch-version.
[source]: Use %python-pytorch-src.
[arguments]: Remove 'make-things-writable phase.  Add 'cmake-patches,
'set-max-jobs, 'codegen1, 'codegen2, 'build2, 'install2 phases. Adjust
'use-system-libraries and 'check phases.
[native-inputs]: Add doxygen, ideep-pytorch, pocketfft-cpp, python-expecttest,
python-pytest-flakefinder, python-pytest-rerunfailures-13,
python-pytest-shard, python-pytest-xdist, python-hypothesis,
python-types-dataclasses, python-typing-extensions-4.10 and valgrind.
[inputs]: Add asmjit, clog, flatbuffers-next, foxi, fxdiv, libuv,
miniz-for-pytorch, qnnpack, qnnpack-pytorch, fbgemm and oneapi-dnnl. Use
nnpack, fbgemm and oneapi-dnnl only for supported systems.
[propagated-inputs]: Add python-filelock, python-fsspec, python-jinja2,
python-networkx, python-optree, python-packaging, python-psutil and
python-sympy. Remove python-cffi and python-six.
(%python-pytorch-src)[source]: Add patches.
* gnu/packages/patches/python-pytorch-runpath.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-system-libraries.patch: Adjust patch.
* gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch: Remove file.
* gnu/packages/patches/python-pytorch-fix-codegen.patch: New file.
* gnu/packages/patches/python-pytorch-without-kineto: New file.
* gnu/local.mk (dist_patch_DATA): Register them.
---
 gnu/local.mk                                  |   2 +-
 gnu/packages/machine-learning.scm             | 318 ++++++++++-------
 ...ython-pytorch-1.9.0-system-libraries.patch | 139 --------
 .../patches/python-pytorch-fix-codegen.patch  | 167 +++++++++
 .../patches/python-pytorch-runpath.patch      |  19 +-
 .../python-pytorch-system-libraries.patch     | 324 +++++++++++++++---
 .../python-pytorch-without-kineto.patch       |  60 ++++
 7 files changed, 720 insertions(+), 309 deletions(-)
 delete mode 100644 gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
 create mode 100644 gnu/packages/patches/python-pytorch-fix-codegen.patch
 create mode 100644 gnu/packages/patches/python-pytorch-without-kineto.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index bba56e7ebe..84eeb39c8b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1927,7 +1927,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch	\
   %D%/packages/patches/python-pytorch-runpath.patch		\
   %D%/packages/patches/python-pytorch-system-libraries.patch	\
-  %D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
+  %D%/packages/patches/python-pytorch-without-kineto.patch	\
   %D%/packages/patches/python-robotframework-atest.patch	\
   %D%/packages/patches/python-robotframework-source-date-epoch.patch \
   %D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index eed649f118..f5e19bcaff 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -104,6 +104,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages parallel)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages protobuf)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
@@ -122,6 +123,7 @@ (define-module (gnu packages machine-learning)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages valgrind)
   #:use-module (gnu packages vulkan)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
@@ -4322,6 +4324,13 @@ (define %python-pytorch-src
     (sha256
      (base32
       "03mm0pwwb5lxdsmmiw3cch9fijgjw81kmmc4ln9rlyazkm7l1r48"))
+    (patches (search-patches "python-pytorch-system-libraries.patch"
+                             "python-pytorch-runpath.patch"
+                             "python-pytorch-without-kineto.patch"
+                             ;; Some autogeneration scripts depend on the
+                             ;; compile PyTorch library. Therefore, we create
+                             ;; dummy versions which are regenerated later.
+                             "python-pytorch-fix-codegen.patch"))
     (modules '((guix build utils)))
     (snippet
      '(begin
@@ -4441,135 +4450,204 @@ (define-public qnnpack-pytorch
 (define-public python-pytorch
   (package
     (name "python-pytorch")
-    (version "1.13.1")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/pytorch/pytorch")
-                    (commit (string-append "v" version))
-                    (recursive? #t)))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "17yxjzwp4zp75fz7czgz9acijzw7dpyqcza50v8y1x7hfg2gw369"))
-              (patches (search-patches "python-pytorch-system-libraries.patch"
-                                       "python-pytorch-runpath.patch"))
-              (modules '((guix build utils)))
-              (snippet
-               '(begin
-                  ;; XXX: Let's be clear: this package is a bundling fest.  We
-                  ;; delete as much as we can, but there's still a lot left.
-                  (for-each (lambda (directory)
-                              (delete-file-recursively
-                               (string-append "third_party/" directory)))
-                            '("benchmark" "cpuinfo" "eigen"
-
-                              ;; FIXME: QNNPACK (of which XNNPACK is a fork)
-                              ;; needs these.
-                              ;; "FP16" "FXdiv" "gemmlowp" "psimd"
-
-                              "gloo" "googletest" "ios-cmake" "NNPACK"
-                              "onnx" "protobuf" "pthreadpool"
-                              "pybind11" "python-enum" "python-peachpy"
-                              "python-six" "tbb" "XNNPACK" "zstd"))
-                  (substitute* "functorch/CMakeLists.txt"
-                    (("\\$\\{_rpath_portable_origin\\}/../torch/lib")
-                     "$ORIGIN/../torch/lib"))))))
+    (version %python-pytorch-version)
+    (source %python-pytorch-src)
     (build-system python-build-system)
     (arguments
-     '(#:phases (modify-phases %standard-phases
-                  (add-before 'build 'use-system-libraries
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
-                      ;; want to use "system libraries" instead of the bundled
-                      ;; ones.
-                      (setenv "USE_SYSTEM_LIBS" "1")
-
-                      (substitute* "cmake/Dependencies.cmake"
-                        (("if\\(USE_SYSTEM_BIND11\\)")
-                         "if(TRUE)"))
-
-                      ;; XXX: Disable that for simplicity for now.
-                      (setenv "USE_FBGEMM" "0")))
-                  (add-before 'build 'make-things-writable
-                    (lambda _
-                      ;; The 'build_caffe2' function in
-                      ;; 'tools/build_pytorch_libs.py', called from the
-                      ;; top-level 'setup.py', needs write access to this
-                      ;; directory.
-                      (for-each make-file-writable
-                                (find-files "caffe2/proto" "."
-                                            #:directories? #t))))
-                  (replace 'check
-                    (lambda* (#:key inputs outputs tests? #:allow-other-keys)
-                      ;; Run the test suite following the instructions in
-                      ;; 'CONTRIBUTING.md'.  XXX: Unfortunately this doesn't
-                      ;; work, unless you set GUIX_PYTHONPATH presumably.
-                      (when tests?
-                        (add-installed-pythonpath inputs outputs)
-                        (invoke "python" "test/run_test.py"))))
-                  (add-after 'install 'remove-test-executables
-                    (lambda* (#:key inputs outputs #:allow-other-keys)
-                      ;; Remove test executables, but keep other executables
-                      ;; such as 'torch_shm_manager' and and .so files such as
-                      ;; 'libtorch_global_deps.so'.
-                      (let ((python-site (site-packages inputs outputs)))
-                        (for-each delete-file
-                                  (find-files python-site
-                                              "(^test_cpp_rpc|_test)$")))))
-                  (add-after 'install 'remove-caffe2-onnx-scripts
-                    (lambda* (#:key outputs #:allow-other-keys)
-                      (let* ((out (assoc-ref outputs "out"))
-                             (bin (string-append out "/bin")))
-                        ;; Remove 'convert-caffe2-to-onnx' and
-                        ;; 'convert-onnx-to-caffe2': they seem to be
-                        ;; deprecated and they cause a failure of the
-                        ;; 'sanity-check' phase:
-                        ;;
-                        ;; ImportError: cannot import name 'metanet_pb2' from partially initialized module 'caffe2.proto' (most likely due to a circular import)
-                        (for-each delete-file
-                                  (find-files bin "^convert-.*caffe2"))
-
-                        (substitute* (find-files out "^entry_points\\.txt$")
-                          (("^convert-.*" all)
-                           (string-append "# " all "\n")))))))
-
-       ;; XXX: Tests attempt to download data such as
-       ;; <https://raw.githubusercontent.com/pytorch/test-infra/master/stats/slow-tests.json>.
-       ;; We're also missing some Python modules, such as expecttest.
-       #:tests? #f))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'cmake-patches
+            (lambda _
+              (substitute* "cmake/Dependencies.cmake"
+                (("#POCKETFFT_INCLUDE_DIR")
+                 (string-append
+                  #$(this-package-native-input "pocketfft-cpp") "/include"))
+                (("#FP16_INCLUDE_DIR")
+                 (string-append
+                  #$(this-package-input "fp16") "/include")))))
+          (add-before 'build 'use-system-libraries
+            (lambda _
+              (substitute* '("caffe2/serialize/crc.cc"
+                             "caffe2/serialize/inline_container.cc")
+                (("\"miniz\\.h\"") "<miniz/miniz.h>"))
+              (substitute*
+                  (cons*
+                   "torch/csrc/Module.cpp"
+                   (map
+                    (lambda (name)
+                      (string-append
+                       "torch/utils/benchmark/utils/valgrind_wrapper/"
+                       name))
+                    '("compat_bindings.cpp" "timer_callgrind_template.cpp")))
+                (("<callgrind.h>") "<valgrind/callgrind.h>"))
+              ;; Tell 'setup.py' to let 'CMakeLists.txt' know that we
+              ;; want to use "system libraries" instead of the bundled
+              ;; ones.
+              (setenv "USE_SYSTEM_LIBS" "1")
+              ;; For oneDNN
+              (setenv "USE_MKLDNN" "1")
+              ;; Only works with CUPTI
+              (setenv "USE_KINETO" "0")
+              ;; Prevent CMake error by disabling explicitely
+              (setenv "USE_ITT" "0")))
+          (add-after 'use-system-libraries 'set-max-jobs
+            (lambda _
+              (setenv "MAX_JOBS" (number->string (parallel-job-count)))))
+          (add-after 'set-max-jobs 'codegen1
+            (lambda _
+              (with-directory-excursion "torch/csrc/jit/tensorexpr"
+                (setenv "PYTHONPATH" "../../../..")
+                (invoke "python3" "codegen_external.py")
+                (setenv "PYTHONPATH" #f))
+
+              (invoke "python3" "aten/src/ATen/nnapi/codegen.py")
+
+              (invoke "bash" "tools/gen_flatbuffers.sh")
+
+              ;; Generate dummy files as the generation depends on the compiled
+              ;; library. They are regenerated later.
+              (setenv "PYTHONPATH" ".")
+              (invoke "python3"
+                      "torchgen/operator_versions/gen_mobile_upgraders.py"
+                      "dummy")
+              (setenv "PYTHONPATH" #f)
+
+              (invoke "python3"
+                      "torchgen/shape_functions/gen_jit_shape_functions.py"
+                      "dummy")
+
+              (invoke "python3"
+                      "torchgen/decompositions/gen_jit_decompositions.py"
+                      "dummy")))
+          ;; Properly generate autogenerated files ...
+          (add-after 'install 'codegen2
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (add-installed-pythonpath inputs outputs)
+              (invoke "python3"
+                      "torchgen/operator_versions/gen_mobile_upgraders.py")
+              (invoke "python3"
+                      "torchgen/shape_functions/gen_jit_shape_functions.py")
+              (invoke "python3"
+                      "torchgen/decompositions/gen_jit_decompositions.py")))
+          ;; ... rebuild their dependencies ...
+          (add-after 'codegen2 'build2
+            (lambda _
+              (invoke "python3" "setup.py" "build")))
+          ;; ... and install again.
+          (add-after 'build2 'install2
+            (lambda _
+              (invoke "python3" "setup.py" "install" (string-append "--prefix=" #$output)
+                      "--no-compile" "--single-version-externally-managed" "--root=/")
+              (invoke "python" "-m" "compileall"
+                      "--invalidation-mode=unchecked-hash" #$output)))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              ;; Run the test suite following the instructions in
+              ;; 'CONTRIBUTING.md'. Unfortunately this doesn't work, unless
+              ;; you set PYTHONPATH or GUIX_PYTHONPATH, but this is done in
+              ;; the codegen2 phase already.
+              (when tests?
+                (invoke "python3" "test/run_test.py" "--core"))))
+          (add-after 'install2 'remove-test-executables
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              ;; Remove test executables, but keep other executables
+              ;; such as 'torch_shm_manager' and and .so files such as
+              ;; 'libtorch_global_deps.so'.
+              (let ((python-site (site-packages inputs outputs)))
+                (for-each delete-file
+                          (find-files python-site
+                                      "(^test_cpp_rpc|_test)$")))))
+          (add-after 'install2 'remove-caffe2-onnx-scripts
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (bin (string-append out "/bin")))
+                ;; Remove 'convert-caffe2-to-onnx' and
+                ;; 'convert-onnx-to-caffe2': they seem to be
+                ;; deprecated and they cause a failure of the
+                ;; 'sanity-check' phase:
+                ;;
+                ;; ImportError: cannot import name 'metanet_pb2' from partially initialized module 'caffe2.proto' (most likely due to a circular import)
+                (for-each delete-file
+                          (find-files bin "^convert-.*caffe2"))
+
+                (substitute* (find-files out "^entry_points\\.txt$")
+                  (("^convert-.*" all)
+                   (string-append "# " all "\n")))))))
+
+      ;; Even only the core tests take a very long time to run.
+      #:tests? #f))
     (native-inputs
-     (list cmake ninja))
+     (list cmake
+           doxygen
+           ideep-pytorch
+           ninja
+           pocketfft-cpp
+           python-expecttest
+           python-pytest-flakefinder
+           python-pytest-rerunfailures-13
+           python-pytest-shard
+           python-pytest-xdist
+           python-hypothesis
+           python-types-dataclasses
+           python-typing-extensions-4.10
+           valgrind))
     (inputs
-     (list eigen
-           ;; ("fmt" ,fmt)
-           fp16
-           gemmlowp
-           googletest
-           googlebenchmark
-           gloo
-           nnpack
-           openblas
-           openmpi
-           pthreadpool
-           protobuf
-           pybind11
-           sleef
-           xnnpack
-           zstd))
+     (append
+      (list asmjit
+            clog
+            eigen
+            flatbuffers-next
+            fmt
+            foxi
+            fp16
+            fxdiv
+            gemmlowp
+            googletest
+            googlebenchmark
+            gloo
+            libuv
+            miniz-for-pytorch
+            openblas
+            openmpi
+            pthreadpool
+            protobuf
+            pybind11
+            qnnpack
+            qnnpack-pytorch
+            sleef
+            tensorpipe
+            xnnpack
+            zstd)
+      ;; TODO: fix build on 32 bit systems
+      (filter
+       (lambda (pkg)
+         (member (or (%current-target-system)
+                     (%current-system))
+                 (package-transitive-supported-systems pkg)))
+       (list
+        nnpack
+        fbgemm
+        oneapi-dnnl))))
     (propagated-inputs
-     (list python-astunparse
+     (list cpuinfo
+           onnx ;propagated for its Python modules
+           onnx-optimizer
+           python-astunparse
            python-click
+           python-filelock
+           python-fsspec
+           python-future
+           python-jinja2
+           python-networkx
            python-numpy
+           python-optree
+           python-packaging
+           python-psutil
            python-pyyaml
-           python-cffi
-           python-typing-extensions
-           python-future
-           python-six
            python-requests
-           onnx                             ;propagated for its Python modules
-           onnx-optimizer
-           cpuinfo))
+           python-sympy
+           python-typing-extensions))
     (home-page "https://pytorch.org/")
     (synopsis "Python library for tensor computation and deep neural networks")
     (description
diff --git a/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch b/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
deleted file mode 100644
index 76c06520f0..0000000000
--- a/gnu/packages/patches/python-pytorch-1.9.0-system-libraries.patch
+++ /dev/null
@@ -1,139 +0,0 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
-
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 5d57b9ca78..620cca4e60 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -644,11 +644,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
-   # this shouldn't be necessary anymore.
-   get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-   set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
--  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest)
--  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${INC_DIR_temp})
--
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googletest/include)
--  include_directories(BEFORE SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../third_party/googletest/googlemock/include)
- 
-   # We will not need to test benchmark lib itself.
-   set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1485,7 +1480,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
-     endif()
-     set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
-     message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
--    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx)
-+    list(APPEND Caffe2_DEPENDENCY_LIBS onnx_proto onnx onnx_optimizer)
-   endif()
-   include_directories(${FOXI_INCLUDE_DIRS})
-   list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
-
-diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 50ebb224ce..5953d9ddf7 100644
---- a/caffe2/CMakeLists.txt
-+++ b/caffe2/CMakeLists.txt
-@@ -1632,7 +1632,7 @@ if(BUILD_TEST)
-         if(NOT MSVC)
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
-           # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
--          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
-+          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
-           if(USE_FBGEMM)
-             target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
-           endif()
-@@ -1655,7 +1655,7 @@ if(BUILD_TEST)
-   foreach(test_src ${Caffe2_CPU_TEST_SRCS})
-     get_filename_component(test_name ${test_src} NAME_WE)
-     add_executable(${test_name} "${test_src}")
--    target_link_libraries(${test_name} torch_library gtest_main)
-+    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
-     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-@@ -1673,7 +1673,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_GPU_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       cuda_add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1691,7 +1691,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1709,7 +1709,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_HIP_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
-       target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
-
-diff --git a/torch/lib/c10d/test/CMakeLists.txt b/torch/lib/c10d/test/CMakeLists.txt
-index b74d4b65f7..fc7c207505 100644
---- a/torch/lib/c10d/test/CMakeLists.txt
-+++ b/torch/lib/c10d/test/CMakeLists.txt
-@@ -16,24 +16,24 @@ function(c10d_add_test test_src)
-   add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
- endfunction()
- 
--c10d_add_test(FileStoreTest.cpp c10d gtest_main)
--c10d_add_test(TCPStoreTest.cpp c10d gtest_main)
-+c10d_add_test(FileStoreTest.cpp c10d gtest_main gtest)
-+c10d_add_test(TCPStoreTest.cpp c10d gtest_main gtest)
- if(NOT WIN32)
--  c10d_add_test(HashStoreTest.cpp c10d gtest_main)
-+  c10d_add_test(HashStoreTest.cpp c10d gtest_main gtest)
- endif()
- 
- if(USE_CUDA)
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main)
--    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d c10d_cuda_test gtest_main gtest)
-+    c10d_add_test(ProcessGroupGlooAsyncTest.cpp c10d c10d_cuda_test gtest_main gtest)
-   endif()
-   if(USE_C10D_NCCL)
--    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main)
-+    c10d_add_test(ProcessGroupNCCLTest.cpp c10d c10d_cuda_test gtest_main gtest)
-     c10d_add_test(ProcessGroupNCCLErrorsTest.cpp c10d c10d_cuda_test
--        gtest_main)
-+        gtest_main gtest)
-   endif()
- else()
-   if(USE_C10D_GLOO)
--    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main)
-+    c10d_add_test(ProcessGroupGlooTest.cpp c10d gtest_main gtest)
-   endif()
- endif()
-
-diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cbb5..6075bdd0a4 100644
---- a/cmake/External/nnpack.cmake
-+++ b/cmake/External/nnpack.cmake
-@@ -40,7 +40,7 @@ endif()
- # (3) Android, iOS, Linux, macOS - supported
- ##############################################################################
- 
--if(ANDROID OR IOS OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-+if(FALSE)
-   message(STATUS "Brace yourself, we are building NNPACK")
-   set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
- 
-@@ -114,6 +114,5 @@ endif()
- # (4) Catch-all: not supported.
- ##############################################################################
- 
--message(WARNING "Unknown platform - I don't know how to build NNPACK. "
--                "See cmake/External/nnpack.cmake for details.")
--set(USE_NNPACK OFF)
-+set(NNPACK_FOUND TRUE)
-+set(USE_NNPACK ON)
diff --git a/gnu/packages/patches/python-pytorch-fix-codegen.patch b/gnu/packages/patches/python-pytorch-fix-codegen.patch
new file mode 100644
index 0000000000..cb246b25de
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-fix-codegen.patch
@@ -0,0 +1,167 @@
+This patch fixes some scripts for generating source files.  For
+gen_jit_decompositions.py, gen_mobile_upgraders.py and
+gen_jit_shape_functions.py, which depend on the compiled PyTorch library, the
+option to generate "dummy" source files is added for the initial build, which
+is later corrected.  codegen_external.py is patched to avoid duplicate
+functions and add the static keyword as in the existing generated file.
+
+diff --git a/tools/gen_flatbuffers.sh b/tools/gen_flatbuffers.sh
+index cc0263dbbf..ac34e84b82 100644
+--- a/tools/gen_flatbuffers.sh
++++ b/tools/gen_flatbuffers.sh
+@@ -1,13 +1,13 @@
+ #!/bin/bash
+ ROOT=$(pwd)
+-FF_LOCATION="$ROOT/third_party/flatbuffers"
+-cd "$FF_LOCATION" || exit
+-mkdir build
+-cd build || exit
+-cmake ..
+-cmake --build . --target flatc
+-mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
+-./flatc --cpp --gen-mutable --scoped-enums \
++#FF_LOCATION="$ROOT/third_party/flatbuffers"
++#cd "$FF_LOCATION" || exit
++#mkdir build
++#cd build || exit
++#cmake ..
++#cmake --build . --target flatc
++#mkdir -p "$ROOT/build/torch/csrc/jit/serialization"
++flatc --cpp --gen-mutable --scoped-enums \
+      -o "$ROOT/torch/csrc/jit/serialization" \
+      -c "$ROOT/torch/csrc/jit/serialization/mobile_bytecode.fbs"
+ echo '// @generated' >> "$ROOT/torch/csrc/jit/serialization/mobile_bytecode_generated.h"
+diff --git a/torch/csrc/jit/tensorexpr/codegen_external.py b/torch/csrc/jit/tensorexpr/codegen_external.py
+index bc69b05162..0f8df81de3 100644
+--- a/torch/csrc/jit/tensorexpr/codegen_external.py
++++ b/torch/csrc/jit/tensorexpr/codegen_external.py
+@@ -20,9 +20,14 @@ def gen_external(native_functions_path, tags_path, external_path):
+     native_functions = parse_native_yaml(native_functions_path, tags_path)
+     func_decls = []
+     func_registrations = []
+-    for func in native_functions:
++    done_names = set()
++    for func in native_functions[0]:
+         schema = func.func
+         name = schema.name.name.base
++        if name in done_names:
++            continue
++        else:
++            done_names.add(name)
+         args = schema.arguments
+         # Only supports extern calls for functions with out variants
+         if not schema.is_out_fn():
+@@ -62,7 +67,7 @@ def gen_external(native_functions_path, tags_path, external_path):
+ 
+         # print(tensor_decls, name, arg_names)
+         func_decl = f"""\
+-void nnc_aten_{name}(
++static void nnc_aten_{name}(
+     int64_t bufs_num,
+     void** buf_data,
+     int64_t* buf_ranks,
+diff --git a/torchgen/decompositions/gen_jit_decompositions.py b/torchgen/decompositions/gen_jit_decompositions.py
+index 7cfbb803f9..2e69bb1868 100644
+--- a/torchgen/decompositions/gen_jit_decompositions.py
++++ b/torchgen/decompositions/gen_jit_decompositions.py
+@@ -1,8 +1,12 @@
+ #!/usr/bin/env python3
+ import os
+ from pathlib import Path
++import sys
+ 
+-from torch.jit._decompositions import decomposition_table
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    from torch.jit._decompositions import decomposition_table
++else:
++    decomposition_table = {}
+ 
+ # from torchgen.code_template import CodeTemplate
+ 
+@@ -85,7 +89,7 @@ def write_decomposition_util_file(path: str) -> None:
+ 
+ 
+ def main() -> None:
+-    pytorch_dir = Path(__file__).resolve().parents[3]
++    pytorch_dir = Path(__file__).resolve().parents[2]
+     upgrader_path = pytorch_dir / "torch" / "csrc" / "jit" / "runtime"
+     write_decomposition_util_file(str(upgrader_path))
+ 
+diff --git a/torchgen/operator_versions/gen_mobile_upgraders.py b/torchgen/operator_versions/gen_mobile_upgraders.py
+index dab1568580..55c58715fc 100644
+--- a/torchgen/operator_versions/gen_mobile_upgraders.py
++++ b/torchgen/operator_versions/gen_mobile_upgraders.py
+@@ -2,10 +2,12 @@
+ import os
+ from enum import Enum
+ from pathlib import Path
++import sys
+ from typing import Any, Dict, List
+ 
+-import torch
+-from torch.jit.generate_bytecode import generate_upgraders_bytecode
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    import torch
++    from torch.jit.generate_bytecode import generate_upgraders_bytecode
+ 
+ from torchgen.code_template import CodeTemplate
+ from torchgen.operator_versions.gen_mobile_upgraders_constant import (
+@@ -262,7 +264,10 @@ def construct_register_size(register_size_from_yaml: int) -> str:
+ def construct_version_maps(
+     upgrader_bytecode_function_to_index_map: Dict[str, Any]
+ ) -> str:
+-    version_map = torch._C._get_operator_version_map()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        version_map = torch._C._get_operator_version_map()
++    else:
++        version_map = {}
+     sorted_version_map_ = sorted(version_map.items(), key=lambda item: item[0])  # type: ignore[no-any-return]
+     sorted_version_map = dict(sorted_version_map_)
+ 
+@@ -378,7 +383,10 @@ def sort_upgrader(upgrader_list: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ 
+ 
+ def main() -> None:
+-    upgrader_list = generate_upgraders_bytecode()
++    if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++        upgrader_list = generate_upgraders_bytecode()
++    else:
++        upgrader_list = []
+     sorted_upgrader_list = sort_upgrader(upgrader_list)
+     for up in sorted_upgrader_list:
+         print("after sort upgrader : ", next(iter(up)))
+diff --git a/torchgen/shape_functions/gen_jit_shape_functions.py b/torchgen/shape_functions/gen_jit_shape_functions.py
+index c6336a6951..34e394d818 100644
+--- a/torchgen/shape_functions/gen_jit_shape_functions.py
++++ b/torchgen/shape_functions/gen_jit_shape_functions.py
+@@ -18,16 +18,20 @@ you are in the root directory of the Pytorch git repo"""
+ if not file_path.exists():
+     raise Exception(err_msg)
+ 
+-spec = importlib.util.spec_from_file_location(module_name, file_path)
+-assert spec is not None
+-module = importlib.util.module_from_spec(spec)
+-sys.modules[module_name] = module
+-assert spec.loader is not None
+-assert module is not None
+-spec.loader.exec_module(module)
+-
+-bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
+-shape_compute_graph_mapping = module.shape_compute_graph_mapping
++if len(sys.argv) < 2 or sys.argv[1] != "dummy":
++    spec = importlib.util.spec_from_file_location(module_name, file_path)
++    assert spec is not None
++    module = importlib.util.module_from_spec(spec)
++    sys.modules[module_name] = module
++    assert spec.loader is not None
++    assert module is not None
++    spec.loader.exec_module(module)
++
++    bounded_compute_graph_mapping = module.bounded_compute_graph_mapping
++    shape_compute_graph_mapping = module.shape_compute_graph_mapping
++else:
++    bounded_compute_graph_mapping = {}
++    shape_compute_graph_mapping = {}
+ 
+ 
+ SHAPE_HEADER = r"""
diff --git a/gnu/packages/patches/python-pytorch-runpath.patch b/gnu/packages/patches/python-pytorch-runpath.patch
index 7f95b88a2b..2c1724cdb0 100644
--- a/gnu/packages/patches/python-pytorch-runpath.patch
+++ b/gnu/packages/patches/python-pytorch-runpath.patch
@@ -3,10 +3,10 @@ get installed, quite surprisingly, to 'lib/python3.8/site-packages/{bin,lib}'.
 Make sure RUNPATH matches that.
 
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index 5b5622f0..30d27e57 100644
+index 74836372..c8eb69d1 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1909,7 +1909,7 @@ if(BUILD_PYTHON)
+@@ -1910,7 +1910,7 @@ if(BUILD_PYTHON)
    if(${BUILDING_WITH_TORCH_LIBS})
      # site-packages/caffe2/python/caffe2_pybind11_state
      # site-packages/torch/lib
@@ -16,7 +16,7 @@ index 5b5622f0..30d27e57 100644
  
    # Must also include `CMAKE_SHARED_LINKER_FLAGS` in linker flags for
 diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index ee9cf410..f190e69b 100644
+index acc95842..8f8fb7d7 100644
 --- a/cmake/Dependencies.cmake
 +++ b/cmake/Dependencies.cmake
 @@ -4,7 +4,7 @@ if(APPLE)
@@ -28,3 +28,16 @@ index ee9cf410..f190e69b 100644
  endif(APPLE)
  # Use separate rpaths during build and install phases
  set(CMAKE_SKIP_BUILD_RPATH  FALSE)
+diff --git a/functorch/CMakeLists.txt b/functorch/CMakeLists.txt
+index f2f32745..db21b656 100644
+--- a/functorch/CMakeLists.txt
++++ b/functorch/CMakeLists.txt
+@@ -21,7 +21,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE pybind::pybind11)
+ 
+ set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
+       ${CMAKE_BINARY_DIR}/functorch)
+-set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${_rpath_portable_origin}/../torch/lib")
++set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN/../torch/lib")
+ 
+ # Copy-pasted prefix/suffix logic for Python extensions from
+ # https://github.com/pytorch/pytorch/blob/33bb8ae350611760139457b85842b1d7edf9aa11/caffe2/CMakeLists.txt#L1975
diff --git a/gnu/packages/patches/python-pytorch-system-libraries.patch b/gnu/packages/patches/python-pytorch-system-libraries.patch
index fd849fd9e2..676b96eb71 100644
--- a/gnu/packages/patches/python-pytorch-system-libraries.patch
+++ b/gnu/packages/patches/python-pytorch-system-libraries.patch
@@ -1,60 +1,163 @@
-Use our own googletest rather than the bundled one.
-Get NNPACK to use our own PeachPy rather than the bundled one.
+Patch build files to also system libraries instead of bundled ones for the
+libraries not supported or working only by specifying USE_SYSTEM_LIBS.  This
+includes using the clog, cpuinfo, fbgemm, foxi, fp16, fxdiv, googletest,
+ideep, miniz, nnpack, oneapi-dnnl, pocketfft, pthreadpool, qnnpack,
+qnnpack-pytorch, tensorpipe, valgrind and xnnpack packages.
+For QNNPACK, two versions were bundled and are required: The upstream one and
+an internal fork (now in the package qnnpack-pytorch).
 
+diff --git a/aten/src/ATen/CMakeLists.txt b/aten/src/ATen/CMakeLists.txt
+index 2c2b9674..5ac5fa6e 100644
+--- a/aten/src/ATen/CMakeLists.txt
++++ b/aten/src/ATen/CMakeLists.txt
+@@ -371,9 +371,9 @@ if(AT_NNPACK_ENABLED)
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS nnpack) # cpuinfo is added below
+ endif()
+ 
+-if(MKLDNN_FOUND)
+-  list(APPEND ATen_CPU_DEPENDENCY_LIBS ${MKLDNN_LIBRARIES})
+-endif(MKLDNN_FOUND)
++if(USE_MKLDNN)
++  list(APPEND ATen_CPU_DEPENDENCY_LIBS DNNL::dnnl)
++endif(USE_MKLDNN)
+ 
+ if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(s390x|ppc64le)$")
+   list(APPEND ATen_CPU_DEPENDENCY_LIBS cpuinfo)
 diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
-index d57d7ebb..5b5622f0 100644
+index 74836372..b01fd143 100644
 --- a/caffe2/CMakeLists.txt
 +++ b/caffe2/CMakeLists.txt
-@@ -1736,7 +1736,7 @@ if(BUILD_TEST)
+@@ -111,9 +111,6 @@ if(NOT MSVC AND USE_XNNPACK)
+   if(NOT TARGET fxdiv)
+     set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
+     set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
+-    add_subdirectory(
+-      "${FXDIV_SOURCE_DIR}"
+-      "${CMAKE_BINARY_DIR}/FXdiv")
+   endif()
+ endif()
+ 
+@@ -1055,7 +1052,6 @@ elseif(USE_CUDA)
+ endif()
+ 
+ if(NOT MSVC AND USE_XNNPACK)
+-  TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
+ endif()
+ 
+ # ==========================================================
+@@ -1396,6 +1392,7 @@ target_link_libraries(torch_cpu PUBLIC c10)
+ target_link_libraries(torch_cpu PUBLIC ${Caffe2_PUBLIC_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_LIBS})
+ target_link_libraries(torch_cpu PRIVATE ${Caffe2_DEPENDENCY_WHOLE_LINK_LIBS})
++target_link_libraries(torch_cpu PRIVATE miniz clog)
+ if(USE_MPI)
+   target_link_libraries(torch_cpu PRIVATE MPI::MPI_CXX)
+ endif()
+@@ -1653,7 +1650,7 @@ if(BUILD_STATIC_RUNTIME_BENCHMARK)
+   add_executable(static_runtime_bench "${STATIC_RUNTIME_BENCHMARK_SRCS}")
+   add_executable(static_runtime_test "${STATIC_RUNTIME_TEST_SRCS}")
+   target_link_libraries(static_runtime_bench torch_library benchmark)
+-  target_link_libraries(static_runtime_test torch_library gtest_main)
++  target_link_libraries(static_runtime_test torch_library gtest_main gtest)
+ endif()
+ 
+ if(BUILD_TENSOREXPR_BENCHMARK)
+@@ -1680,7 +1677,7 @@ if(BUILD_MOBILE_TEST)
+   foreach(test_src ${ATen_MOBILE_TEST_SRCS})
+     get_filename_component(test_name ${test_src} NAME_WE)
+     add_executable(${test_name} "${test_src}")
+-    target_link_libraries(${test_name} torch_library gtest_main)
++    target_link_libraries(${test_name} torch_library gtest_main gtest)
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${ATen_CPU_INCLUDE})
+@@ -1701,7 +1698,7 @@ if(BUILD_TEST)
          if(NOT MSVC)
-           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/affine_quantizer_base.cpp)
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}" ../aten/src/ATen/native/quantized/AffineQuantizerBase.cpp)
            # TODO: Get rid of c10 dependency (which is only needed for the implementation of AT_ERROR)
 -          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main)
 +          target_link_libraries(${test_name}_${CPU_CAPABILITY} c10 sleef gtest_main gtest)
            if(USE_FBGEMM)
              target_link_libraries(${test_name}_${CPU_CAPABILITY} fbgemm)
            endif()
-@@ -1759,7 +1759,7 @@ if(BUILD_TEST)
+@@ -1715,7 +1712,7 @@ if(BUILD_TEST)
+           endif()
+         else()
+           add_executable(${test_name}_${CPU_CAPABILITY} "${test_src}")
+-          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main)
++          target_link_libraries(${test_name}_${CPU_CAPABILITY} torch_library gtest_main gtest)
+         endif()
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<INSTALL_INTERFACE:include>)
+         target_include_directories(${test_name}_${CPU_CAPABILITY} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+@@ -1732,7 +1729,7 @@ if(BUILD_TEST)
    foreach(test_src ${Caffe2_CPU_TEST_SRCS})
      get_filename_component(test_name ${test_src} NAME_WE)
      add_executable(${test_name} "${test_src}")
 -    target_link_libraries(${test_name} torch_library gtest_main)
 +    target_link_libraries(${test_name} torch_library gtest_main gtest)
-     if(USE_OPENMP)
-       # -fopenmp is a compile time flag and as result not guaranteed
-       # to link executable against OpenMP runtime library
-@@ -1785,7 +1785,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_GPU_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1803,7 +1803,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_VULKAN_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
-       add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
-@@ -1821,7 +1821,7 @@ if(BUILD_TEST)
-     foreach(test_src ${Caffe2_HIP_TEST_SRCS})
-       get_filename_component(test_name ${test_src} NAME_WE)
-       add_executable(${test_name} "${test_src}")
--      target_link_libraries(${test_name} torch_library gtest_main)
-+      target_link_libraries(${test_name} torch_library gtest_main gtest)
-       target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
-       target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE} ${Caffe2_HIP_INCLUDE})
-       target_compile_options(${test_name} PRIVATE ${HIP_CXX_FLAGS})
+     target_include_directories(${test_name} PRIVATE $<INSTALL_INTERFACE:include>)
+     target_include_directories(${test_name} PRIVATE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
+     target_include_directories(${test_name} PRIVATE ${Caffe2_CPU_INCLUDE})
+diff --git a/caffe2/serialize/CMakeLists.txt b/caffe2/serialize/CMakeLists.txt
+index 1552b59d..67e1a9a1 100644
+--- a/caffe2/serialize/CMakeLists.txt
++++ b/caffe2/serialize/CMakeLists.txt
+@@ -2,7 +2,6 @@ file(GLOB tmp *_test.cc)
+ 
+ set(Caffe2_CPU_TEST_SRCS ${Caffe2_CPU_TEST_SRCS} ${tmp})
+ list(APPEND Caffe2_CPU_SRCS
+-  ${PROJECT_SOURCE_DIR}/third_party/miniz-2.1.0/miniz.c
+   ${CMAKE_CURRENT_SOURCE_DIR}/inline_container.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/istream_adapter.cc
+   ${CMAKE_CURRENT_SOURCE_DIR}/file_adapter.cc
 diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 557ab649..ee9cf410 100644
+index acc95842..97275bfe 100644
 --- a/cmake/Dependencies.cmake
 +++ b/cmake/Dependencies.cmake
-@@ -732,11 +732,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
+@@ -283,7 +283,7 @@ endif()
+ # --- [ PocketFFT
+ set(AT_POCKETFFT_ENABLED 0)
+ if(NOT AT_MKL_ENABLED)
+-  set(POCKETFFT_INCLUDE_DIR "${Torch_SOURCE_DIR}/third_party/pocketfft/")
++  set(POCKETFFT_INCLUDE_DIR "#POCKETFFT_INCLUDE_DIR")
+   if(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}")
+     message(FATAL_ERROR "pocketfft directory not found, expected ${POCKETFFT_INCLUDE_DIR}")
+   elif(NOT EXISTS "${POCKETFFT_INCLUDE_DIR}/pocketfft_hdronly.h")
+@@ -489,19 +489,6 @@ if(USE_QNNPACK)
+     set(QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+     set(QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+     set(QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-    add_subdirectory(
+-      "${QNNPACK_SOURCE_DIR}"
+-      "${CONFU_DEPENDENCIES_BINARY_DIR}/QNNPACK")
+-
+-    # TODO: See https://github.com/pytorch/pytorch/issues/56285
+-    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+-      target_compile_options(qnnpack PRIVATE -Wno-deprecated-declarations)
+-    endif()
+-
+-    # We build static versions of QNNPACK and pthreadpool but link
+-    # them into a shared library for Caffe2, so they need PIC.
+-    set_property(TARGET qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+     if(QNNPACK_CUSTOM_THREADPOOL)
+       target_compile_definitions(
+@@ -550,13 +537,6 @@ if(USE_PYTORCH_QNNPACK)
+       set(PYTORCH_QNNPACK_BUILD_TESTS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_BUILD_BENCHMARKS OFF CACHE BOOL "")
+       set(PYTORCH_QNNPACK_LIBRARY_TYPE "static" CACHE STRING "")
+-      add_subdirectory(
+-        "${PYTORCH_QNNPACK_SOURCE_DIR}"
+-        "${CONFU_DEPENDENCIES_BINARY_DIR}/pytorch_qnnpack")
+-      # We build static versions of QNNPACK and pthreadpool but link
+-      # them into a shared library for Caffe2, so they need PIC.
+-      set_property(TARGET pytorch_qnnpack PROPERTY POSITION_INDEPENDENT_CODE ON)
+-      set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+ 
+       if(PYTORCH_QNNPACK_CUSTOM_THREADPOOL)
+         target_compile_definitions(
+@@ -728,11 +708,6 @@ if(BUILD_TEST OR BUILD_MOBILE_BENCHMARK OR BUILD_MOBILE_TEST)
    # this shouldn't be necessary anymore.
    get_property(INC_DIR_temp DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
    set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "")
@@ -66,7 +169,49 @@ index 557ab649..ee9cf410 100644
  
    # We will not need to test benchmark lib itself.
    set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Disable benchmark testing as we don't need it.")
-@@ -1543,7 +1538,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+@@ -810,16 +785,6 @@ if(USE_FBGEMM)
+     if(USE_ASAN)
+       set(USE_SANITIZER "address,undefined" CACHE STRING "-fsanitize options for FBGEMM")
+     endif()
+-    add_subdirectory("${FBGEMM_SOURCE_DIR}")
+-    set_property(TARGET fbgemm_generic PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm_avx512 PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    set_property(TARGET fbgemm PROPERTY POSITION_INDEPENDENT_CODE ON)
+-    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)
+-      # See https://github.com/pytorch/pytorch/issues/74352
+-      target_compile_options_if_supported(asmjit -Wno-deprecated-copy)
+-      target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
+-    endif()
+   endif()
+ 
+   if(USE_FBGEMM)
+@@ -979,7 +944,7 @@ if(NOT TARGET fp16 AND NOT USE_SYSTEM_FP16)
+     "${FP16_SOURCE_DIR}"
+     "${CONFU_DEPENDENCIES_BINARY_DIR}/FP16")
+ elseif(NOT TARGET fp16 AND USE_SYSTEM_FP16)
+-  add_library(fp16 STATIC "/usr/include/fp16.h")
++  add_library(fp16 STATIC "#FP16_INCLUDE_DIR")
+   set_target_properties(fp16 PROPERTIES LINKER_LANGUAGE C)
+ endif()
+ list(APPEND Caffe2_DEPENDENCY_LIBS fp16)
+@@ -1362,7 +1327,6 @@ if(USE_DISTRIBUTED AND USE_TENSORPIPE)
+ 
+     # Tensorpipe uses cuda_add_library
+     torch_update_find_cuda_flags()
+-    add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/tensorpipe)
+ 
+     list(APPEND Caffe2_DEPENDENCY_LIBS tensorpipe)
+     if(USE_CUDA)
+@@ -1529,7 +1493,6 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
+       set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
+     endif()
+   endif()
+-  add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
+ 
+   add_definitions(-DONNX_NAMESPACE=${ONNX_NAMESPACE})
+   if(NOT USE_SYSTEM_ONNX)
+@@ -1560,7 +1523,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
      endif()
      set_property(TARGET onnx_proto PROPERTY IMPORTED_LOCATION ${ONNX_PROTO_LIBRARY})
      message("-- Found onnx: ${ONNX_LIBRARY} ${ONNX_PROTO_LIBRARY}")
@@ -75,8 +220,36 @@ index 557ab649..ee9cf410 100644
    endif()
    include_directories(${FOXI_INCLUDE_DIRS})
    list(APPEND Caffe2_DEPENDENCY_LIBS foxi_loader)
+@@ -1739,9 +1702,8 @@ if(NOT INTERN_BUILD_MOBILE)
+   endif()
+   if(USE_MKLDNN)
+     include(${CMAKE_CURRENT_LIST_DIR}/public/mkldnn.cmake)
+-    if(MKLDNN_FOUND)
++    if(DNNL_FOUND)
+       set(AT_MKLDNN_ENABLED 1)
+-      include_directories(AFTER SYSTEM ${MKLDNN_INCLUDE_DIR})
+       if(BUILD_CAFFE2_OPS)
+         list(APPEND Caffe2_DEPENDENCY_LIBS caffe2::mkldnn)
+       endif(BUILD_CAFFE2_OPS)
+@@ -1796,7 +1758,7 @@ endif()
+ #
+ set(TEMP_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
+-add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
++find_package(fmt)
+ 
+ # Disable compiler feature checks for `fmt`.
+ #
+@@ -1805,7 +1767,6 @@ add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/fmt)
+ # CMAKE_CXX_FLAGS in ways that break feature checks. Since we already know
+ # `fmt` is compatible with a superset of the compilers that PyTorch is, it
+ # shouldn't be too bad to just disable the checks.
+-set_target_properties(fmt-header-only PROPERTIES INTERFACE_COMPILE_FEATURES "")
+ 
+ list(APPEND Caffe2_DEPENDENCY_LIBS fmt::fmt-header-only)
+ set(BUILD_SHARED_LIBS ${TEMP_BUILD_SHARED_LIBS} CACHE BOOL "Build shared libs" FORCE)
 diff --git a/cmake/External/nnpack.cmake b/cmake/External/nnpack.cmake
-index a41343cb..6075bdd0 100644
+index 9d5f0643..c3624e58 100644
 --- a/cmake/External/nnpack.cmake
 +++ b/cmake/External/nnpack.cmake
 @@ -40,7 +40,7 @@ endif()
@@ -88,7 +261,7 @@ index a41343cb..6075bdd0 100644
    message(STATUS "Brace yourself, we are building NNPACK")
    set(CAFFE2_THIRD_PARTY_ROOT ${PROJECT_SOURCE_DIR}/third_party)
  
-@@ -114,6 +114,5 @@ endif()
+@@ -112,6 +112,5 @@ endif()
  # (4) Catch-all: not supported.
  ##############################################################################
  
@@ -97,8 +270,45 @@ index a41343cb..6075bdd0 100644
 -set(USE_NNPACK OFF)
 +set(NNPACK_FOUND TRUE)
 +set(USE_NNPACK ON)
+diff --git a/cmake/public/mkldnn.cmake b/cmake/public/mkldnn.cmake
+index 87935625..9f8fa3df 100644
+--- a/cmake/public/mkldnn.cmake
++++ b/cmake/public/mkldnn.cmake
+@@ -4,7 +4,7 @@ if(CPU_AARCH64)
+   include(${CMAKE_CURRENT_LIST_DIR}/ComputeLibrary.cmake)
+ endif()
+ 
+-find_package(MKLDNN QUIET)
++find_package(DNNL REQUIRED)
+ 
+ if(NOT TARGET caffe2::mkldnn)
+   add_library(caffe2::mkldnn INTERFACE IMPORTED)
+@@ -15,4 +15,4 @@ set_property(
+   ${MKLDNN_INCLUDE_DIR})
+ set_property(
+   TARGET caffe2::mkldnn PROPERTY INTERFACE_LINK_LIBRARIES
+-  ${MKLDNN_LIBRARIES})
++  DNNL::dnnl)
+diff --git a/setup.py b/setup.py
+index 81f3c6cb..3251cab5 100644
+--- a/setup.py
++++ b/setup.py
+@@ -482,13 +482,9 @@ def build_deps():
+     # Windows has very poor support for them.
+     sym_files = [
+         "tools/shared/_utils_internal.py",
+-        "torch/utils/benchmark/utils/valgrind_wrapper/callgrind.h",
+-        "torch/utils/benchmark/utils/valgrind_wrapper/valgrind.h",
+     ]
+     orig_files = [
+         "torch/_utils_internal.py",
+-        "third_party/valgrind-headers/callgrind.h",
+-        "third_party/valgrind-headers/valgrind.h",
+     ]
+     for sym_file, orig_file in zip(sym_files, orig_files):
+         same = False
 diff --git a/test/cpp/c10d/CMakeLists.txt b/test/cpp/c10d/CMakeLists.txt
-index bf91460c..ef56948f 100644
+index 5c897483..ef84c571 100644
 --- a/test/cpp/c10d/CMakeLists.txt
 +++ b/test/cpp/c10d/CMakeLists.txt
 @@ -16,14 +16,14 @@ function(c10d_add_test test_src)
@@ -133,7 +343,29 @@ index bf91460c..ef56948f 100644
    endif()
    if(USE_NCCL AND USE_C10D_NCCL)
      # NCCL is a private dependency of libtorch, but the tests include some
-@@ -56,7 +56,7 @@ if(USE_CUDA)
+@@ -44,10 +44,10 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupNCCLTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     c10d_add_test(
+       ProcessGroupNCCLErrorsTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_nccl)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_nccl)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupNCCLTest DESTINATION bin)
+       install(TARGETS ProcessGroupNCCLErrorsTest DESTINATION bin)
+@@ -61,7 +61,7 @@ if(USE_CUDA)
+     # a private dependency of the tests as well.
+     c10d_add_test(
+       ProcessGroupUCCTest.cpp
+-      torch_cpu c10d_cuda_test gtest_main __caffe2_ucc)
++      torch_cpu c10d_cuda_test gtest_main gtest __caffe2_ucc)
+     if(INSTALL_TEST)
+       install(TARGETS ProcessGroupUCCTest DESTINATION bin)
+       install(TARGETS c10d_cuda_test DESTINATION lib)
+@@ -69,7 +69,7 @@ if(USE_CUDA)
    endif()
  else()
    if(USE_GLOO AND USE_C10D_GLOO)
@@ -143,10 +375,10 @@ index bf91460c..ef56948f 100644
  endif()
  
 diff --git a/test/cpp/tensorexpr/CMakeLists.txt b/test/cpp/tensorexpr/CMakeLists.txt
-index 8fc5a0a1..643202f6 100644
+index 012471d0..d39b625e 100644
 --- a/test/cpp/tensorexpr/CMakeLists.txt
 +++ b/test/cpp/tensorexpr/CMakeLists.txt
-@@ -53,7 +53,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
+@@ -54,7 +54,7 @@ target_include_directories(tutorial_tensorexpr PRIVATE ${ATen_CPU_INCLUDE})
  # pthreadpool header. For some build environment we need add the dependency
  # explicitly.
  if(USE_PTHREADPOOL)
@@ -154,4 +386,4 @@ index 8fc5a0a1..643202f6 100644
 +  target_link_libraries(test_tensorexpr PRIVATE pthreadpool)
  endif()
  if(USE_CUDA)
-   target_link_libraries(test_tensorexpr PRIVATE
+   target_compile_definitions(test_tensorexpr PRIVATE USE_CUDA)
diff --git a/gnu/packages/patches/python-pytorch-without-kineto.patch b/gnu/packages/patches/python-pytorch-without-kineto.patch
new file mode 100644
index 0000000000..f956316866
--- /dev/null
+++ b/gnu/packages/patches/python-pytorch-without-kineto.patch
@@ -0,0 +1,60 @@
+Even when building without Kineto, the <ActivityType.h> header is still
+imported and the ActivityType type is used. This patch was copied from
+https://github.com/pytorch/pytorch/pull/111048.
+
+diff --git a/torch/csrc/profiler/kineto_shim.h b/torch/csrc/profiler/kineto_shim.h
+index e92cbf00..68985ab7 100644
+--- a/torch/csrc/profiler/kineto_shim.h
++++ b/torch/csrc/profiler/kineto_shim.h
+@@ -12,7 +12,51 @@
+ #undef USE_KINETO
+ #endif
+ 
++#ifdef USE_KINETO
+ #include <ActivityType.h>
++#else
++namespace libkineto {
++// copied from header
++/*
++ * Copyright (c) Meta Platforms, Inc. and affiliates.
++ * All rights reserved.
++ *
++ * This source code is licensed under the BSD-style license found in the
++ * LICENSE file in the root directory of this source tree.
++ */
++
++// Note : All activity types are not enabled by default. Please add them
++// at correct position in the enum
++enum class ActivityType {
++    // Activity types enabled by default
++    CPU_OP = 0, // cpu side ops
++    USER_ANNOTATION,
++    GPU_USER_ANNOTATION,
++    GPU_MEMCPY,
++    GPU_MEMSET,
++    CONCURRENT_KERNEL, // on-device kernels
++    EXTERNAL_CORRELATION,
++    CUDA_RUNTIME, // host side cuda runtime events
++    CUDA_DRIVER, // host side cuda driver events
++    CPU_INSTANT_EVENT, // host side point-like events
++    PYTHON_FUNCTION,
++    OVERHEAD, // CUPTI induced overhead events sampled from its overhead API.
++
++    // Optional Activity types
++    CUDA_SYNC, // synchronization events between runtime and kernels
++    GLOW_RUNTIME, // host side glow runtime events
++    MTIA_RUNTIME, // host side MTIA runtime events
++    CUDA_PROFILER_RANGE, // CUPTI Profiler range for performance metrics
++    MTIA_CCP_EVENTS, // MTIA ondevice CCP events
++    HPU_OP, // HPU host side runtime event
++    XPU_RUNTIME, // host side xpu runtime events
++
++    ENUM_COUNT, // This is to add buffer and not used for any profiling logic. Add your new type before it.
++    OPTIONAL_ACTIVITY_TYPE_START = CUDA_SYNC,
++};
++}
++
++#endif
+ 
+ #include <torch/csrc/Export.h>
+ #include <torch/csrc/profiler/api.h>
-- 
2.41.0





^ permalink raw reply related	[relevance 48%]

* [bug#69591] [PATCH 06/31] gnu: Add python-expecttest.
                     ` (3 preceding siblings ...)
  2024-03-06 19:40 65% ` [bug#69591] [PATCH 05/31] gnu: Add python-pytest-shard David Elsing
@ 2024-03-06 19:40 64% ` David Elsing
  2024-03-06 19:40 65% ` [bug#69591] [PATCH 07/31] gnu: Add python-pytest-rerunfailures-13 David Elsing
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-06 19:40 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-expecttest): New variable.
---
 gnu/packages/python-check.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 2338f32801..94694316ca 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2077,6 +2077,41 @@ (define-public python-eradicate
 valid Python syntax that are likely to be commented out code.")
     (license license:expat)))
 
+(define-public python-expecttest
+  (let ((commit "683b09a352cc426851adc2e3a9f46e0ab25e4dee")
+        (revision "0"))
+    (package
+      (name "python-expecttest")
+      (version (git-version "0.2.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ezyang/expecttest")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1djwxp9x1hczzxbimv1b1bmd083am88v27l82nmlkhvzyg2cmpvv"))))
+      (build-system pyproject-build-system)
+      (arguments
+       (list
+        #:phases
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  ;; The test runs tests expected to fail, so the output is
+                  ;; confusing
+                  (invoke "python3" "test_expecttest.py")))))))
+      (native-inputs (list python-hypothesis poetry))
+      (home-page "https://github.com/ezyang/expecttest")
+      (synopsis "Python module for expect tests")
+      (description "@code{expecttest} is a Python module for expect tests, where
+the initial expected value of a test can be automatically set by running the
+test itself.")
+      (license license:expat))))
+
 (define-public python-robber
   (package
     (name "python-robber")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69591] [PATCH 07/31] gnu: Add python-pytest-rerunfailures-13.
                     ` (4 preceding siblings ...)
  2024-03-06 19:40 64% ` [bug#69591] [PATCH 06/31] gnu: Add python-expecttest David Elsing
@ 2024-03-06 19:40 65% ` David Elsing
  2024-03-06 19:40 48% ` [bug#69591] [PATCH 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
  2024-03-06 19:40 43% ` [bug#69591] [PATCH 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-06 19:40 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-rerunfailures-13): New variable.
---
 gnu/packages/python-check.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 94694316ca..67822c4c50 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -2463,6 +2463,17 @@ (define-public python-pytest-rerunfailures
 eliminate flaky failures.")
     (license license:mpl2.0)))
 
+(define-public python-pytest-rerunfailures-13
+  (package
+    (inherit python-pytest-rerunfailures)
+    (version "13.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-rerunfailures" version))
+       (sha256
+        (base32 "16cin0chv59w4rvnd6r0fisp0s8avmp07rwn9da6yixw43jdncp1"))))))
+
 (define-public python-xunitparser
   (package
     (name "python-xunitparser")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH 05/31] gnu: Add python-pytest-shard.
                     ` (2 preceding siblings ...)
  2024-03-06 19:40 65% ` [bug#69591] [PATCH 04/31] gnu: Add python-pytest-flakefinder David Elsing
@ 2024-03-06 19:40 65% ` David Elsing
  2024-03-06 19:40 64% ` [bug#69591] [PATCH 06/31] gnu: Add python-expecttest David Elsing
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-06 19:40 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-shard): New variable.
---
 gnu/packages/python-check.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 36d4025b9d..2338f32801 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -209,6 +209,30 @@ (define-public python-pytest-flakefinder
 times and detect flakyness.")
     (license license:asl2.0)))
 
+(define-public python-pytest-shard
+  (let ((commit "64610a08dac6b0511b6d51cf895d0e1040d162ad")
+        (revision "0"))
+    (package
+      (name "python-pytest-shard")
+      (version (git-version "0.1.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/AdamGleave/pytest-shard")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1h31m68igz670bzl307hazjrfbr8pk14mxflllar18ydmlrnl677"))))
+      (build-system pyproject-build-system)
+      (propagated-inputs (list python-pytest))
+      (home-page "https://github.com/AdamGleave/pytest-shard")
+      (synopsis "Pytest plugin for sharding tests")
+      (description "This package provides a Pytest extension for sharding
+tests at the granularity of individual test cases, which can be run in
+parallel and on multiple machines.")
+      (license license:expat))))
+
 (define-public python-testfixtures
   (package
     (name "python-testfixtures")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH 02/31] gnu: Add python-typing-extensions-4.10.
  @ 2024-03-06 19:40 65% ` David Elsing
  2024-03-06 19:40 64% ` [bug#69591] [PATCH 03/31] gnu: Add python-optree David Elsing
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-06 19:40 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-build.scm (python-typing-extensions-4.10): New variable.
---
 gnu/packages/python-build.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 2ea457cdba..21e7e422f9 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -252,6 +252,18 @@ (define-public python-typing-extensions
 @end enumerate\n")
     (license license:psfl)))
 
+(define-public python-typing-extensions-4.10
+  (package
+    (inherit python-typing-extensions)
+    (version "4.10.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "typing_extensions" version))
+       (sha256
+        (base32
+         "1jxkj4pni8pdyrn79sq441lsp40xzw363n0qvfc6zfcgkv4dgaxh"))))))
+
 \f
 ;;;
 ;;; Python builder packages.
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH 04/31] gnu: Add python-pytest-flakefinder.
    2024-03-06 19:40 65% ` [bug#69591] [PATCH 02/31] gnu: Add python-typing-extensions-4.10 David Elsing
  2024-03-06 19:40 64% ` [bug#69591] [PATCH 03/31] gnu: Add python-optree David Elsing
@ 2024-03-06 19:40 65% ` David Elsing
  2024-03-06 19:40 65% ` [bug#69591] [PATCH 05/31] gnu: Add python-pytest-shard David Elsing
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-06 19:40 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-check.scm (python-pytest-flakefinder): New variable.
---
 gnu/packages/python-check.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-check.scm b/gnu/packages/python-check.scm
index 51a38bbcbe..36d4025b9d 100644
--- a/gnu/packages/python-check.scm
+++ b/gnu/packages/python-check.scm
@@ -191,6 +191,24 @@ (define-public python-pytest-csv
 it adds to the Pytest command line interface (CLI).")
     (license license:gpl3+)))
 
+(define-public python-pytest-flakefinder
+  (package
+    (name "python-pytest-flakefinder")
+    (version "1.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pytest-flakefinder" version))
+       (sha256
+        (base32 "03iy80xlkpgzjs2kxa9rrj8dbnp9awyhpcl3hy8fgf5x40cjlhg2"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-pytest))
+    (home-page "https://github.com/dropbox/pytest-flakefinder")
+    (synopsis "Pytest plugin for finding flaky tests")
+    (description "This package provides a Pytest plugin to run tests multiple
+times and detect flakyness.")
+    (license license:asl2.0)))
+
 (define-public python-testfixtures
   (package
     (name "python-testfixtures")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69591] [PATCH 03/31] gnu: Add python-optree.
    2024-03-06 19:40 65% ` [bug#69591] [PATCH 02/31] gnu: Add python-typing-extensions-4.10 David Elsing
@ 2024-03-06 19:40 64% ` David Elsing
  2024-03-06 19:40 65% ` [bug#69591] [PATCH 04/31] gnu: Add python-pytest-flakefinder David Elsing
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 200+ results
From: David Elsing @ 2024-03-06 19:40 UTC (permalink / raw)
  To: 69591; +Cc: David Elsing

* gnu/packages/python-xyz.scm (python-optree): New variable.
---
 .../patches/python-optree-fix-32-bit.patch    | 122 ++++++++++++++++++
 gnu/packages/python-xyz.scm                   |  29 +++++
 2 files changed, 151 insertions(+)
 create mode 100644 gnu/packages/patches/python-optree-fix-32-bit.patch

diff --git a/gnu/packages/patches/python-optree-fix-32-bit.patch b/gnu/packages/patches/python-optree-fix-32-bit.patch
new file mode 100644
index 0000000000..6a32c39bd8
--- /dev/null
+++ b/gnu/packages/patches/python-optree-fix-32-bit.patch
@@ -0,0 +1,122 @@
+In include/utils.h, ssize_t is an alias for py::ssize_t, which is an alias for
+Py_ssize_t in Python, which is an alias for the system ssize_t.
+The latter is defined in glibc as int if __WORDSIZE == 32 and as long int if
+__WORDSIZE == 64.  Therefore, we need to remove the explicit template
+specialization for int in the first case.
+
+diff --git a/include/utils.h b/include/utils.h
+index 950a02b..82a9591 100644
+--- a/include/utils.h
++++ b/include/utils.h
+@@ -141,10 +141,12 @@ template <>
+ inline py::handle GET_ITEM_HANDLE<py::tuple>(const py::handle& container, const size_t& item) {
+     return PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::tuple>(const py::handle& container, const int& item) {
+     return PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#endif
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const ssize_t& item) {
+     return PyList_GET_ITEM(container.ptr(), item);
+@@ -153,10 +155,12 @@ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const size_t& item) {
+     return PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::handle GET_ITEM_HANDLE<py::list>(const py::handle& container, const int& item) {
+     return PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline py::object GET_ITEM_BORROW(const py::handle& container, const Item& item) {
+@@ -171,11 +175,13 @@ inline py::object GET_ITEM_BORROW<py::tuple>(const py::handle& container, const
+     return py::reinterpret_borrow<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_BORROW<py::tuple>(const py::handle& container, const int& item) {
+     return py::reinterpret_borrow<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ template <>
+ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const ssize_t& item) {
+     return py::reinterpret_borrow<py::object>(PyList_GET_ITEM(container.ptr(), item));
+@@ -185,11 +191,13 @@ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const s
+     return py::reinterpret_borrow<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_BORROW<py::list>(const py::handle& container, const int& item) {
+     return py::reinterpret_borrow<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline py::object GET_ITEM_STEAL(const py::handle& container, const Item& item) {
+@@ -204,11 +212,13 @@ inline py::object GET_ITEM_STEAL<py::tuple>(const py::handle& container, const s
+     return py::reinterpret_steal<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_STEAL<py::tuple>(const py::handle& container, const int& item) {
+     return py::reinterpret_steal<py::object>(
+         PyTuple_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ template <>
+ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const ssize_t& item) {
+     return py::reinterpret_steal<py::object>(PyList_GET_ITEM(container.ptr(), item));
+@@ -218,11 +228,13 @@ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const si
+     return py::reinterpret_steal<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline py::object GET_ITEM_STEAL<py::list>(const py::handle& container, const int& item) {
+     return py::reinterpret_steal<py::object>(
+         PyList_GET_ITEM(container.ptr(), py::ssize_t_cast(item)));
+ }
++#endif
+ 
+ template <typename Container, typename Item>
+ inline void SET_ITEM(const py::handle& container, const Item& item, const py::handle& value) {
+@@ -240,12 +252,14 @@ inline void SET_ITEM<py::tuple>(const py::handle& container,
+                                 const py::handle& value) {
+     PyTuple_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline void SET_ITEM<py::tuple>(const py::handle& container,
+                                 const int& item,
+                                 const py::handle& value) {
+     PyTuple_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#endif
+ template <>
+ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const ssize_t& item,
+@@ -258,12 +272,14 @@ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const py::handle& value) {
+     PyList_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#if __WORDSIZE != 32
+ template <>
+ inline void SET_ITEM<py::list>(const py::handle& container,
+                                const int& item,
+                                const py::handle& value) {
+     PyList_SET_ITEM(container.ptr(), py::ssize_t_cast(item), value.inc_ref().ptr());
+ }
++#endif
+ 
+ template <typename PyType>
+ inline void AssertExact(const py::handle& object) {
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index fc6e997b6c..e1e68ca343 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -11635,6 +11635,35 @@ (define-public python-treelib
      "This package provides a Python implementation of a tree structure.")
     (license license:asl2.0)))
 
+(define-public python-optree
+  (package
+    (name "python-optree")
+    (version "0.10.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/metaopt/optree")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1q3wljk7cyl5rsam02sfsj8zjrqx4c3x9vic8j6xx13p8czpsisg"))
+       (patches (search-patches "python-optree-fix-32-bit.patch"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-typing-extensions))
+    (native-inputs
+     (list python-pytest
+           python-pytest-cov
+           python-pytest-xdist
+           cmake
+           pybind11))
+    (home-page "https://github.com/metaopt/optree")
+    (synopsis "Optimized PyTree Utilities")
+    (description "This package contains operations on PyTrees (a tree made of
+container data structures in Python).")
+    (license license:asl2.0)))
+
 (define-public python-jupyter-core
   (package
     (name "python-jupyter-core")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#60240] [PATCH v3] gnu: Add python-3.12 and python-next.
    2024-02-21 12:13 34% ` [bug#60240] [PATCH v2] gnu: Add python-3.12 and python-next Tanguy Le Carrour
@ 2024-03-06 12:55 35% ` Tanguy Le Carrour
  2024-03-07 18:45 34% ` [bug#60240] [PATCH v4] " Tanguy Le Carrour
  2024-03-07 18:58 35% ` [bug#60240] [PATCH v5] " Tanguy Le Carrour
  3 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-03-06 12:55 UTC (permalink / raw)
  To: 60240
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

Patch v3 changes the name of the package to `python-next` and
actually exclude Tcl/Tk from `out`. Thanks Lars!

* gnu/packages/python.scm (python-3.12, python-next): New variables.
* gnu/packages/patches/python-3.12-fix-tests.patch: New file.

Change-Id: Ie393b732a8863569578e72e62603b75a1655a34e
---
 .../patches/python-3.12-fix-tests.patch       | 334 +++++++++++++++
 gnu/packages/python.scm                       | 385 +++++++++++++++++-
 2 files changed, 718 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/python-3.12-fix-tests.patch

diff --git a/gnu/packages/patches/python-3.12-fix-tests.patch b/gnu/packages/patches/python-3.12-fix-tests.patch
new file mode 100644
index 0000000000..fa5c8027ce
--- /dev/null
+++ b/gnu/packages/patches/python-3.12-fix-tests.patch
@@ -0,0 +1,334 @@
+From f0698133e7d6c353a3e6ae0fc62e57ba558a9bc0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 28 Oct 2020 22:55:05 -0400
+Subject: [PATCH] Skip problematic Python 3 tests in Guix.
+
+A subset of the hunks in this patch is tracked upstream at
+https://bugs.python.org/issue38845, which was contributed by Tanguy Le
+Carrour <tanguy@bioneland.org>.
+
+diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
+index e42c7ab4bd..8087c84dab 100644
+--- a/Lib/test/_test_multiprocessing.py
++++ b/Lib/test/_test_multiprocessing.py
+@@ -1695,6 +1695,7 @@ def _test_wait_result(cls, c, pid):
+         if pid is not None:
+             os.kill(pid, signal.SIGINT)
+
++    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
+     def test_wait_result(self):
+         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
+             pid = os.getpid()
+@@ -4150,6 +4151,7 @@ def test_shared_memory_across_processes(self):
+         sms.close()
+
+     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
+         # bpo-36368: protect SharedMemoryManager server process from
+         # KeyboardInterrupt signals.
+diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
+index 85c8152d49..e35cfffe84 100644
+--- a/Lib/test/test_asyncio/test_base_events.py
++++ b/Lib/test/test_asyncio/test_base_events.py
+@@ -1377,6 +1377,8 @@ def test_create_connection_no_inet_pton(self, m_socket):
+         self._test_create_connection_ip_addr(m_socket, False)
+
+     @patch_socket
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_create_connection_service_name(self, m_socket):
+         m_socket.getaddrinfo = socket.getaddrinfo
+         sock = m_socket.socket.return_value
+diff --git a/Lib/test/test_ctypes/test_find.py b/Lib/test/test_ctypes/test_find.py
+index a41e94971d..1291af3057 100644
+--- a/Lib/test/test_ctypes/test_find.py
++++ b/Lib/test/test_ctypes/test_find.py
+@@ -117,6 +117,7 @@ def test_find_library_with_gcc(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
+             self.assertNotEqual(find_library('c'), None)
+
++    @unittest.skipIf(True, 'Fails on Guix.')
+     def test_find_library_with_ld(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
+              unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
+diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
+index 1ee9958445..ab6b41befe 100644
+--- a/Lib/test/test_generators.py
++++ b/Lib/test/test_generators.py
+@@ -34,6 +34,7 @@ def generator2(self):
+         else:
+             return "FAILED"
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
+     def test_raise_and_yield_from(self):
+         gen = self.generator1()
+         gen.send(None)
+diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
+index ec105ae1a0..ae4c5b672e 100644
+--- a/Lib/test/test_pathlib.py
++++ b/Lib/test/test_pathlib.py
+@@ -3069,6 +3069,7 @@ def test_rglob(self):
+                          'pwd module does not expose getpwall()')
+     @unittest.skipIf(sys.platform == "vxworks",
+                      "no home directory on VxWorks")
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         import_helper.import_module('pwd')
+diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
+index 51b844262e..004d3133cf 100644
+--- a/Lib/test/test_pdb.py
++++ b/Lib/test/test_pdb.py
+@@ -1580,6 +1580,7 @@ def test_pdb_next_command_subiterator():
+     (Pdb) continue
+     """
+
++@unittest.skipIf(True, 'Fails on Guix… but skipIf not taken into account?!')
+ def test_pdb_issue_20766():
+     """Test for reference leaks when the SIGINT handler is set.
+
+@@ -1598,11 +1599,11 @@ def test_pdb_issue_20766():
+     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
+     (Pdb) continue
+-    pdb 1: <built-in function default_int_handler>
++    pdb 1: 1
+     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
+     (Pdb) continue
+-    pdb 2: <built-in function default_int_handler>
++    pdb 2: 1
+     """
+
+ def test_pdb_issue_43318():
+diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index 2ab6f6a986..8cf6b4d1c8 100644
+--- a/Lib/test/test_regrtest.py
++++ b/Lib/test/test_regrtest.py
+@@ -1049,6 +1049,7 @@ def test_fromfile(self):
+         output = self.run_tests('--fromfile', filename)
+         self.check_executed_tests(output, tests, stats=stats)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_interrupted(self):
+         code = TEST_INTERRUPTED
+         test = self.create_test('sigint', code=code)
+@@ -1066,6 +1067,7 @@ def test_slowest(self):
+                  % (self.TESTNAME_REGEX, len(tests)))
+         self.check_line(output, regex)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_slowest_interrupted(self):
+         # Issue #25373: test --slowest with an interrupted test
+         code = TEST_INTERRUPTED
+diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
+index 317e7ca8f8..7f272daf24 100644
+--- a/Lib/test/test_resource.py
++++ b/Lib/test/test_resource.py
+@@ -151,6 +151,7 @@ def test_freebsd_contants(self):
+
+     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
+     @support.requires_linux_version(2, 6, 36)
++    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
+     def test_prlimit(self):
+         self.assertRaises(TypeError, resource.prlimit)
+         self.assertRaises(ProcessLookupError, resource.prlimit,
+diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+index bf60f37934..5e3a96380a 100644
+--- a/Lib/test/test_shutil.py
++++ b/Lib/test/test_shutil.py
+@@ -1743,6 +1743,7 @@ def test_make_archive(self):
+         base_name = os.path.join(tmpdir, 'archive')
+         self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
+     def test_make_archive_owner_group(self):
+         # testing make_archive with owner and group, with various combinations
+@@ -1771,6 +1772,7 @@ def test_make_archive_owner_group(self):
+         self.assertTrue(os.path.isfile(res))
+
+
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
+     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+     def test_tarfile_root_owner(self):
+diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
+index 637a0ca3b3..2fb804e340 100644
+--- a/Lib/test/test_signal.py
++++ b/Lib/test/test_signal.py
+@@ -160,6 +160,7 @@ def test_valid_signals(self):
+                 self.assertLess(signum, signal.NSIG)
+
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @support.requires_subprocess()
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers exit via SIGINT."""
+@@ -211,6 +212,7 @@ def test_issue9324(self):
+             signal.signal(7, handler)
+
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @support.requires_subprocess()
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
+@@ -1407,6 +1409,7 @@ def cycle_handlers():
+
+ class RaiseSignalTest(unittest.TestCase):
+
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_sigint(self):
+         with self.assertRaises(KeyboardInterrupt):
+             signal.raise_signal(signal.SIGINT)
+@@ -1452,6 +1455,7 @@ def __del__(self):
+
+ class PidfdSignalTest(unittest.TestCase):
+
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @unittest.skipUnless(
+         hasattr(signal, "pidfd_send_signal"),
+         "pidfd support not built in",
+diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+index 4eb5af99d6..9c7b8f6dbc 100644
+--- a/Lib/test/test_socket.py
++++ b/Lib/test/test_socket.py
+@@ -1016,6 +1016,8 @@ def testHostnameRes(self):
+         if not fqhn in all_host_names:
+             self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
+
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_host_resolution(self):
+         for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']:
+             self.assertEqual(socket.gethostbyname(addr), addr)
+@@ -1161,6 +1163,8 @@ def testNtoHErrors(self):
+             self.assertRaises(OverflowError, socket.ntohl, k)
+             self.assertRaises(OverflowError, socket.htonl, k)
+
++    @unittest.skipUnless(os.path.exists("/etc/services"),
++                         "getservbyname uses /etc/services, which is not in the chroot")
+     def testGetServBy(self):
+         eq = self.assertEqual
+         # Find one service that exists, then check all the related interfaces.
+@@ -1521,6 +1525,8 @@ def test_sio_loopback_fast_path(self):
+             raise
+         self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
+
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     def testGetaddrinfo(self):
+         try:
+             socket.getaddrinfo('localhost', 80)
+@@ -1653,6 +1659,8 @@ def test_getnameinfo(self):
+         # only IP addresses are allowed
+         self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
+
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     @unittest.skipUnless(support.is_resource_enabled('network'),
+                          'network is not enabled')
+     def test_idna(self):
+diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+index 50766c2548..0c7eb7a83a 100644
+--- a/Lib/test/test_spwd.py
++++ b/Lib/test/test_spwd.py
+@@ -9,8 +9,7 @@
+     spwd = import_helper.import_module('spwd')
+
+
+-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
+-                     'root privileges required')
++@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
+ class TestSpwdRoot(unittest.TestCase):
+
+     def test_getspall(self):
+@@ -60,8 +59,7 @@ def test_getspnam(self):
+             self.assertRaises(TypeError, spwd.getspnam, bytes_name)
+
+
+-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
+-                     'non-root user required')
++@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
+ class TestSpwdNonRoot(unittest.TestCase):
+
+     def test_getspnam_exception(self):
+diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
+index 71489ea493..33351919fe 100644
+--- a/Lib/test/test_tarfile.py
++++ b/Lib/test/test_tarfile.py
+@@ -2911,9 +2911,12 @@ def root_is_uid_gid_0():
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+
+diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+index 00d9e591c7..2515603715 100644
+--- a/Lib/test/test_threading.py
++++ b/Lib/test/test_threading.py
+@@ -1962,6 +1962,7 @@ def check_interrupt_main_noerror(self, signum):
+             # Restore original handler
+             signal.signal(signum, handler)
+
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_subthread(self):
+         # Calling start_new_thread with a function that executes interrupt_main
+         # should raise KeyboardInterrupt upon completion.
+@@ -1973,6 +1974,8 @@ def call_interrupt():
+             t.join()
+         t.join()
+
++
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_mainthread(self):
+         # Make sure that if interrupt_main is called in main thread that
+         # KeyboardInterrupt is raised instantly.
+diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py
+index 0e7ed67de7..6539a2983b 100644
+--- a/Lib/test/test_tools/test_freeze.py
++++ b/Lib/test/test_tools/test_freeze.py
+@@ -23,6 +23,7 @@
+                  'test is too slow with PGO')
+ class TestFreeze(unittest.TestCase):
+
++    @unittest.skipIf(True, 'Fails on Guix.')
+     @support.requires_resource('cpu') # Building Python is slow
+     def test_freeze_simple_script(self):
+         script = textwrap.dedent("""
+diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
+index 515c3840cb..a96dfad0fe 100644
+--- a/Lib/test/test_unicodedata.py
++++ b/Lib/test/test_unicodedata.py
+@@ -342,6 +342,7 @@ def test_linebreak_7643(self):
+                 self.assertEqual(len(lines), 1,
+                                  r"\u%.4x should not be a linebreak" % i)
+
++@requires_resource('network')
+ class NormalizationTest(unittest.TestCase):
+     @staticmethod
+     def check_version(testfile):
+diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+index 445a34ae3e..8f750537c3 100644
+--- a/Tools/scripts/run_tests.py
++++ b/Tools/scripts/run_tests.py
+@@ -69,7 +69,7 @@ def main(regrtest_args):
+         else:
+             args.extend(['-j', '0'])  # Use all CPU cores
+     if not any(is_resource_use_flag(arg) for arg in regrtest_args):
+-        args.extend(['-u', 'all,-largefile,-audio,-gui'])
++        args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
+
+     if cross_compile and hostrunner:
+         # If HOSTRUNNER is set and -p/--python option is not given, then
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 51d5f598d7..25fe83ea69 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -55,7 +55,7 @@
 ;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
 ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
-;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2024 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
@@ -596,6 +596,389 @@ (define-public python-3.10
             (variable "PYTHONTZPATH")
             (files (list "share/zoneinfo")))))))
 
+(define-public python-3.12
+  (package
+    (name "python-next")
+    (version "3.12.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.python.org/ftp/python/" version
+                           "/Python-" version ".tar.xz"))
+       (sha256
+        (base32 "0w6qyfhc912xxav9x9pifwca40b4l49vy52wai9j0gc1mhni2a5y"))
+       (patches (search-patches "python-3-deterministic-build-info.patch"
+                                "python-3.12-fix-tests.patch"
+                                "python-3-hurd-configure.patch"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Delete the bundled copy of libexpat.
+                   (delete-file-recursively "Modules/expat")
+                   (substitute* "Modules/Setup"
+                     ;; Link Expat instead of embedding the bundled one.
+                     (("^#pyexpat.*")
+                      "pyexpat pyexpat.c -lexpat\n"))
+                   ;; Delete windows binaries
+                   (for-each delete-file
+                             (find-files "Lib/distutils/command" "\\.exe$"))))))
+    (outputs '("out" "tk" ;tkinter; adds 50 MiB to the closure
+               "idle")) ;programming environment; weighs 5MB
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:configure-flags (list "--enable-shared" ;allow embedding
+                               "--with-system-expat" ;for XML support
+                               "--with-system-ffi" ;build ctypes
+                               "--with-ensurepip=install" ;install pip and setuptools
+                               "--with-computed-gotos" ;main interpreter loop optimization
+                               "--enable-unicode=ucs4"
+                               "--without-static-libpython"
+
+                               ;; FIXME: These flags makes Python significantly faster, but
+                               ;; leads to non-reproducible binaries.
+                               ;; "--with-lto"               ;increase size by 20MB, but 15% speedup
+                               ;; "--enable-optimizations"
+
+                               ;; Prevent the installed _sysconfigdata.py from retaining a reference
+                               ;; to coreutils.
+                               "INSTALL=install -c"
+                               "MKDIR_P=mkdir -p"
+
+                               ;; Disable runtime check failing if cross-compiling, see:
+                               ;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
+                               ,@(if (%current-target-system)
+                                     '("ac_cv_buggy_getaddrinfo=no"
+                                       "ac_cv_file__dev_ptmx=no"
+                                       "ac_cv_file__dev_ptc=no")
+                                     '())
+                               ;; -fno-semantic-interposition reinstates some optimizations by gcc
+                               ;; leading to around 15% speedup. This is the default starting from
+                               ;; python 3.10.
+                               "CFLAGS=-fno-semantic-interposition"
+                               (string-append "LDFLAGS=-Wl,-rpath="
+                                              (assoc-ref %outputs "out")
+                                              "/lib"
+                                              " -fno-semantic-interposition"))
+       ;; With no -j argument tests use all available cpus, so provide one.
+       #:make-flags (list (string-append (format #f "TESTOPTS=-j~d"
+                                                 (parallel-job-count))
+                           ;; those tests fail on low-memory systems
+                           " --exclude test_mmap test_socket test_threading test_asyncio"
+                           ,@(if (system-hurd?)
+                                 '(" test_posix" ;multiple errors
+                                   " test_time"
+                                   " test_pty"
+                                   " test_shutil"
+                                   " test_tempfile" ;chflags: invalid argument:
+                                   ;; tbv14c9t/dir0/dir0/dir0/test0.txt
+                                   " test_os" ;stty: 'standard input':
+                                   ;; Inappropriate ioctl for device
+                                   " test_openpty" ;No such file or directory
+                                   " test_selectors" ;assertEqual(NUM_FDS // 2, len(fds))
+                                   ;; 32752 != 4
+                                   " test_compileall" ;multiple errors
+                                   " test_poll" ;list index out of range
+                                   " test_subprocess" ;runs over 10min
+                                   " test_asyncore" ;multiple errors
+                                   " test_threadsignals"
+                                   " test_eintr" ;Process return code is -14
+                                   " test_io" ;multiple errors
+                                   " test_logging"
+                                   " test_signal"
+                                   " test_flags" ;ERROR
+                                   " test_bidirectional_pty"
+                                   " test_create_unix_connection"
+                                   " test_unix_sock_client_ops"
+                                   " test_open_unix_connection"
+                                   " test_open_unix_connection_error"
+                                   " test_read_pty_output"
+                                   " test_write_pty"
+                                   " test_concurrent_futures" ;freeze
+                                   " test_venv" ;freeze
+                                   " test_multiprocessing_forkserver" ;runs over 10min
+                                   " test_multiprocessing_spawn" ;runs over 10min
+                                   " test_builtin"
+                                   " test_capi"
+                                   " test_dbm_ndbm"
+                                   " test_exceptions"
+                                   " test_faulthandler"
+                                   " test_getopt"
+                                   " test_importlib"
+                                   " test_json"
+                                   " test_multiprocessing_fork"
+                                   " test_multiprocessing_main_handling"
+                                   " test_pdb "
+                                   " test_regrtest"
+                                   " test_sqlite")
+                                 '())))
+
+       #:modules ((ice-9 ftw)
+                  (ice-9 match)
+                  (guix build utils)
+                  (guix build gnu-build-system))
+
+       #:phases (modify-phases %standard-phases
+                  ,@(if (system-hurd?)
+                        `((add-after 'unpack
+                                     'disable-multi-processing
+                                     (lambda _
+                                       (substitute* "Makefile.pre.in"
+                                         (("-j0")
+                                          "-j1")))))
+                        '())
+                  (add-before 'configure 'patch-lib-shells
+                    (lambda _
+                      ;; This variable is used in setup.py to enable cross compilation
+                      ;; specific switches. As it is not set properly by configure
+                      ;; script, set it manually.
+                      ,@(if (%current-target-system)
+                            '((setenv "_PYTHON_HOST_PLATFORM" ""))
+                            '())
+                      ;; Filter for existing files, since some may not exist in all
+                      ;; versions of python that are built with this recipe.
+                      (substitute* (filter file-exists?
+                                           '("Lib/subprocess.py"
+                                             "Lib/popen2.py"
+                                             "Lib/distutils/tests/test_spawn.py"
+                                             "Lib/test/support/__init__.py"
+                                             "Lib/test/test_subprocess.py"))
+                        (("/bin/sh")
+                         (which "sh")))))
+                  (add-before 'configure 'do-not-record-configure-flags
+                    (lambda* (#:key configure-flags #:allow-other-keys)
+                      ;; Remove configure flags from the installed '_sysconfigdata.py'
+                      ;; and 'Makefile' so we don't end up keeping references to the
+                      ;; build tools.
+                      ;;
+                      ;; Preserve at least '--with-system-ffi' since otherwise the
+                      ;; thing tries to build libffi, fails, and we end up with a
+                      ;; Python that lacks ctypes.
+                      (substitute* "configure"
+                        (("^CONFIG_ARGS=.*$")
+                         (format #f "CONFIG_ARGS='~a'\n"
+                                 (if (member "--with-system-ffi"
+                                             configure-flags)
+                                     "--with-system-ffi" ""))))))
+                  (add-before 'check 'pre-check
+                    (lambda _
+                      ;; 'Lib/test/test_site.py' needs a valid $HOME
+                      (setenv "HOME"
+                              (getcwd))))
+                  (add-after 'unpack 'set-source-file-times-to-1980
+                    ;; XXX One of the tests uses a ZIP library to pack up some of the
+                    ;; source tree, and fails with "ZIP does not support timestamps
+                    ;; before 1980".  Work around this by setting the file times in the
+                    ;; source tree to sometime in early 1980.
+                    (lambda _
+                      (let ((circa-1980 (* 10 366 24 60 60)))
+                        (ftw "."
+                             (lambda (file stat flag)
+                               (utime file circa-1980 circa-1980) #t)))))
+                  (add-after 'unpack 'remove-windows-binaries
+                    (lambda _
+                      ;; Delete .exe from embedded .whl (zip) files
+                      (for-each (lambda (whl)
+                                  (let ((dir "whl-content")
+                                        (circa-1980 (* 10 366 24 60 60)))
+                                    (mkdir-p dir)
+                                    (with-directory-excursion dir
+                                      (let ((whl (string-append "../" whl)))
+                                        (invoke "unzip" whl)
+                                        (for-each delete-file
+                                                  (find-files "." "\\.exe$"))
+                                        (delete-file whl)
+                                        ;; Reset timestamps to prevent them from ending
+                                        ;; up in the Zip archive.
+                                        (ftw "."
+                                             (lambda (file stat flag)
+                                               (utime file circa-1980
+                                                      circa-1980) #t))
+                                        (apply invoke "zip" "-X" whl
+                                               (find-files "."
+                                                           #:directories? #t))))
+                                    (delete-file-recursively dir)))
+                                (find-files "Lib/ensurepip" "\\.whl$"))))
+                  (add-after 'install 'remove-tests
+                    ;; Remove 25 MiB of unneeded unit tests.  Keep test_support.*
+                    ;; because these files are used by some libraries out there.
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (match (scandir (string-append out "/lib")
+                                        (lambda (name)
+                                          (string-prefix? "python" name)))
+                          ((pythonX.Y)
+                           (let ((testdir (string-append out "/lib/" pythonX.Y
+                                                         "/test")))
+                             (with-directory-excursion testdir
+                               (for-each delete-file-recursively
+                                         (scandir testdir
+                                                  (match-lambda
+                                                    ((or "." "..")
+                                                     #f)
+                                                    ("support" #f)
+                                                    (file (not (string-prefix?
+                                                                "test_support."
+                                                                file))))))
+                               (call-with-output-file "__init__.py"
+                                 (const #t))))
+                           (let ((libdir (string-append out "/lib/" pythonX.Y)))
+                             (for-each (lambda (directory)
+                                         (let ((dir (string-append libdir "/"
+                                                                   directory)))
+                                           (when (file-exists? dir)
+                                             (delete-file-recursively dir))))
+                                       '("email/test" "ctypes/test"
+                                         "unittest/test"
+                                         "tkinter/test"
+                                         "sqlite3/test"
+                                         "bsddb/test"
+                                         "lib-tk/test"
+                                         "json/tests"
+                                         "distutils/tests"))))))))
+                  (add-after 'remove-tests 'move-tk-inter
+                    (lambda* (#:key outputs inputs #:allow-other-keys)
+                      ;; When Tkinter support is built move it to a separate output so
+                      ;; that the main output doesn't contain a reference to Tcl/Tk.
+                      (let ((out (assoc-ref outputs "out"))
+                            (tk (assoc-ref outputs "tk")))
+                        (when tk
+                          (match (find-files out "tkinter.*\\.so")
+                            ((tkinter.so)
+                             ;; The .so is in OUT/lib/pythonX.Y/lib-dynload, but we
+                             ;; want it under TK/lib/pythonX.Y/site-packages.
+                             (let* ((len (string-length out))
+                                    (target (string-append tk "/"
+                                                           (string-drop (dirname
+                                                                         (dirname
+                                                                          tkinter.so))
+                                                                        len)
+                                                           "/site-packages")))
+                               (install-file tkinter.so target)
+                               (delete-file tkinter.so))))
+                          ;; Remove explicit store path references.
+                          (let ((tcl (assoc-ref inputs "tcl"))
+                                (tk (assoc-ref inputs "tk")))
+                            (substitute* (find-files (string-append out "/lib")
+                                                     "^(_sysconfigdata_.*\\.py|Makefile)$")
+                                         (((string-append "-L" tk "/lib")) "")
+                                         (((string-append "-L" tcl "/lib")) "")))))))
+                  (add-after 'move-tk-inter 'move-idle
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; when idle is built, move it to a separate output to save some
+                      ;; space (5MB)
+                      (let ((out (assoc-ref outputs "out"))
+                            (idle (assoc-ref outputs "idle")))
+                        (when idle
+                          (for-each (lambda (file)
+                                      (let ((target (string-append idle
+                                                                   "/bin/"
+                                                                   (basename
+                                                                    file))))
+                                        (install-file file
+                                                      (dirname target))
+                                        (delete-file file)))
+                                    (find-files (string-append out "/bin")
+                                                "^idle"))
+                          (match (find-files out "^idlelib$"
+                                             #:directories? #t)
+                            ((idlelib)
+                             (let* ((len (string-length out))
+                                    (target (string-append idle "/"
+                                                           (string-drop
+                                                            idlelib len)
+                                                           "/site-packages")))
+                               (mkdir-p (dirname target))
+                               (rename-file idlelib target))))))))
+                  (add-after 'move-idle 'rebuild-bytecode
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        ;; Disable hash randomization to ensure the generated .pycs
+                        ;; are reproducible.
+                        (setenv "PYTHONHASHSEED" "0")
+
+                        (for-each (lambda (output)
+                                    ;; XXX: Delete existing pycs generated by the build
+                                    ;; system beforehand because the -f argument does
+                                    ;; not necessarily overwrite all files, leading to
+                                    ;; indeterministic results.
+                                    (for-each (lambda (pyc)
+                                                (delete-file pyc))
+                                              (find-files output "\\.pyc$"))
+
+                                    (apply invoke
+                                           `(,,(if (%current-target-system)
+                                                   "python3"
+                                                   '(string-append out
+                                                     "/bin/python3")) "-m"
+                                             "compileall"
+                                             "-o"
+                                             "0"
+                                             "-o"
+                                             "1"
+                                             "-o"
+                                             "2"
+                                             "-f" ;force rebuild
+                                             "--invalidation-mode=unchecked-hash"
+                                             ;; Don't build lib2to3, because it's
+                                             ;; Python 2 code.
+                                             "-x"
+                                             "lib2to3/.*"
+                                             ,output)))
+                                  (map cdr outputs)))))
+                  (add-before 'check 'set-TZDIR
+                    (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                      ;; test_email requires the Olson time zone database.
+                      (setenv "TZDIR"
+                              (string-append (assoc-ref (or native-inputs
+                                                            inputs) "tzdata")
+                                             "/share/zoneinfo"))))
+                  (add-after 'install 'install-sitecustomize.py
+                    ,(customize-site version)))))
+    (inputs (list bzip2
+                  expat
+                  gdbm
+                  libffi ;for ctypes
+                  sqlite ;for sqlite extension
+                  openssl
+                  readline
+                  zlib
+                  tcl
+                  tk)) ;for tkinter
+    (native-inputs `(("tzdata" ,tzdata-for-tests)
+                     ("unzip" ,unzip)
+                     ("zip" ,(@ (gnu packages compression) zip))
+                     ("pkg-config" ,pkg-config)
+                     ("sitecustomize.py" ,(local-file (search-auxiliary-file
+                                                       "python/sitecustomize.py")))
+                     ;; When cross-compiling, a native version of Python itself is needed.
+                     ,@(if (%current-target-system)
+                           `(("python" ,this-package)
+                             ("which" ,which))
+                           '())))
+    (native-search-paths
+     (list (guix-pythonpath-search-path version)
+           ;; Used to locate tzdata by the zoneinfo module introduced in
+           ;; Python 3.9.
+           (search-path-specification
+            (variable "PYTHONTZPATH")
+            (files (list "share/zoneinfo")))))
+    (home-page "https://www.python.org")
+    (synopsis "High-level, dynamically-typed programming language")
+    (description
+     "Python is a remarkably powerful dynamic programming language that
+is used in a wide variety of application domains.  Some of its key
+distinguishing features include: clear, readable syntax; strong
+introspection capabilities; intuitive object orientation; natural
+expression of procedural code; full modularity, supporting hierarchical
+packages; exception-based error handling; and very high level dynamic
+data types.")
+    (properties '((cpe-name . "python")))
+    (license license:psfl)))
+
+
+;; Next 3.x version.
+(define-public python-next python-3.12)
+
 ;; Current 3.x version.
 (define-public python-3 python-3.10)
 

base-commit: f3ea06baca2b96cd20170616fd5da13ec2daac54
-- 
2.41.0





^ permalink raw reply related	[relevance 35%]

* [bug#69579] [PATCH] gnu: python-joblib: Update to 1.3.2.
@ 2024-03-06  9:38 64% Nicolas Graves via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Nicolas Graves via Guix-patches via @ 2024-03-06  9:38 UTC (permalink / raw)
  To: 69579; +Cc: ngraves

* gnu/packages/python-xyz.scm (python-joblib): Update to 1.3.2.
[build-system]: Update to pyproject-build-system.
[arguments]
  <#:phases>: Remove check phase.
  <#:test-flags>: Keep former test flag.
[propagated-inputs]: Add python-psutil.

Change-Id: Ide110a19431b1d26e1d7dd8d1adc3b3f0f417749
---
 gnu/packages/python-xyz.scm | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 46232d3c98..122dca6e4e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6169,26 +6169,20 @@ (define-public python-pystitcher
 (define-public python-joblib
   (package
     (name "python-joblib")
-    (version "1.1.1")
+    (version "1.3.2")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "joblib" version))
               (sha256
                (base32
-                "0019p280s2k941mihl67l7y6amwx86639xp3zvpsg1lmyish67rh"))))
-    (build-system python-build-system)
+                "1cbjjzsh9hzaqr2cqja95673p7j88b8bd02hjpkq8xz147k6by4j"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (setenv "JOBLIB_MULTIPROCESSING" "0")
-               (invoke "pytest" "-v" "joblib"
-                       ;; We disable this test to avoid having to depend on ipython/jupyter
-                       "-k" "not test_parallel_call_cached_function_defined_in_jupyter")))))))
-    (native-inputs
-     (list python-pytest))
+     (list
+      #:test-flags  ; disabled to avoid having to depend on ipython/jupyter
+      #~(list "-k" "not test_parallel_call_cached_function_defined_in_jupyter")))
+    (native-inputs (list python-pytest))
+    (propagated-inputs (list python-psutil))
     (home-page "https://joblib.readthedocs.io/")
     (synopsis "Using Python functions as pipeline jobs")
     (description
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69514] [PATCH] gnu: python-pandera: Update to 0.18.0.
@ 2024-03-02 20:46 62% Troy Figiel
  0 siblings, 0 replies; 200+ results
From: Troy Figiel @ 2024-03-02 20:46 UTC (permalink / raw)
  To: 69514

* gnu/packages/python-science.scm (python-pandera): Update to 0.18.0.
[source]: Remove snippet.
[arguments]<#:phases>: Add 'fix-tests phase.
---
 gnu/packages/python-science.scm | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index b6a116f16b..93b5c5c91d 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -826,7 +826,7 @@ (define-public python-pandarallel
 (define-public python-pandera
   (package
     (name "python-pandera")
-    (version "0.17.2")
+    (version "0.18.0")
     (source
      (origin
        ;; No tests in the PyPI tarball.
@@ -836,14 +836,7 @@ (define-public python-pandera
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1mnqk583z90k1n0z3lfa4rd0ng40v7hqfk7phz5gjmxlzfjbxa1x"))
-       (modules '((guix build utils)))
-       ;; These tests require PySpark and Modin. We need to remove the entire
-       ;; directory, since the conftest.py in these directories contain
-       ;; imports.  (See: https://github.com/pytest-dev/pytest/issues/7452)
-       (snippet '(begin
-                   (delete-file-recursively "tests/pyspark")
-                   (delete-file-recursively "tests/modin")))))
+        (base32 "14b5aij5zjkwvsimg0v00qvp59mhhq7ljim4qghcn432vkg9gh47"))))
     (build-system pyproject-build-system)
     (arguments
      (list
@@ -854,7 +847,16 @@ (define-public python-pandera
                            ;; positives. These tests currently fail.
                            "not test_python_std_list_dict_generics"
                            " and not test_python_std_list_dict_empty_and_none"
-                           " and not test_pandas_modules_importable"))))
+                           " and not test_pandas_modules_importable"))
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'check 'fix-tests
+                     (lambda _
+                       ;; These tests require PySpark and Modin. We need to
+                       ;; remove the entire directory, since the conftest.py
+                       ;; in these directories contain imports.  (See:
+                       ;; https://github.com/pytest-dev/pytest/issues/7452)
+                       (for-each delete-file-recursively
+                                 '("tests/pyspark" "tests/modin")))))))
     ;; Pandera comes with a lot of extras. We test as many as possible, but do
     ;; not include all of them in the propagated-inputs. Currently, we have to
     ;; skip the pyspark and io tests due to missing packages python-pyspark

base-commit: 6f5ea7ac1acb3d1c53baf7620cca66cc87fe5a73
-- 
2.42.0





^ permalink raw reply related	[relevance 62%]

* [bug#68721] [PATCH 1/2] gnu: Add python-cramjam.
  @ 2024-03-02 18:40 72% ` Troy Figiel
  0 siblings, 0 replies; 200+ results
From: Troy Figiel @ 2024-03-02 18:40 UTC (permalink / raw)
  To: 68721

* gnu/packages/python-compression.scm (python-cramjam): New variable.
---
 gnu/packages/python-compression.scm | 80 ++++++++++++++++++++++++++++-
 1 file changed, 79 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm
index 6f249dd3af..691fbd3065 100644
--- a/gnu/packages/python-compression.scm
+++ b/gnu/packages/python-compression.scm
@@ -7,7 +7,7 @@
 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2020, 2022, 2023 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
-;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,12 +30,14 @@ (define-module (gnu packages python-compression)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix gexp)
+  #:use-module (guix build-system cargo)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix build-system pyproject)
   #:use-module (gnu packages)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages crates-io)
   #:use-module (gnu packages check)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages pkg-config)
@@ -44,6 +46,7 @@ (define-module (gnu packages python-compression)
   #:use-module (gnu packages python-check)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages rust-apps)
   #:use-module (gnu packages sphinx))
 
 (define-public python-multivolumefile
@@ -73,6 +76,81 @@ (define-public python-multivolumefile
 were a single file.")
     (license license:lgpl2.1+)))
 
+(define-public python-cramjam
+  (package
+    (name "python-cramjam")
+    (version "2.7.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "cramjam" version))
+       (sha256
+        (base32 "1b69qlr0q7q3spa7zy55xc1dr5pjgsdavxx8ijhv2j60xqjbg7sp"))))
+    (build-system cargo-build-system)
+    (arguments
+     (list
+      #:imported-modules `(,@%cargo-build-system-modules
+                           ,@%pyproject-build-system-modules)
+      #:modules '((guix build cargo-build-system)
+                  ((guix build pyproject-build-system)
+                   #:prefix py:)
+                  (guix build utils))
+      #:phases #~(modify-phases %standard-phases
+                   ;; We use Maturin to build the project.
+                   (replace 'build
+                     (assoc-ref py:%standard-phases
+                                'build))
+                   ;; Before being able to run Python tests, we need to
+                   ;; install the module and add it to PYTHONPATH.
+                   (delete 'install)
+                   (add-after 'build 'install
+                     (assoc-ref py:%standard-phases
+                                'install))
+                   (add-after 'install 'add-install-to-pythonpath
+                     (assoc-ref py:%standard-phases
+                                'add-install-to-pythonpath))
+                   ;; Finally run the tests. Only Python tests are provided.
+                   (replace 'check
+                     (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+                       (when tests?
+                         ;; Without the CI variable, tests are run in "local"
+                         ;; mode, which sets a deadline for hypothesis.  For a
+                         ;; deterministic build, we need to set CI.
+                         (setenv "CI" "1")
+                         (invoke "pytest" "-vv" "tests")))))
+      #:cargo-inputs `(("rust-brotli" ,rust-brotli-3)
+                       ("rust-bzip2" ,rust-bzip2-0.4)
+                       ("rust-flate2" ,rust-flate2-1)
+                       ("rust-lz4" ,rust-lz4-1)
+                       ("rust-pyo3" ,rust-pyo3-0.18)
+                       ("rust-snap" ,rust-snap-1)
+                       ("rust-zstd" ,rust-zstd-0.11))
+      #:install-source? #f))
+    (native-inputs (list maturin
+                         python-pytest
+                         python-pytest-xdist
+                         python-numpy
+                         python-hypothesis
+                         python-wrapper))
+    (home-page "https://github.com/milesgranger/cramjam")
+    (synopsis "Python bindings to compression algorithms in Rust")
+    (description
+     "This package provides thin Python bindings to compression and
+decomporession algorithms implemented in Rust.  This allows for using
+algorithms such as Snappy without additional system dependencies.  The
+following algorithms are available:
+
+@itemize
+@item Snappy
+@item Brotli
+@item Bzip2
+@item LZ4
+@item Gzip
+@item Deflate
+@item Zstd
+@end itemize")
+    (license license:expat)))
+
 (define-public python-pybcj
   (package
     (name "python-pybcj")
-- 
2.42.0





^ permalink raw reply related	[relevance 72%]

* [bug#69434] [PATCH v2] gnu: Add python-ldaptor.
  2024-02-27 19:09 60% [bug#69434] [PATCH] gnu: Add python-ldaptor Sharlatan Hellseher
@ 2024-03-02 14:15 61% ` Sharlatan Hellseher
  0 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-02 14:15 UTC (permalink / raw)
  To: 69434
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-ldaptor): New variable.

Change-Id: If7d2cb7b51bb0ccc85b76d7f2d4b31857e042066
---
 gnu/packages/python-xyz.scm | 49 +++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index fc6e997b6c..71e629896c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -30099,6 +30099,55 @@ (define-public python-ldap3
 library.")
     (license license:lgpl3+)))
 
+(define-public python-ldaptor
+  (package
+    (name "python-ldaptor")
+    (version "21.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ldaptor" version))
+       (sha256
+        (base32 "0n53czn5pyh8923y282spdb7xc8c9rhn0n43bczanjjx6wcynjcc"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      #~(list "-m" "twisted.trial"
+              (string-append "-j" (number->string (parallel-job-count)))
+              "ldaptor")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'disable-failing-tests
+          (lambda _
+            ;; Testing with Twisted 22.4 results in infinite loop creating
+            ;; temporary config files, see
+            ;; <https://github.com/twisted/ldaptor/issues/238>.
+            (delete-file "ldaptor/test/test_config.py")))
+          (replace 'check
+            (lambda* (#:key tests? test-flags #:allow-other-keys)
+              (when tests?
+                (apply invoke "python" test-flags)))))))
+    (propagated-inputs
+     (list python-passlib
+           python-pyparsing
+           python-six
+           python-twisted-22
+           python-zope-interface))
+    (home-page "https://github.com/twisted/ldaptor")
+    (synopsis "Pure-Python Twisted library for LDAP")
+    (description
+     "This package provides a Python Twisted library for LDAP, which key
+feaatures are:
+@itemize
+@item LDAP client logic
+@item separately-accessible LDAP and BER protocol message generation/parsing
+@item ASCII-format LDAP filter generation and parsing
+@item LDIF format data generation
+@item Samba password changing logic
+@end itemize")
+    (license license:expat)))
+
 (define-public python-boltons
   (package
     (name "python-boltons")

base-commit: efdaa885b083e85bd380ca914addfcf32d0834f7
-- 
2.41.0





^ permalink raw reply related	[relevance 61%]

* [bug#67999] [PATCH v2] gnu: Add kalamine.
    2024-02-16 14:57 59% ` [bug#67999] [PATCH] gnu: python-kalamine: Update to 0.30 Adriel Dumas--Jondeau via Guix-patches via
  2024-03-01 11:32 59% ` [bug#67999] [PATCH] gnu: Add python-kalamine Adriel Dumas--Jondeau via Guix-patches via
@ 2024-03-02 14:08 60% ` Sharlatan Hellseher
  2 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-03-02 14:08 UTC (permalink / raw)
  To: 67999
  Cc: Sharlatan Hellseher, Adriel Dumas--Jondeau, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

From: Adriel Dumas--Jondeau <leirda@disroot.org>

* gnu/packages/python-xyz.scm (kalamine): New variable.

Change-Id: If13f258440bb35973b3d79a87fea68e4708845bf
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-xyz.scm | 41 +++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index fc6e997b6c..7410f40465 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -147,6 +147,7 @@
 ;;; Copyright © 2023 Attila Lendvai <attila@lendvai.name>
 ;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
 ;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
+;;; Copyright © 2024 Adriel Dumas--Jondeau <leirda@disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -6375,6 +6376,46 @@ (define-public autokey
 flexibility and power of the Python language.")
     (license license:gpl3+)))
 
+(define-public kalamine
+  (package
+    (name "kalamine")
+    (version "0.33")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "kalamine" version))
+       (sha256
+        (base32 "11hci02lvjc8657lylfcdw24bff0g1q0qxi8wcrjgqcqka9vm63c"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'make-test-layouts
+            (lambda _
+              (apply invoke
+                     (cons* "python" "-m" "kalamine.cli" "build"
+                            (find-files "layouts" "\\.toml")))
+              (invoke "python" "-m" "kalamine.cli" "new" "test.toml"))))))
+    (propagated-inputs
+     (list python-click
+           python-livereload
+           python-lxml
+           python-progress
+           python-pyyaml
+           python-tomli))
+    ;; TODO: Add python-pytest-ruff to native-inputs once it has been
+    ;; packaged.
+    (native-inputs
+     (list python-hatchling python-mypy python-pytest))
+    (home-page "https://github.com/OneDeadKey/kalamine")
+    (synopsis "Keyboard Layout Maker")
+    (description
+     "Kalamine provides a CLI to create advanced keyboard layout from a
+textual portable description.  It also supports layout emulation via web
+browser.")
+    (license license:expat)))
+
 (define-public python-dm-tree
   (package
     (name "python-dm-tree")

base-commit: 4a0549be52f3f46fbce61342d8de30f7b83130c5
-- 
2.41.0





^ permalink raw reply related	[relevance 60%]

* [bug#60240] [PATCH v2] gnu: Add python-3.12 and python-next.
  @ 2024-03-02  9:59 57%       ` Lars-Dominik Braun
  0 siblings, 0 replies; 200+ results
From: Lars-Dominik Braun @ 2024-03-02  9:59 UTC (permalink / raw)
  To: Tanguy LE CARROUR; +Cc: 60240

[-- Attachment #1: Type: text/plain, Size: 1792 bytes --]

Hey,

> Sorry, but I’m not sure to see what you mean!?
> Outputs are defined for `out`, `tk` and `idle`. And I see phases to move
> files to the outputs: `move-tk-inter` and `move-idle`.
> 
> What do you mean by `referenced from out`? And how would you remove such
> a reference!

so, if you look at `guix size python@3.12`, you can see
it lists tk and tcl. And then a `grep -Ri /gnu/store/path/to/tcl
/gnu/store/path/to/python` reveals it’s being referenced by
lib/python3.12/_sysconfigdata__linux_x86_64-linux-gnu.py and
lib/python3.12/config-3.12-x86_64-linux-gnu/Makefile, which are both
part of the default “out” output. That means TCL and TK are both
part of the closure of the python@3.12 package, i.e. they are downloaded
whenever you install it, making the package “bigger” in size (234.5
MiB in total to be precise). I believe we wanted to avoid that by moving
some parts of Python into the separate “tk” output. But apparently
that does not work (any more).

The attached patch (on top of yours) removes these references and shrinks
the closure of python@3.12 to 180.6 MiB. But I don’t know whether it
has any negative side-effects (i.e. packages not building any more),
because I can’t build libxslt with Python 3.12 due to the module
“imp” having been removed in Python 3.12.

> I searched in the issue list on GH, but couldn’t find anything relevant.
> But there are quite a lot of issues there.
> Do we have to fix this before we merge it?

No, we’d have to dig deeper into which particular test causes this
behavior.

And actually one more nitpick: The name of the package should be
“python-next” not “python”, otherwise `guix install python`
will pick Python 3.12 (it’s based on the name property, not the
variable name).

Cheers,
Lars


[-- Attachment #2: python-3.12-remove-tk-tcl-refs.patch --]
[-- Type: text/plain, Size: 1901 bytes --]

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 471cf190fb..0b887a2cdb 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -836,7 +836,7 @@ (define-public python-3.12
                                          "json/tests"
                                          "distutils/tests"))))))))
                   (add-after 'remove-tests 'move-tk-inter
-                    (lambda* (#:key outputs #:allow-other-keys)
+                    (lambda* (#:key outputs inputs #:allow-other-keys)
                       ;; When Tkinter support is built move it to a separate output so
                       ;; that the main output doesn't contain a reference to Tcl/Tk.
                       (let ((out (assoc-ref outputs "out"))
@@ -854,7 +854,14 @@ (define-public python-3.12
                                                                         len)
                                                            "/site-packages")))
                                (install-file tkinter.so target)
-                               (delete-file tkinter.so))))))))
+                               (delete-file tkinter.so))))
+                          ;; Remove explicit store path references.
+                          (let ((tcl (assoc-ref inputs "tcl"))
+                                (tk (assoc-ref inputs "tk")))
+                            (substitute* (find-files (string-append out "/lib")
+                                                     "^(_sysconfigdata_.*\\.py|Makefile)$")
+                                         (((string-append "-L" tk "/lib")) "")
+                                         (((string-append "-L" tcl "/lib")) "")))))))
                   (add-after 'move-tk-inter 'move-idle
                     (lambda* (#:key outputs #:allow-other-keys)
                       ;; when idle is built, move it to a separate output to save some

^ permalink raw reply related	[relevance 57%]

* [bug#67999] [PATCH] gnu: Add python-kalamine.
    2024-02-16 14:57 59% ` [bug#67999] [PATCH] gnu: python-kalamine: Update to 0.30 Adriel Dumas--Jondeau via Guix-patches via
@ 2024-03-01 11:32 59% ` Adriel Dumas--Jondeau via Guix-patches via
  2024-03-02 14:08 60% ` [bug#67999] [PATCH v2] gnu: Add kalamine Sharlatan Hellseher
  2 siblings, 0 replies; 200+ results
From: Adriel Dumas--Jondeau via Guix-patches via @ 2024-03-01 11:32 UTC (permalink / raw)
  To: 67999
  Cc: Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-kalamine): New variable.

Change-Id: If13f258440bb35973b3d79a87fea68e4708845bf
---
 gnu/packages/python-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)


Hi o/

Thank you for your answers!
Here's a squashed version of previous patches, as if V1 never existed in
the first place. Does that looks good to you?


diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 29e2bfd222..64060d44e3 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6327,6 +6327,43 @@ (define-public autokey
 flexibility and power of the Python language.")
     (license license:gpl3+)))
 
+(define-public python-kalamine
+  (package
+    (name "python-kalamine")
+    (version "0.30")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "kalamine" version))
+       (sha256
+        (base32 "1aqwfp0m2fr9miwh0d8ljmb58k4mw7bp9bzn5fk3kyj2d6zr0cxg"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (apply invoke
+                            (cons* "python" "-m" "kalamine.cli" "make"
+                                   (find-files "layouts" "\\.toml")))
+                     (invoke "pytest" "-vv" "tests")))))))
+    (propagated-inputs (list python-click python-livereload python-lxml
+                             python-pyyaml python-tomli python-hatchling))
+    (native-inputs (list python-black
+                         python-isort
+                         python-mypy
+                         python-pytest))
+    (home-page "https://github.com/OneDeadKey/kalamine")
+    (synopsis "A cross-platform Keyboard Layout Maker")
+    (description "Kalamine provides a CLI to create advanced keyboard layout
+for Windows (@file{.ahk} or @file{.klc} files), MacOS (@file{.keylayout} files)
+and GNU/Linux (@file{.xkb_custom} or @file{.xkb} files) from a textual,
+portable description.  It also provides @command{xkalamine} to install XKB
+files on GNU/Linux in either @file{/usr/share/X11/xbk} or the rootless
+user-only equivalent @file{.config/xkb}.")
+    (license license:expat)))
+
 (define-public python-dm-tree
   (package
     (name "python-dm-tree")

base-commit: 203344cc37c8a7df1ec1454381b5069d53ce7f9e
prerequisite-patch-id: cefc174692b72660bf5ed4c03442f33dbaf6e784
prerequisite-patch-id: 6b1015959d122056b883e766306b0ff8ba30bde9
prerequisite-patch-id: a3116f7908bc9fdb237e4cde52260856b083596d
prerequisite-patch-id: db1d3d945579284d401944b18fcbc506a000714f
prerequisite-patch-id: 84bff5e4689979f565315edf96250ccc367f8fb8
prerequisite-patch-id: bd69d4115bc86b7d2739e9890625788f1fa5a006
prerequisite-patch-id: 0834ca6f4e7f1ed91b5dcb679096a953a6e36273
-- 
2.41.0





^ permalink raw reply related	[relevance 59%]

* [bug#69486] [PATCH] gnu: Add python-pypugjs.
@ 2024-03-01  9:22 61% Tanguy Le Carrour
  2024-03-17 16:32 60% ` [bug#69486] [PATCH v2] " Tanguy Le Carrour
  0 siblings, 1 reply; 200+ results
From: Tanguy Le Carrour @ 2024-03-01  9:22 UTC (permalink / raw)
  To: 69486
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

Hi Guix,

This patch adds PyPugJS. Not much more to say, except… thanks for
reviewing! 😉

Tanguy

* gnu/packages/python-xyz.scm (python-pypugjs): New variable.

Change-Id: I050ab42d0149fcffddcf6b12dd9c1ddea23f84c9
---
 gnu/packages/python-xyz.scm | 48 +++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8691f70375..338bc72582 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6098,6 +6098,54 @@ (define-public python-jinja2-time
 templates.  A format string can be provided to control the output.")
     (license license:expat)))
 
+(define-public python-pypugjs
+  (package
+    (name "python-pypugjs")
+    (version "5.9.12")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/kakulukia/pypugjs")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0zj7a560h973cl7brfw1nmyhgm8rp8j80wnih0shvhmw4ql23lpa"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   ;; Our pyramid is outdated and pyramid-mako is not packaged.
+                   (add-after 'unpack 'disable-pyramid
+                     (lambda* (#:key inputs #:allow-other-keys)
+                       (substitute* "setup.py"
+                         (("'pyramid")
+                          "#'pyramid"))))
+                   (replace 'check
+                     (lambda* (#:key tests? #:allow-other-keys)
+                       (when tests?
+                         (invoke "python" "-m" "pytest" "-v"
+                                 "pypugjs/testsuite/")))))))
+    (native-inputs (list python-coverage
+                         python-django
+                         python-jinja2
+                         python-flake8
+                         python-flask
+                         python-mako
+                         python-nose
+                         python-pip
+                         python-poetry-core
+                         python-pytest
+                         python-setuptools
+                         python-tornado-6
+                         python-wheel))
+    (propagated-inputs (list python-charset-normalizer python-six))
+    (home-page "https://github.com/kakulukia/pypugjs")
+    (synopsis "Convert Pug source files into different template languages")
+    (description
+     "PugJS syntax template adapter for Django, Jinja2, Mako and Tornado templates.")
+    (license license:expat))) ;; MIT
+
 (define-public python-pysdl2
   (package
     (name "python-pysdl2")

base-commit: a3a7d51a31957f185e4e6e3059610769d48ffd70
-- 
2.41.0





^ permalink raw reply related	[relevance 61%]

* [bug#68492] [PATCH v2 2/2] gnu: Add python-fastapi-pagination.
  2024-02-28 23:35 60% ` [bug#68492] [PATCH v2 1/2] gnu: Add python-fastapi-pagination-minimal Giacomo Leidi via Guix-patches via
@ 2024-02-28 23:35 63%   ` Giacomo Leidi via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Giacomo Leidi via Guix-patches via @ 2024-02-28 23:35 UTC (permalink / raw)
  To: 68492
  Cc: Giacomo Leidi, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm (python-fastapi-pagination): New variable.

Change-Id: I3d5563baf7167e0bd0718cdbfc4a869a0bc96911
---
 gnu/packages/python-web.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 1ff5d1009d..8d0c5c278b 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -8824,6 +8824,38 @@ (define-public python-fastapi-pagination-minimal
 return paginated responses to your clients.")
     (license license:expat)))
 
+(define-public python-fastapi-pagination
+  (package
+    (inherit python-fastapi-pagination-minimal)
+    (name "python-fastapi-pagination")
+    (propagated-inputs
+     (modify-inputs (package-propagated-inputs
+                     python-fastapi-pagination-minimal)
+       (prepend python-asyncpg
+                python-databases
+                python-django
+                python-fastapi
+                python-pydantic
+                python-sqlalchemy
+                (package
+                  (inherit python-tortoise-orm)
+                  (arguments
+                   (substitute-keyword-arguments (package-arguments
+                                                  python-tortoise-orm)
+                     ((#:phases phases '%standard-phases)
+                      `(modify-phases ,phases
+                        (delete 'sanity-check)))))
+                  (propagated-inputs
+                   (modify-inputs (package-propagated-inputs python-tortoise-orm)
+                     (replace "python-aiosqlite" python-aiosqlite)))))))
+    (description
+     (string-append (package-description python-fastapi-pagination-minimal)
+                    "
+
+This package, as opposed to @code{python-fastapi-pagination-minimal}, depends on
+all available optional dependencies supported by mainline
+@code{fastapi-pagination}."))))
+
 (define-public python-pyactiveresource
   (package
     (name "python-pyactiveresource")
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#68492] [PATCH v2 1/2] gnu: Add python-fastapi-pagination-minimal.
  @ 2024-02-28 23:35 60% ` Giacomo Leidi via Guix-patches via
  2024-02-28 23:35 63%   ` [bug#68492] [PATCH v2 2/2] gnu: Add python-fastapi-pagination Giacomo Leidi via Guix-patches via
  0 siblings, 1 reply; 200+ results
From: Giacomo Leidi via Guix-patches via @ 2024-02-28 23:35 UTC (permalink / raw)
  To: 68492
  Cc: Giacomo Leidi, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm
(python-fastapi-pagination-minimal): New variable.

Change-Id: I69e06ba405bce57409d83f3545e6db2905d3c6a4
---
 gnu/packages/python-web.scm | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index cde4ac4f58..1ff5d1009d 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -39,7 +39,7 @@
 ;;; Copyright © 2020 Edouard Klein <edk@beaver-labs.com>
 ;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020 Konrad Hinsen <konrad.hinsen@fastmail.net>
-;;; Copyright © 2020, 2022 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2020, 2022, 2024 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
@@ -8791,6 +8791,39 @@ (define-public python-fastapi-csrf-protect
 pattern.")
     (license license:expat)))
 
+(define-public python-fastapi-pagination-minimal
+  (package
+    (name "python-fastapi-pagination-minimal")
+    (version "0.12.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/uriyyo/fastapi-pagination")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0qkcphjk1qy680v1hkmqbs4p7srvx020wy39b97anrn9dyyi5ah6"))))
+    (build-system pyproject-build-system)
+    (arguments
+     ;; Tests depend on python-cassandra,
+     ;; which is not yet packaged in Guix.
+     `(#:tests? #f))
+    (native-inputs
+     (list poetry))
+    ;; These are the only required dependencies,
+    ;; please add all optional dependencies to the
+    ;; full python-fastapi-pagination below.
+    (propagated-inputs (list python-fastapi
+                             python-pydantic))
+    (home-page "https://github.com/uriyyo/fastapi-pagination")
+    (synopsis "FastAPI pagination library")
+    (description "@code{fastapi-pagination} is a Python library designed to
+simplify pagination in FastAPI applications.  It provides a set of utility
+functions and data models to help you paginate your database queries and
+return paginated responses to your clients.")
+    (license license:expat)))
+
 (define-public python-pyactiveresource
   (package
     (name "python-pyactiveresource")

base-commit: 23283c50e96d7812a42b1272329fa3ba05a5a6e6
-- 
2.41.0





^ permalink raw reply related	[relevance 60%]

* [bug#69453] [PATCH] gnu: Add python-jinja2-fragments.
@ 2024-02-28 11:20 63% Tanguy Le Carrour
  0 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 11:20 UTC (permalink / raw)
  To: 69453
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

Hi Guix,

This patch adds python-jinja2-fragments. I disabled tests because
they rely unconditionally on many web frameworks, some we don’t even have
packaged.

Regards.

* gnu/packages/python-xyz.scm (python-jinja2-fragments): New variable.

Change-Id: Iaa272050b8b54bb19a19fbf2e700eac8b9428063
---
 gnu/packages/python-xyz.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 348b3084b5..0f8429852d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6068,6 +6068,29 @@ (define-public python-jinja2-time
 templates.  A format string can be provided to control the output.")
     (license license:expat)))
 
+(define-public python-jinja2-fragments
+  (package
+    (name "python-jinja2-fragments")
+    (version "1.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "jinja2_fragments" version))
+       (sha256
+        (base32 "0z98704fzz5xl54a95s3lii2wc8y5cz6zi3ajiij03wjxfshj877"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      ;; Framework integration tests that depend on too many packages.
+      #:tests? #f))
+    (native-inputs (list python-setuptools python-wheel))
+    (propagated-inputs (list python-jinja2))
+    (home-page "https://github.com/sponsfreixes/jinja2-fragments")
+    (synopsis "Jinja2 extension for template fragments")
+    (description
+     "Render Jinja2 template block as HTML page fragments on Python web frameworks.")
+    (license license:expat)))  ;; MIT
+
 (define-public python-pysdl2
   (package
     (name "python-pysdl2")

base-commit: 03a03ed64a62e23b9d3da8758dbf7754b186982f
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#69452] [PATCH] gnu: Add python-mistune-3.
@ 2024-02-28 10:27 63% Tanguy Le Carrour
  0 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:27 UTC (permalink / raw)
  To: 69452
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

Hi Guix,

This patch adds Mistune v3, but… we already have 2 other versions of
Mistune:

- python-mistune (0.8.4)
- python-mistune-next (2.0.4)

Would it be ok if, in a following patch, I renamed python-mistune-next to
python-mistune-2 and change the 3 packages that use it?

Regards.

* gnu/packages/python-xyz.scm (python-mistune-3): New variable.

Change-Id: I59adfb92ed65a10292090c758108e889467f28d7
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 8691f70375..4ecc2e5e5d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14155,6 +14155,24 @@ (define-public python-mistune-next
                 (invoke "pytest" "-vv")))))))
     (native-inputs (list python-pytest))))
 
+(define-public python-mistune-3
+  (package
+    (name "python-mistune")
+    (version "3.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "mistune" version))
+       (sha256
+        (base32 "1s4ba1m69yldrhnyfj8lm4bl3axbi95g1dicxya27j9hv7g96zzw"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-pytest python-setuptools python-wheel))
+    (home-page "https://github.com/lepture/mistune")
+    (synopsis "Markdown parser in pure Python")
+    (description "This package provides a fast markdown parser in pure
+Python.")
+    (license license:bsd-3)))
+
 (define-public python-markdown
   (package
     (name "python-markdown")

base-commit: 178c36e1ee6915a27f042f64a6357d5ed9c8cb49
-- 
2.41.0





^ permalink raw reply related	[relevance 63%]

* [bug#69449] [PATCH python-team 8/9] gnu: python-flask: Rename to python-flask-2.
                     ` (6 preceding siblings ...)
  2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 7/9] gnu: Add python-werkzeug-3 Tanguy Le Carrour
@ 2024-02-28 10:15 65% ` Tanguy Le Carrour
  2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 9/9] gnu: Add python-flask-3 Tanguy Le Carrour
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm (python-flask): Rename to...
(python-flask-2): ... this. Add new variable defining
default python-flask.

Change-Id: Ibcfa805089f1ea17de52525b75e20dc5c2d54ee8
---
 gnu/packages/python-web.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index e8edc1604c..3bdabc311a 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -3923,7 +3923,7 @@ (define-public python-webtest
 minimum of WSGI.")
     (license license:expat)))
 
-(define-public python-flask
+(define-public python-flask-2
   (package
     (name "python-flask")
     (version "2.1.1")
@@ -3957,6 +3957,8 @@ (define-public python-flask
 presume or force a developer to use a particular tool or library.")
     (license license:bsd-3)))
 
+(define-public python-flask python-flask-2)
+
 (define-public python-flask-compress
   (package
     (name "python-flask-compress")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69449] [PATCH python-team 4/9] gnu: python-blinker: Update to 1.7.0.
                     ` (2 preceding siblings ...)
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 3/9] gnu: python-click: Update to 8.1.7 Tanguy Le Carrour
@ 2024-02-28 10:15 65% ` Tanguy Le Carrour
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 5/9] gnu: Add python-ephemeral-port-reserve Tanguy Le Carrour
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-blinker): Update to 1.7.0.
[build-system]: Use pyproject-build-system.
[native-inputs]: Add python-flit-core, python-pytest and
python-pytest-asyncio.

Change-Id: Ie825fb38b326facf54b0788c78733b8de4a74920
---
 gnu/packages/python-xyz.scm | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c7492650cc..a6f3aec7ed 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -7654,16 +7654,17 @@ (define-public python-black-macchiato
 (define-public python-blinker
   (package
     (name "python-blinker")
-    (version "1.4")
+    (version "1.7.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "blinker" version))
        (sha256
         (base32
-         "1dpq0vb01p36jjwbhhd08ylvrnyvcc82yxx3mwjx6awrycjyw6j7"))))
-    (build-system python-build-system)
-    (home-page "https://pythonhosted.org/blinker/")
+         "10k1k4raxkfdan2vj4p1zvj4gxf394vjihj74y71skafzbv0z0p6"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-flit-core python-pytest python-pytest-asyncio))
+    (home-page "https://blinker.readthedocs.io")
     (synopsis "Fast, simple object-to-object and broadcast signaling")
     (description
      "Blinker provides a fast dispatching system that allows any number of
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69449] [PATCH python-team 3/9] gnu: python-click: Update to 8.1.7.
    2024-02-28 10:15 64% ` [bug#69449] [PATCH python-team 1/9] gnu: python-itsdangerous: Update to 2.1.2 Tanguy Le Carrour
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 2/9] gnu: python-jinja2: Update to 3.1.3 Tanguy Le Carrour
@ 2024-02-28 10:15 65% ` Tanguy Le Carrour
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 4/9] gnu: python-blinker: Update to 1.7.0 Tanguy Le Carrour
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-click): Update to 8.1.7.

Change-Id: Ifac59bb2a373c519bb0da0f3f8e818d9e869cbf5
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 3348cc0d58..c7492650cc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5175,14 +5175,14 @@ (define-public python-cli-helpers
 (define-public python-click
   (package
     (name "python-click")
-    (version "8.1.3")
+    (version "8.1.7")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "click" version))
        (sha256
         (base32
-         "13kvp8visj5xh9d43brnda6q0kc1s40flxa5cw0p0a9hzf5dr0kn"))))
+         "1pm6khdv88h764scik67jki98xbyj367h591j8hpwy4y8nnm766a"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69449] [PATCH python-team 6/9] gnu: python-werkzeug: Rename variable to python-werkzeug-2.
                     ` (4 preceding siblings ...)
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 5/9] gnu: Add python-ephemeral-port-reserve Tanguy Le Carrour
@ 2024-02-28 10:15 62% ` Tanguy Le Carrour
  2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 7/9] gnu: Add python-werkzeug-3 Tanguy Le Carrour
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm (python-werkzeug): Rename to...
(python-werkzeug-2): ... this. Add new variable defining
default python-werkzeug.

Change-Id: I6b77baf7731303735bcd7ae707fdd68f8b956c99
---
 gnu/packages/python-web.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 88e40959c3..960ad0d879 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -30,7 +30,7 @@
 ;;; Copyright © 2019 Vagrant Cascadian <vagrant@debian.org>
 ;;; Copyright © 2019 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
-;;; Copyright © 2019, 2020 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2020, 2024 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;; Copyright © 2020 Evan Straw <evan.straw99@gmail.com>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
@@ -4971,7 +4971,7 @@ (define-public python-publicsuffix2
 List.  Forked from and using the same API as the publicsuffix package.")
     (license (list license:expat license:mpl2.0))))
 
-(define-public python-werkzeug
+(define-public python-werkzeug-2
   (package
     (name "python-werkzeug")
     (version "2.0.2")
@@ -5008,7 +5008,7 @@ (define-public python-werkzeug
 
 (define-public python-werkzeug-1.0
   (package
-    (inherit python-werkzeug)
+    (inherit python-werkzeug-2)
     (version "1.0.1")
     (source (origin
               (method url-fetch)
@@ -5030,6 +5030,8 @@ (define-public python-werkzeug-1.0
     (native-inputs
      (list python-pytest python-pytest-timeout))))
 
+(define-public python-werkzeug python-werkzeug-2)
+
 (define-public python-bottle
   (package
     (name "python-bottle")
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#69449] [PATCH python-team 9/9] gnu: Add python-flask-3.
                     ` (7 preceding siblings ...)
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 8/9] gnu: python-flask: Rename to python-flask-2 Tanguy Le Carrour
@ 2024-02-28 10:15 62% ` Tanguy Le Carrour
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm (python-flask-3): New variable.

Change-Id: I8556a3e2fed74368c6d4db99cd859ecb33a3d573
---
 gnu/packages/python-web.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 3bdabc311a..215cdd2335 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -3957,6 +3957,39 @@ (define-public python-flask-2
 presume or force a developer to use a particular tool or library.")
     (license license:bsd-3)))
 
+(define-public python-flask-3
+  (package
+    (name "python-flask")
+    (version "3.0.2")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "flask" version))
+              (sha256
+               (base32
+                "0zfbxxgl5zpbvswxywrr6fam6rj0vknv317flx84484rnzs06b42"))))
+    (build-system pyproject-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda* (#:key tests? #:allow-other-keys)
+             (when tests?
+               (invoke "python" "-m" "pytest" "-vv" "tests")))))))
+    (native-inputs
+     (list python-flit-core python-pytest))
+    (propagated-inputs
+     (list python-blinker
+           python-click
+           python-itsdangerous
+           python-jinja2
+           python-werkzeug-3))
+    (home-page "https://flask.palletsprojects.com")
+    (synopsis "Microframework based on Werkzeug, Jinja2 and good intentions")
+    (description "Flask is a micro web framework based on the Werkzeug toolkit
+and Jinja2 template engine.  It is called a micro framework because it does not
+presume or force a developer to use a particular tool or library.")
+    (license license:bsd-3)))
+
 (define-public python-flask python-flask-2)
 
 (define-public python-flask-compress
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#69449] [PATCH python-team 2/9] gnu: python-jinja2: Update to 3.1.3.
    2024-02-28 10:15 64% ` [bug#69449] [PATCH python-team 1/9] gnu: python-itsdangerous: Update to 2.1.2 Tanguy Le Carrour
@ 2024-02-28 10:15 65% ` Tanguy Le Carrour
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 3/9] gnu: python-click: Update to 8.1.7 Tanguy Le Carrour
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-jinja2): Update to 3.1.3.

Change-Id: I2dc33972577c579fa255f031705cc1961c2c4f7f
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index bdcdf8c7c8..3348cc0d58 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6019,14 +6019,14 @@ (define-public python-markupsafe
 (define-public python-jinja2
   (package
     (name "python-jinja2")
-    (version "3.1.1")
+    (version "3.1.3")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Jinja2" version))
        (sha256
         (base32
-         "1saawzys14l1p4kafs7hkihmnvqjq8fwxjmkjiqx3jq1nm5ys2v4"))))
+         "145s4mcjshv5snpc66z80xzxm3xs1gl5k8gk5dwwkcjb9madd2xc"))))
     (build-system python-build-system)
     (arguments
      '(#:phases (modify-phases %standard-phases
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69449] [PATCH python-team 7/9] gnu: Add python-werkzeug-3.
                     ` (5 preceding siblings ...)
  2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 6/9] gnu: python-werkzeug: Rename variable to python-werkzeug-2 Tanguy Le Carrour
@ 2024-02-28 10:15 62% ` Tanguy Le Carrour
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 8/9] gnu: python-flask: Rename to python-flask-2 Tanguy Le Carrour
  2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 9/9] gnu: Add python-flask-3 Tanguy Le Carrour
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm (python-werkzeug-3): New variable.

Change-Id: I9e53b3a5e303cc36aeaf7b3cfb678fb6aab1b6a7
---
 gnu/packages/python-web.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 960ad0d879..e8edc1604c 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -5030,6 +5030,41 @@ (define-public python-werkzeug-1.0
     (native-inputs
      (list python-pytest python-pytest-timeout))))
 
+(define-public python-werkzeug-3
+  (package
+    (name "python-werkzeug")
+    (version "3.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "werkzeug" version))
+       (sha256
+        (base32 "1k0x7fxlbvshcpbr9d16z2w1s3irngadwyll0jj1hax7rqg82zjh"))))
+    (build-system pyproject-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (replace 'check
+                    (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+                      (when tests?
+                        ;; Some tests rely on the network and on a newer version
+                        ;; or python-watchdog.
+                        (delete-file "tests/test_serving.py")
+                        (invoke "python" "-m" "pytest")))))))
+    (propagated-inputs (list))
+    (native-inputs (list python-ephemeral-port-reserve python-flit-core
+                         python-markupsafe python-watchdog
+                         python-pytest python-pytest-timeout
+                         python-pytest-xprocess))
+    (home-page "https://werkzeug.palletsprojects.com")
+    (synopsis "Utilities for WSGI applications")
+    (description
+     "One of the most advanced WSGI utility modules.  It includes a
+powerful debugger, full-featured request and response objects, HTTP utilities to
+handle entity tags, cache control headers, HTTP dates, cookie handling, file
+uploads, a powerful URL routing system and a bunch of community-contributed
+addon modules.")
+    (license license:bsd-3)))
+
 (define-public python-werkzeug python-werkzeug-2)
 
 (define-public python-bottle
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#69449] [PATCH python-team 1/9] gnu: python-itsdangerous: Update to 2.1.2.
  @ 2024-02-28 10:15 64% ` Tanguy Le Carrour
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 2/9] gnu: python-jinja2: Update to 3.1.3 Tanguy Le Carrour
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-itsdangerous): Update to 2.1.2.

Change-Id: I59ad3927995fc5f8b63f578a4f7fc4c0ea60678e
---
 gnu/packages/python-xyz.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e5aeeef14e..bdcdf8c7c8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -65,7 +65,7 @@
 ;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
 ;;; Copyright © 2019-2021, 2023, 2024 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
-;;; Copyright © 2019, 2020, 2021, 2022 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2020, 2021, 2022, 2024 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2019, 2021-2023 Mădălin Ionel Patrașcu <madalinionel.patrascu@mdc-berlin.de>
 ;;; Copyright © 2020 Riku Viitanen <riku.viitanen@protonmail.com>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
@@ -5743,14 +5743,14 @@ (define-public python-pympler
 (define-public python-itsdangerous
   (package
     (name "python-itsdangerous")
-    (version "2.0.1")
+    (version "2.1.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "itsdangerous" version))
        (sha256
         (base32
-         "1w6gfb2zhbcmrfj6digwzw1z68w6zg1q87rm6la2m412zil4swly"))))
+         "0shmfj4c67xgdawxxri2zqxzrhsxaiiif0pr4zrl4pky665wdfsx"))))
     (build-system python-build-system)
     (home-page "https://palletsprojects.com/p/itsdangerous/")
     (synopsis "Python library for passing data to/from untrusted environments")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69449] [PATCH python-team 5/9] gnu: Add python-ephemeral-port-reserve.
                     ` (3 preceding siblings ...)
  2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 4/9] gnu: python-blinker: Update to 1.7.0 Tanguy Le Carrour
@ 2024-02-28 10:15 65% ` Tanguy Le Carrour
  2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 6/9] gnu: python-werkzeug: Rename variable to python-werkzeug-2 Tanguy Le Carrour
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:15 UTC (permalink / raw)
  To: 69449
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-ephemeral-port-reserve): New variable.

Change-Id: I98d153179ac533fad3fa7c12a838bd12bb615a15
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a6f3aec7ed..348b3084b5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -16439,6 +16439,24 @@ (define-public python-epc
 from elisp.")
     (license license:gpl3)))
 
+(define-public python-ephemeral-port-reserve
+  (package
+    (name "python-ephemeral-port-reserve")
+    (version "1.1.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ephemeral_port_reserve" version))
+       (sha256
+        (base32 "1chl9hil7ggz6l4sfhmp0l2j55qcskbc3pj9360b0309jwndmxxq"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-setuptools python-wheel))
+    (home-page "https://github.com/Yelp/ephemeral-port-reserve/")
+    (synopsis "Utility to bind to an ephemeral port")
+    (description
+     "Bind to an ephemeral port, force it into the TIME_WAIT state, and unbind it.")
+    (license license:expat)))  ;; MIT
+
 (define-public python-forex-python
   (package
     (name "python-forex-python")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69450] [PATCH python-team] gnu: python-markdown: Update to 3.5.2.
@ 2024-02-28 10:13 64% Tanguy Le Carrour
  0 siblings, 0 replies; 200+ results
From: Tanguy Le Carrour @ 2024-02-28 10:13 UTC (permalink / raw)
  To: 69450
  Cc: Tanguy Le Carrour, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

Hi Guix, hi Python team,

This patch is trivial, but unfortunately it triggers 3000+ package rebuilds.
So, I guess, it should go to the python-team branch, right?

Regards.

* gnu/packages/python-xyz.scm (python-markdown): Update to 3.5.2.

Change-Id: I4e7465cf7603d2674ecfdeb96a64a6fae022d7db
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 348b3084b5..9105bc342b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14117,14 +14117,14 @@ (define-public python-mistune-next
 (define-public python-markdown
   (package
     (name "python-markdown")
-    (version "3.3.4")
+    (version "3.5.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "Markdown" version))
        (sha256
         (base32
-         "0jbs73nincha8fkfxx267sfxac6pl0ckszjbqbb8gk4dhs8v9d9i"))))
+         "1y1fvzaayk966rmf448vkzj65w02h0b1s7770bk81vjhqlyppb71"))))
     (build-system python-build-system)
     (native-inputs
      (list python-nose python-pyyaml))

base-commit: b77f45a62c71e326aeaab486c700bc51af29760c
prerequisite-patch-id: bdf95871f3fc6501fc2e8cff3de2f05e094b6c84
prerequisite-patch-id: 330a1248d1c165bc4ab72daf0d15ed39ee136517
prerequisite-patch-id: 4fbd3b5b5f07f7ce126c77a118d33b754c80a81d
prerequisite-patch-id: 40ba865eb7566cc508ff834373fa2853962a6701
prerequisite-patch-id: 80d998b788cea19887882c8595a0b7d4a2e701a4
prerequisite-patch-id: 82057f7fc2022b739079e9fbffe26a28bf447425
prerequisite-patch-id: 6cd31f32cad7996b8c9ad0ead019df08c76cfbe1
prerequisite-patch-id: 9072d987d861e2e84154bf01dceff7be9fc104e8
prerequisite-patch-id: 5c5d1a8a637301735a437fa09c8d7ee0d5736798
prerequisite-patch-id: 3b6f2e050b7b6ef132ba89ac862c707bf8576f55
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69434] [PATCH] gnu: Add python-ldaptor.
@ 2024-02-27 19:09 60% Sharlatan Hellseher
  2024-03-02 14:15 61% ` [bug#69434] [PATCH v2] " Sharlatan Hellseher
  0 siblings, 1 reply; 200+ results
From: Sharlatan Hellseher @ 2024-02-27 19:09 UTC (permalink / raw)
  To: 69434
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-ldaptor): New variable.

Change-Id: If7d2cb7b51bb0ccc85b76d7f2d4b31857e042066
---
 gnu/packages/python-xyz.scm | 49 +++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 80ec098b7a..6df55c1b7c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -20007,6 +20007,55 @@ (define-public python-twisted-22
                python-typing-extensions
                `(,python "tk"))))))
 
+(define-public python-ldaptor
+  (package
+    (name "python-ldaptor")
+    (version "21.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "ldaptor" version))
+       (sha256
+        (base32 "0n53czn5pyh8923y282spdb7xc8c9rhn0n43bczanjjx6wcynjcc"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      #~(list "-m" "twisted.trial"
+              (string-append "-j" (number->string (parallel-job-count)))
+              "ldaptor")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'disable-failing-tests
+          (lambda _
+            ;; Testing with Twisted 22.4 results in infinite loop creating
+            ;; temporary config files, see
+            ;; <https://github.com/twisted/ldaptor/issues/238>.
+            (delete-file "ldaptor/test/test_config.py")))
+          (replace 'check
+            (lambda* (#:key tests? test-flags #:allow-other-keys)
+              (when tests?
+                (apply invoke "python" test-flags)))))))
+    (propagated-inputs
+     (list python-passlib
+           python-pyparsing
+           python-six
+           python-twisted-22
+           python-zope-interface))
+    (home-page "https://github.com/twisted/ldaptor")
+    (synopsis "Pure-Python Twisted library for LDAP")
+    (description
+     "This package provides a Python Twisted library for LDAP, which key
+feaatures are:
+@itemize
+@item LDAP client logic
+@item separately-accessible LDAP and BER protocol message generation/parsing
+@item ASCII-format LDAP filter generation and parsing
+@item LDIF format data generation
+@item Samba password changing logic
+@end itemize")
+    (license license:expat)))
+
 (define-public python-pika
   (package
     (name "python-pika")

base-commit: 1306beaf3f6c8ddded2a956f5863bc65aad78882
prerequisite-patch-id: e95e4f5dfdbb868da6fd30f0a02105147faf91f5
prerequisite-patch-id: 82aa4f0d751771b48cad84aff0e2c44aee64a212
prerequisite-patch-id: bf036a9eacd9f13ec4fd6bfa5fe5d941101f1e7a
prerequisite-patch-id: 0c1231398b1f03c8c353c4169f4633d57a8c382b
prerequisite-patch-id: 8eb030a25f8399d3183ad0613487f408b2e24997
prerequisite-patch-id: 362a2851ab947aad0ff87255206e4e23b60efd4e
prerequisite-patch-id: 9393c6262847dd7a8fa31d77ab0397c7c94f1dae
prerequisite-patch-id: 7337fa584ae6858660cd62cc09acfbc312bea064
prerequisite-patch-id: e24f28c35db27a23dc3afb6a095a4b0efabc897e
prerequisite-patch-id: 3e0785bcda3dd606524e04fd7a9f76312a800de5
-- 
2.41.0





^ permalink raw reply related	[relevance 60%]

* [bug#67120] [PATCH v6 1/5] gnu: Add python-mpv-jsonipc.
  @ 2024-02-25 22:20 65% ` Ian Eure
  2024-02-25 22:20 64% ` [bug#67120] [PATCH v6 2/5] gnu: Add python-jellyfin-apiclient Ian Eure
  2024-02-25 22:20 62% ` [bug#67120] [PATCH v6 3/5] gnu: Add python-pystray Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-25 22:20 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-mpv-jsonipc): New variable.

Change-Id: Iec7679213d9b9e8e5cbf01a30838e27e71704e54
---
 gnu/packages/python-xyz.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a051f5a8db..b6001416a6 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25808,6 +25808,23 @@ (define-public online-judge-tools
 submitting it.")
     (license license:expat)))
 
+(define-public python-mpv-jsonipc
+  (package
+    (name "python-mpv-jsonipc")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-mpv-jsonipc" version))
+       (sha256
+        (base32 "0ymdwrx544a6gn6wm9dixpgzbfrbpxvcj5ys7m41cgb4lvpvx691"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/iwalton3/python-mpv-jsonipc")
+    (synopsis "Python API to control MPV using JSON IPC")
+    (description "python-mpv-jsonipc implements an interface similar to
+python-mpv, but it uses the JSON IPC protocol instead of the C API.")
+    (license license:asl2.0)))
+
 (define-public python-parso
   (package
     (name "python-parso")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#67120] [PATCH v6 2/5] gnu: Add python-jellyfin-apiclient.
    2024-02-25 22:20 65% ` [bug#67120] [PATCH v6 1/5] gnu: Add python-mpv-jsonipc Ian Eure
@ 2024-02-25 22:20 64% ` Ian Eure
  2024-02-25 22:20 62% ` [bug#67120] [PATCH v6 3/5] gnu: Add python-pystray Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-25 22:20 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-jellyfin-apiclient): New variable.

Change-Id: If84546b14d380a3a10af63d4f41711125298487a
---
 gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b6001416a6..1ed1f0e135 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25825,6 +25825,26 @@ (define-public python-mpv-jsonipc
 python-mpv, but it uses the JSON IPC protocol instead of the C API.")
     (license license:asl2.0)))
 
+(define-public python-jellyfin-apiclient
+  (package
+    (name "python-jellyfin-apiclient")
+    (version "1.9.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "jellyfin-apiclient-python" version))
+       (sha256
+        (base32 "0r67cp9nizvn3cbslgi30zpd3mw4a6zal0ygik3jv5lni1xdkk5w"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-certifi python-requests python-urllib3
+                             python-websocket-client))
+    (home-page "https://github.com/jellyfin/jellyfin-apiclient-python")
+    (synopsis "Python API client for Jellyfin")
+    (description "python-jellyfin-apiclient allows use of the Jellyfin API
+from Python.  It was extracted from the Jellyfin Kodi plugin so other users
+may use the Jellyfin API more easily.")
+    (license license:gpl3)))
+
 (define-public python-parso
   (package
     (name "python-parso")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#67120] [PATCH v6 3/5] gnu: Add python-pystray.
    2024-02-25 22:20 65% ` [bug#67120] [PATCH v6 1/5] gnu: Add python-mpv-jsonipc Ian Eure
  2024-02-25 22:20 64% ` [bug#67120] [PATCH v6 2/5] gnu: Add python-jellyfin-apiclient Ian Eure
@ 2024-02-25 22:20 62% ` Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-25 22:20 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-pystray): New variable.

Change-Id: If10777c9ec91b549b9937b4825565223786a75cb
---
 gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1ed1f0e135..36442f0870 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31728,6 +31728,42 @@ (define-public python-qdarkstyle
 Qt applications.")
     (license license:expat)))
 
+(define-public python-pystray
+  (package
+    (name "python-pystray")
+    (version "0.19.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/moses-palmer/pystray")
+             (commit "1907f8681d6d421517c63d94f425f9cdd74d0034")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vj6c8s7rbc7xc4bi5brx5629ls1ri9prcw9290v85hagilmp609"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      ;; The test suite requires user interaction, there are no automated
+      ;; tests.
+      #:tests? #false
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'sanity-check 'use-dummy-backend
+                     (lambda _
+                       ;; Without setting this, pystray tries to connect to
+                       ;; X11 on import.
+                       (setenv "PYSTRAY_BACKEND" "dummy"))))))
+    (native-inputs (list python-sphinx))
+    (propagated-inputs (list python-pillow python-six python-xlib))
+    (home-page "https://github.com/moses-palmer/pystray")
+    (synopsis "Create a system tray icon")
+    (description "This library allows you to create a system tray icon.
+
+It allows specifying an icon, a title and a callback for when the icon is
+activated. The icon and title can be changed after the icon has been created,
+and the visibility of the icon can be toggled.")
+    (license license:lgpl3)))
+
 (define-public python-bitstring
   (package
     (name "python-bitstring")
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#69389] [PATCH] gnu: Add python-xmp-toolkit.
@ 2024-02-25 17:42 66% Felix Gruber
  0 siblings, 0 replies; 200+ results
From: Felix Gruber @ 2024-02-25 17:42 UTC (permalink / raw)
  To: 69389
  Cc: Felix Gruber, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-xmp-toolkit): New variable.
* gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Add it.

Change-Id: Ibce05155961eb5ba199754646e08acff2410f95d
---
 gnu/local.mk                                  |  1 +
 ...-xmp-toolkit-add-missing-error-codes.patch | 51 +++++++++++++++++++
 gnu/packages/python-xyz.scm                   | 51 ++++++++++++++++++-
 3 files changed, 102 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 741c72a653..b10063678e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1943,6 +1943,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-versioneer-guix-support.patch	\
   %D%/packages/patches/python-waitress-fix-tests.patch		\
   %D%/packages/patches/python-werkzeug-tests.patch		\
+  %D%/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch	\
   %D%/packages/patches/python-zeep-Fix-pytest_httpx-test-cases.patch	\
   %D%/packages/patches/qemu-build-info-manual.patch		\
   %D%/packages/patches/qemu-disable-some-qtests-tests.patch	\
diff --git a/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch b/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch
new file mode 100644
index 0000000000..17bdae188f
--- /dev/null
+++ b/gnu/packages/patches/python-xmp-toolkit-add-missing-error-codes.patch
@@ -0,0 +1,51 @@
+From fd9e887a1853d9b4bc3fce20d414d648fb5abbfc Mon Sep 17 00:00:00 2001
+From: Asher Glick <asher.glick@gmail.com>
+Date: Mon, 1 Mar 2021 14:35:46 -0600
+Subject: [PATCH] Add missing error codes and graceful handling of possible
+ future missing codes.
+
+---
+ libxmp/exempi.py | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/libxmp/exempi.py b/libxmp/exempi.py
+index 683e240..f58003c 100644
+--- a/libxmp/exempi.py
++++ b/libxmp/exempi.py
+@@ -85,6 +85,7 @@ ERROR_MESSAGE = {    0: "unknown error",
+                    -13: "std exception",
+                    -14: "unknown exception",
+                    -15: "no memory",
++                   -16: "progress abort",
+                   -101: "bad schema",
+                   -102: "bad XPath",
+                   -103: "bad options",
+@@ -95,6 +96,14 @@ ERROR_MESSAGE = {    0: "unknown error",
+                   -108: "bad file format",
+                   -109: "no file handler",
+                   -110: "too large for JPEG",
++                  -111: "no file",
++                  -112: "file permission error",
++                  -113: "disk space",
++                  -114: "read error",
++                  -115: "write error",
++                  -116: "bad block format",
++                  -117: "file path not a file",
++                  -118: "rejected file extension",
+                   -201: "bad XML",
+                   -202: "bad RDF",
+                   -203: "bad XMP",
+@@ -1697,6 +1706,9 @@ def check_error(success):
+     # so we supplement it by explicitly checking the error code.
+     ecode = EXEMPI.xmp_get_error()
+     if not success or ecode != 0:
+-        error_msg = ERROR_MESSAGE[ecode]
++        if ecode in ERROR_MESSAGE:
++            error_msg = ERROR_MESSAGE[ecode]
++        else:
++            error_msg = "Unexpected error code " + str(ecode)
+         msg = 'Exempi function failure ("{0}").'.format(error_msg)
+         raise XMPError(msg)
+-- 
+2.30.2
+
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a051f5a8db..6cbedcb5e9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -108,7 +108,7 @@
 ;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
 ;;; Copyright © 2021, 2022, 2023 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 ;;; Copyright © 2021, 2022 Pradana Aumars <paumars@courrier.dev>
-;;; Copyright © 2021, 2022, 2023 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2021–2024 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2021 Sébastien Lerique <sl@eauchat.org>
 ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
 ;;; Copyright © 2021 ZmnSCPxj <ZmnSCPxj@protonmail.com>
@@ -35628,6 +35628,55 @@ (define-public python-zeroc-ice-3.6
                (base32
                 "0mikjfvq26kh8asnn9v55z41pap4c5ypymqnwwi4xkavc3mzyda2"))))))
 
+(define-public python-xmp-toolkit
+  (package
+    (name "python-xmp-toolkit")
+    (version "2.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-xmp-toolkit" version))
+       (sha256
+        (base32 "12x6lyaxjpbl8ll3cj97039kwvsha2nkx2v8v8irfbi2p0dl721s"))
+        (patches (search-patches
+                   "python-xmp-toolkit-add-missing-error-codes.patch"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags
+      '(list "-k" (string-append "not test_can_put_xmp and "
+                                 "not test_exempi_bad_combinations and "
+                                 "not test_formats and "
+                                 "not test_get_xmp and "
+                                 "not test_open_file_with_options"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'build 'configure-environment
+            (lambda* (#:key outputs inputs #:allow-other-keys)
+              (let ((exempi #$(this-package-input "exempi")))
+                (setenv "LD_LIBRARY_PATH"
+                        (string-append exempi "/lib"))))))))
+    (inputs (list exempi))
+    (propagated-inputs (list python-pytz))
+    (native-inputs (list python-pytest))
+    (home-page "https://github.com/python-xmp-toolkit/python-xmp-toolkit")
+    (synopsis "Python XMP Toolkit for working with metadata.")
+    (description "Python XMP Toolkit is a library for working with XMP
+metadata, as well as reading/writing XMP metadata stored in many different
+file formats.
+
+Python XMP Toolkit is wrapping Exempi (using ctypes), a C/C++ XMP library
+based on Adobe XMP Toolkit, ensuring that future updates to the XMP standard
+are easily incorporated into the library with a minimum amount of work.
+
+Python XMP Toolkit has been developed by:
+@itemize
+@item ESA/Hubble - European Space Agency
+@item ESO - European Southern Observatory
+@item CRS4 - Centre for Advanced Studies, Research and Development in Sardinia
+@end itemize")
+      (license license:bsd-3)))
+
 ;;;
 ;;; Avoid adding new packages to the end of this file. To reduce the chances
 ;;; of a merge conflict, place them above by existing packages with similar

base-commit: b25b94335a3ee8d68d2145da8e5ea0325ecea451
-- 
2.43.0





^ permalink raw reply related	[relevance 66%]

* [bug#69352] [PATCH OPTIONAL 13/13] gnu: python: python-scikit-build: Add more non-deterministic test failures.
    2024-02-24  6:57 65% ` [bug#69352] [PATCH 02/13] gnu: python-scikit-build: Install cmake modules Liliana Marie Prikler
  2024-02-24  7:59 57% ` [bug#69352] [PATCH 12/13] gnu: python-telingo: Update to 2.1.3 Liliana Marie Prikler
@ 2024-02-24  9:17 65% ` Liliana Marie Prikler
  2 siblings, 0 replies; 200+ results
From: Liliana Marie Prikler @ 2024-02-24  9:17 UTC (permalink / raw)
  To: 69352

* gnu/packages/python-xyz.scm (python-scikit-build)[#:phases]<check>: Also
exclude “test_cxx_compiler” and “test_fortran_compiler”.
---
This one might be a bit controversial, as I haven't reported this issue
upstream either, but I've noticed that some quite fundamental-seeming
tests fail locally.  Shouldn't happen on CI, but you never know.

 gnu/packages/python-xyz.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 88dadb9f4a..dc99588ccb 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31930,7 +31930,10 @@ (define-public python-scikit-build
                               ;; nondeterministically (see:
                               ;; https://github.com/scikit-build/scikit-build/issues/711).
                               "and not test_generator_cleanup "
-                              "and not test_generator_selection ")))))
+                              "and not test_generator_selection "
+                              ;; … and there's more of them
+                              "and not test_cxx_compiler "
+                              "and not test_fortran_compiler ")))))
           (add-after 'install 'install-cmake
             (lambda* (#:key outputs #:allow-other-keys)
               (let ((lib (string-append (assoc-ref outputs "out")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69352] [PATCH 12/13] gnu: python-telingo: Update to 2.1.3.
    2024-02-24  6:57 65% ` [bug#69352] [PATCH 02/13] gnu: python-scikit-build: Install cmake modules Liliana Marie Prikler
@ 2024-02-24  7:59 57% ` Liliana Marie Prikler
  2024-02-24  9:17 65% ` [bug#69352] [PATCH OPTIONAL 13/13] gnu: python: python-scikit-build: Add more non-deterministic test failures Liliana Marie Prikler
  2 siblings, 0 replies; 200+ results
From: Liliana Marie Prikler @ 2024-02-24  7:59 UTC (permalink / raw)
  To: 69352

* gnu/packages/potassco.scm (python-telingo): Update to 2.1.3.
[source]: Drop obsolete patch.
* gnu/packages/patches/python-telingo-fix-comparison.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
---
 gnu/local.mk                                  |  1 -
 .../python-telingo-fix-comparison.patch       | 19 -------------------
 gnu/packages/potassco.scm                     |  5 ++---
 3 files changed, 2 insertions(+), 23 deletions(-)
 delete mode 100644 gnu/packages/patches/python-telingo-fix-comparison.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 25e2341a72..9eef46bf57 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1809,7 +1809,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-sip-include-dirs.patch	\
   %D%/packages/patches/python-sgmllib3k-assertions.patch	\
   %D%/packages/patches/python-sphinx-prompt-docutils-0.19.patch	\
-  %D%/packages/patches/python-telingo-fix-comparison.patch	\
   %D%/packages/patches/python-typeguard-python3.10.patch	\
   %D%/packages/patches/python-uqbar-python3.10.patch	        \
   %D%/packages/patches/python-wxwidgets-type-errors.patch	\
diff --git a/gnu/packages/patches/python-telingo-fix-comparison.patch b/gnu/packages/patches/python-telingo-fix-comparison.patch
deleted file mode 100644
index 6d05048dcb..0000000000
--- a/gnu/packages/patches/python-telingo-fix-comparison.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: source/telingo/transformers/head.py
-===================================================================
---- source.orig/telingo/transformers/head.py
-+++ source/telingo/transformers/head.py
-@@ -564,10 +564,12 @@ class HeadTransformer:
-                 cond = []
-                 diff = _ast.BinaryOperation(loc, _ast.BinaryOperator.Minus, param, shift)
-                 if lhs.ast_type != _ast.ASTType.SymbolicTerm or lhs.symbol.type != _clingo.SymbolType.Number or lhs.symbol.number > 0:
--                    cond.append(_ast.Literal(loc, _ast.Sign.NoSign, _ast.Comparison(_ast.ComparisonOperator.LessEqual, lhs, diff)))
-+                    cond.append(_ast.Literal(loc, _ast.Sign.NoSign,
-+                                             _ast.Comparison(lhs, [_ast.Guard(_ast.ComparisonOperator.LessEqual, diff)])))
- 
-                 if rhs.ast_type != _ast.ASTType.SymbolicTerm or rhs.symbol.type != _clingo.SymbolType.Supremum:
--                    cond.append(_ast.Literal(loc, _ast.Sign.NoSign, _ast.Comparison(_ast.ComparisonOperator.LessEqual, diff, rhs)))
-+                    cond.append(_ast.Literal(loc, _ast.Sign.NoSign,
-+                                             _ast.Comparison(diff, [_ast.Guard(_ast.ComparisonOperator.LessEqual, rhs)])))
- 
-                 elems.extend([_ast.ConditionalLiteral(loc, _ast.Literal(loc, _ast.Sign.NoSign, head), cond) for head in heads])
- 
diff --git a/gnu/packages/potassco.scm b/gnu/packages/potassco.scm
index 4eb0f4a2c7..43d9ea6647 100644
--- a/gnu/packages/potassco.scm
+++ b/gnu/packages/potassco.scm
@@ -520,17 +520,16 @@ (define-public python-plingo
 (define-public python-telingo
   (package
     (name "python-telingo")
-    (version "2.1.1")
+    (version "2.1.3")
     (source (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/potassco/telingo")
                     (commit (string-append "v" version))))
               (file-name (git-file-name name version))
-              (patches (search-patches "python-telingo-fix-comparison.patch"))
               (sha256
                (base32
-                "0g3khxfdzc2hc7dkiyyqhb399h6h21m5wkp6wy8w71n0m32fiy53"))))
+                "1q6hlh4b5hsa4n5agvmfa9rhsxfd2g6kpl4b9kfccwbmf6dh51k6"))))
     (build-system pyproject-build-system)
     (propagated-inputs (list python-clingo))
     (home-page "https://potassco.org/")
-- 
2.41.0





^ permalink raw reply related	[relevance 57%]

* [bug#69352] [PATCH 02/13] gnu: python-scikit-build: Install cmake modules.
  @ 2024-02-24  6:57 65% ` Liliana Marie Prikler
  2024-02-24  7:59 57% ` [bug#69352] [PATCH 12/13] gnu: python-telingo: Update to 2.1.3 Liliana Marie Prikler
  2024-02-24  9:17 65% ` [bug#69352] [PATCH OPTIONAL 13/13] gnu: python: python-scikit-build: Add more non-deterministic test failures Liliana Marie Prikler
  2 siblings, 0 replies; 200+ results
From: Liliana Marie Prikler @ 2024-02-24  6:57 UTC (permalink / raw)
  To: 69352

* gnu/packages/python-xyz.scm (python-scikit-build)[#:phases]: Add
‘install-cmake’.
---
 gnu/packages/python-xyz.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a051f5a8db..88dadb9f4a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31930,7 +31930,15 @@ (define-public python-scikit-build
                               ;; nondeterministically (see:
                               ;; https://github.com/scikit-build/scikit-build/issues/711).
                               "and not test_generator_cleanup "
-                              "and not test_generator_selection "))))))))
+                              "and not test_generator_selection ")))))
+          (add-after 'install 'install-cmake
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((lib (string-append (assoc-ref outputs "out")
+                                        "/lib/cmake/modules")))
+                (mkdir-p lib)
+                (with-directory-excursion "skbuild/resources/cmake"
+                   (for-each (lambda (file) (install-file file lib))
+                             (find-files "." "\\.cmake")))))))))
     (native-inputs
      (list cmake-minimal
            gfortran
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#68052] [PATCH v3 1/4] gnu: python-poppler-qt5: Update to 21.3.0.
  @ 2024-02-21 19:30 45% ` Marco Rimoldi via Guix-patches via
  0 siblings, 0 replies; 200+ results
From: Marco Rimoldi via Guix-patches via @ 2024-02-21 19:30 UTC (permalink / raw)
  To: 68052; +Cc: Marco Rimoldi

From: Marco Rimoldi <rimarko@libero.it>

* gnu/packages/pdf.scm (python-poppler-qt5): Update to 21.3.0.
[build-system]: Change to pyproject.
[inputs]: Change SIP to current version variant.
* gnu/packages/patches/python-poppler-qt5-fix-build.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): De-register said patch.

Change-Id: I30d6e2a3180505091d8072ed452211b0bb3a0178
---
 gnu/local.mk                                  |   1 -
 .../python-poppler-qt5-fix-build.patch        | 116 ------------------
 gnu/packages/pdf.scm                          |  50 +++-----
 3 files changed, 18 insertions(+), 149 deletions(-)
 delete mode 100644 gnu/packages/patches/python-poppler-qt5-fix-build.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index c08b27f94d..631addcb29 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1800,7 +1800,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-feedparser-missing-import.patch	\
   %D%/packages/patches/python-louvain-fix-test.patch		\
   %D%/packages/patches/python-random2-getrandbits-test.patch		\
-  %D%/packages/patches/python-poppler-qt5-fix-build.patch	\
   %D%/packages/patches/python-pyreadstat-link-libiconv.patch	\
   %D%/packages/patches/python-pyls-black-41.patch		\
   %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch	\
diff --git a/gnu/packages/patches/python-poppler-qt5-fix-build.patch b/gnu/packages/patches/python-poppler-qt5-fix-build.patch
deleted file mode 100644
index 099bb86d2f..0000000000
--- a/gnu/packages/patches/python-poppler-qt5-fix-build.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-Patch taken from the upstream repository
-https://github.com/frescobaldi/python-poppler-qt5/issues/43
-
-From 92e5962ec3751ab051d0b655fd61afc7a1cf709e Mon Sep 17 00:00:00 2001
-From: Ben Greiner <code@bnavigator.de>
-Date: Thu, 4 Mar 2021 17:02:51 +0100
-Subject: [PATCH] map type QVector< QPair<TYPE, TYPE> > for
- FormFieldChoice::choicesWithExportValues() (#45)
-
----
- types.sip | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 93 insertions(+)
-
-diff --git a/types.sip b/types.sip
-index 239b8c9..81cb283 100644
---- a/types.sip
-+++ b/types.sip
-@@ -331,5 +331,98 @@ template <TYPE>
- };
- 
- 
-+/**
-+ * Convert QVector< QPair<TYPE, TYPE> >
-+ * from and to a Python list of a 2-item tuple
-+ */
-+
-+template<TYPE>
-+%MappedType QVector< QPair<TYPE, TYPE> >
-+{
-+%TypeHeaderCode
-+#include <qvector.h>
-+#include <qpair.h>
-+%End
-+
-+%ConvertFromTypeCode
-+  // Create the list.
-+  PyObject *l;
-+
-+  if ((l = PyList_New(sipCpp->size())) == NULL)
-+      return NULL;
-+
-+  // Set the list elements.
-+  for (int i = 0; i < sipCpp->size(); ++i)
-+  {
-+    QPair<TYPE, TYPE>* p = new QPair<TYPE, TYPE>(sipCpp->at(i));
-+    PyObject *ptuple = PyTuple_New(2);
-+    PyObject *pfirst;
-+    PyObject *psecond;
-+
-+    TYPE *sfirst = new TYPE(p->first);
-+    if ((pfirst = sipConvertFromType(sfirst, sipType_TYPE, sipTransferObj)) == NULL)
-+    {
-+      Py_DECREF(l);
-+      Py_DECREF(ptuple);
-+      return NULL;
-+    }
-+    PyTuple_SET_ITEM(ptuple, 0, pfirst);
-+
-+    TYPE *ssecond = new TYPE(p->second);
-+    if ((psecond = sipConvertFromType(ssecond, sipType_TYPE, sipTransferObj)) == NULL)
-+    {
-+      Py_DECREF(l);
-+      Py_DECREF(ptuple);
-+      Py_DECREF(pfirst);
-+      return NULL;
-+    }
-+    PyTuple_SET_ITEM(ptuple, 1, psecond);
-+
-+    PyList_SET_ITEM(l, i, ptuple);
-+  }
-+
-+  return l;
-+%End
-+
-+%ConvertToTypeCode
-+  const sipTypeDef* qpair_type = sipFindType("QPair<TYPE, TYPE>");
-+
-+  // Check the type if that is all that is required.
-+  if (sipIsErr == NULL)
-+  {
-+    if (!PySequence_Check(sipPy))
-+      return 0;
-+
-+    for (int i = 0; i < PySequence_Size(sipPy); ++i)
-+      if (!sipCanConvertToType(PySequence_ITEM(sipPy, i), qpair_type, SIP_NOT_NONE))
-+        return 0;
-+
-+    return 1;
-+  }
-+
-+
-+  QVector< QPair<TYPE, TYPE> > *qv = new QVector< QPair<TYPE, TYPE> >;
-+
-+  for (int i = 0; i < PySequence_Size(sipPy); ++i)
-+  {
-+    int state;
-+    QPair<TYPE, TYPE> * p = reinterpret_cast< QPair<TYPE, TYPE> * >(sipConvertToType(PySequence_ITEM(sipPy, i), qpair_type, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
-+
-+    if (*sipIsErr)
-+    {
-+      sipReleaseType(p, qpair_type, state);
-+      delete qv;
-+      return 0;
-+    }
-+    qv->append(*p);
-+    sipReleaseType(p, qpair_type, state);
-+  }
-+
-+  *sipCppPtr = qv;
-+  return sipGetState(sipTransferObj);
-+%End
-+
-+};
-+
- 
- /* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */
diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm
index 0d796f65bb..9076407740 100644
--- a/gnu/packages/pdf.scm
+++ b/gnu/packages/pdf.scm
@@ -431,40 +431,26 @@ (define-public poppler-qt5
 (define-public python-poppler-qt5
   (package
     (name "python-poppler-qt5")
-    (version "21.1.0")
+    (version "21.3.0")
     (source
-      (origin
-        (method url-fetch)
-        (uri (pypi-uri "python-poppler-qt5" version))
-        (sha256
-         (base32
-          "0b82gm4i75q5v19kfbq0h4y0b2vcwr2213zkhxh6l0h45kdndmxd"))
-       (patches (search-patches "python-poppler-qt5-fix-build.patch"))))
-    (build-system python-build-system)
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-poppler-qt5" version))
+       (sha256
+        (base32 "1q3gvmsmsq3llf9mcbhlkryrgprqrw2z7wmnvagy180f3y2fhxxl"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(;; There are no tests.  The check phase just causes a rebuild.
-       #:tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'build
-           (lambda* (#:key inputs #:allow-other-keys)
-             (substitute* "setup.py"
-               ;; This check always fails, so disable it.
-               (("if not check_qtxml\\(\\)")
-                "if True"))
-             ;; We need to pass an extra flag here.  This cannot be in
-             ;; configure-flags because it should not be passed for the
-             ;; installation phase.
-             ((@@ (guix build python-build-system) call-setuppy)
-              "build_ext" (list (string-append "--pyqt-sip-dir="
-                                               (assoc-ref inputs "python-pyqt")
-                                               "/share/sip")) #t))))))
-    (native-inputs
-     (list pkg-config))
-    (inputs
-     (list python-sip-4 python-pyqt poppler-qt5 qtbase-5))
-    (home-page "https://pypi.org/project/python-poppler-qt5/")
-    (synopsis "Python bindings for Poppler-Qt5")
+     `(;; The sipbuild.api backend builder expects a Python dictionary as per
+       
+       ;; https://peps.python.org/pep-0517/#config-settings, but we
+       ;; give it lists and it fails.  The next line is a workaround.
+       #:configure-flags '#nil
+       #:tests? #f))
+    (native-inputs (list pkg-config))
+    (inputs (list python-sip python-pyqt-builder python-pyqt poppler-qt5
+                  qtbase-5))
+    (home-page "https://github.com/frescobaldi/python-poppler-qt5")
+    (synopsis "Python binding to Poppler-Qt5")
     (description
      "This package provides Python bindings for the Qt5 interface of the
 Poppler PDF rendering library.")

base-commit: fdbf4192f5eaa7fdb5e6e2e98ada0726c8104824
-- 
2.41.0





^ permalink raw reply related	[relevance 45%]

* [bug#60240] [PATCH v2] gnu: Add python-3.12 and python-next.
  @ 2024-02-21 12:13 34% ` Tanguy Le Carrour
    2024-03-06 12:55 35% ` [bug#60240] [PATCH v3] " Tanguy Le Carrour
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 200+ results
From: Tanguy Le Carrour @ 2024-02-21 12:13 UTC (permalink / raw)
  To: 60240
  Cc: john.kehayias, andreas, Tanguy Le Carrour, zimon.toutoune,
	Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

Hi Guix,

Sorry it took me so long —thanks again John for the reminder!—, but I
eventually made it! I have a Python 3.12.2 running on my computer.

I created a brand new package definition for it, not inheriting from
`python-2`. I actually copied/pasted the `python-2` package definition,
removed what was specific to Python 2 and then copied over the things
specific to Python 3 from the `python-3.10` package definition.

There are still things here and there that I’m not happy with, though:
- skipping `test_pdb_issue_20766` doesn’t seem to work, so I modified
  the expected output;
- I use the old style for `native-inputs`, for I was not sure how to
  make the new style work with a `local-file`;
- I left the `(@ (gnu packages compression) zip)`, even though I’m not
  sur why it’s better than "just" `zip`;
- When I apply the patch I get whitespace errors, but I don’t know how
  those whitespace were introduced and how to get rid of them.

Btw, the patch targets the branch `python-team`.

Looking forwards to your comments!


* gnu/packages/python.scm (python-3.12, python-next): New variables.
* gnu/packages/patches/python-3.12-fix-tests.patch: New file.

Change-Id: Ie393b732a8863569578e72e62603b75a1655a34e
---
 .../patches/python-3.12-fix-tests.patch       | 334 ++++++++++++++++
 gnu/packages/python.scm                       | 378 +++++++++++++++++-
 2 files changed, 711 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/python-3.12-fix-tests.patch

diff --git a/gnu/packages/patches/python-3.12-fix-tests.patch b/gnu/packages/patches/python-3.12-fix-tests.patch
new file mode 100644
index 0000000000..206a7223f5
--- /dev/null
+++ b/gnu/packages/patches/python-3.12-fix-tests.patch
@@ -0,0 +1,334 @@
+From f0698133e7d6c353a3e6ae0fc62e57ba558a9bc0 Mon Sep 17 00:00:00 2001
+From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
+Date: Wed, 28 Oct 2020 22:55:05 -0400
+Subject: [PATCH] Skip problematic Python 3 tests in Guix.
+
+A subset of the hunks in this patch is tracked upstream at
+https://bugs.python.org/issue38845, which was contributed by Tanguy Le
+Carrour <tanguy@bioneland.org>.
+
+diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
+index e42c7ab4bd..8087c84dab 100644
+--- a/Lib/test/_test_multiprocessing.py
++++ b/Lib/test/_test_multiprocessing.py
+@@ -1695,6 +1695,7 @@ def _test_wait_result(cls, c, pid):
+         if pid is not None:
+             os.kill(pid, signal.SIGINT)
+ 
++    @unittest.skipIf(True, "This fails for unknown reasons on Guix")
+     def test_wait_result(self):
+         if isinstance(self, ProcessesMixin) and sys.platform != 'win32':
+             pid = os.getpid()
+@@ -4150,6 +4151,7 @@ def test_shared_memory_across_processes(self):
+         sms.close()
+ 
+     @unittest.skipIf(os.name != "posix", "not feasible in non-posix platforms")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_shared_memory_SharedMemoryServer_ignores_sigint(self):
+         # bpo-36368: protect SharedMemoryManager server process from
+         # KeyboardInterrupt signals.
+diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
+index 85c8152d49..e35cfffe84 100644
+--- a/Lib/test/test_asyncio/test_base_events.py
++++ b/Lib/test/test_asyncio/test_base_events.py
+@@ -1377,6 +1377,8 @@ def test_create_connection_no_inet_pton(self, m_socket):
+         self._test_create_connection_ip_addr(m_socket, False)
+ 
+     @patch_socket
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_create_connection_service_name(self, m_socket):
+         m_socket.getaddrinfo = socket.getaddrinfo
+         sock = m_socket.socket.return_value
+diff --git a/Lib/test/test_ctypes/test_find.py b/Lib/test/test_ctypes/test_find.py
+index a41e94971d..1291af3057 100644
+--- a/Lib/test/test_ctypes/test_find.py
++++ b/Lib/test/test_ctypes/test_find.py
+@@ -117,6 +117,7 @@ def test_find_library_with_gcc(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None):
+             self.assertNotEqual(find_library('c'), None)
+ 
++    @unittest.skipIf(True, 'Fails on Guix.')
+     def test_find_library_with_ld(self):
+         with unittest.mock.patch("ctypes.util._findSoname_ldconfig", lambda *args: None), \
+              unittest.mock.patch("ctypes.util._findLib_gcc", lambda *args: None):
+diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
+index 1ee9958445..ab6b41befe 100644
+--- a/Lib/test/test_generators.py
++++ b/Lib/test/test_generators.py
+@@ -34,6 +34,7 @@ def generator2(self):
+         else:
+             return "FAILED"
+ 
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment')
+     def test_raise_and_yield_from(self):
+         gen = self.generator1()
+         gen.send(None)
+diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
+index ec105ae1a0..ae4c5b672e 100644
+--- a/Lib/test/test_pathlib.py
++++ b/Lib/test/test_pathlib.py
+@@ -3069,6 +3069,7 @@ def test_rglob(self):
+                          'pwd module does not expose getpwall()')
+     @unittest.skipIf(sys.platform == "vxworks",
+                      "no home directory on VxWorks")
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         import_helper.import_module('pwd')
+diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
+index 51b844262e..004d3133cf 100644
+--- a/Lib/test/test_pdb.py
++++ b/Lib/test/test_pdb.py
+@@ -1580,6 +1580,7 @@ def test_pdb_next_command_subiterator():
+     (Pdb) continue
+     """
+ 
++@unittest.skipIf(True, 'Fails on Guix… but skipIf not taken into account?!')
+ def test_pdb_issue_20766():
+     """Test for reference leaks when the SIGINT handler is set.
+ 
+@@ -1598,11 +1599,11 @@ def test_pdb_issue_20766():
+     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
+     (Pdb) continue
+-    pdb 1: <built-in function default_int_handler>
++    pdb 1: 1
+     > <doctest test.test_pdb.test_pdb_issue_20766[0]>(6)test_function()
+     -> print('pdb %d: %s' % (i, sess._previous_sigint_handler))
+     (Pdb) continue
+-    pdb 2: <built-in function default_int_handler>
++    pdb 2: 1
+     """
+ 
+ def test_pdb_issue_43318():
+diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
+index 2ab6f6a986..8cf6b4d1c8 100644
+--- a/Lib/test/test_regrtest.py
++++ b/Lib/test/test_regrtest.py
+@@ -1049,6 +1049,7 @@ def test_fromfile(self):
+         output = self.run_tests('--fromfile', filename)
+         self.check_executed_tests(output, tests, stats=stats)
+ 
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_interrupted(self):
+         code = TEST_INTERRUPTED
+         test = self.create_test('sigint', code=code)
+@@ -1066,6 +1067,7 @@ def test_slowest(self):
+                  % (self.TESTNAME_REGEX, len(tests)))
+         self.check_line(output, regex)
+ 
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build environment.')
+     def test_slowest_interrupted(self):
+         # Issue #25373: test --slowest with an interrupted test
+         code = TEST_INTERRUPTED
+diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
+index 317e7ca8f8..7f272daf24 100644
+--- a/Lib/test/test_resource.py
++++ b/Lib/test/test_resource.py
+@@ -151,6 +151,7 @@ def test_freebsd_contants(self):
+ 
+     @unittest.skipUnless(hasattr(resource, 'prlimit'), 'no prlimit')
+     @support.requires_linux_version(2, 6, 36)
++    @unittest.skipIf(True, "Bug: the PermissionError is not raised")
+     def test_prlimit(self):
+         self.assertRaises(TypeError, resource.prlimit)
+         self.assertRaises(ProcessLookupError, resource.prlimit,
+diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
+index bf60f37934..5e3a96380a 100644
+--- a/Lib/test/test_shutil.py
++++ b/Lib/test/test_shutil.py
+@@ -1743,6 +1743,7 @@ def test_make_archive(self):
+         base_name = os.path.join(tmpdir, 'archive')
+         self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+ 
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
+     def test_make_archive_owner_group(self):
+         # testing make_archive with owner and group, with various combinations
+@@ -1771,6 +1772,7 @@ def test_make_archive_owner_group(self):
+         self.assertTrue(os.path.isfile(res))
+ 
+ 
++    @unittest.skipIf(True, "The Guix build container has no root user")
+     @support.requires_zlib()
+     @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+     def test_tarfile_root_owner(self):
+diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
+index 637a0ca3b3..2fb804e340 100644
+--- a/Lib/test/test_signal.py
++++ b/Lib/test/test_signal.py
+@@ -160,6 +160,7 @@ def test_valid_signals(self):
+                 self.assertLess(signum, signal.NSIG)
+ 
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @support.requires_subprocess()
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers exit via SIGINT."""
+@@ -211,6 +212,7 @@ def test_issue9324(self):
+             signal.signal(7, handler)
+ 
+     @unittest.skipUnless(sys.executable, "sys.executable required.")
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @support.requires_subprocess()
+     def test_keyboard_interrupt_exit_code(self):
+         """KeyboardInterrupt triggers an exit using STATUS_CONTROL_C_EXIT."""
+@@ -1407,6 +1409,7 @@ def cycle_handlers():
+ 
+ class RaiseSignalTest(unittest.TestCase):
+ 
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     def test_sigint(self):
+         with self.assertRaises(KeyboardInterrupt):
+             signal.raise_signal(signal.SIGINT)
+@@ -1452,6 +1455,7 @@ def __del__(self):
+ 
+ class PidfdSignalTest(unittest.TestCase):
+ 
++    @unittest.skipUnless(sys.stdin.isatty(), "KeyboardInterrupts require a TTY device")
+     @unittest.skipUnless(
+         hasattr(signal, "pidfd_send_signal"),
+         "pidfd support not built in",
+diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
+index 4eb5af99d6..9c7b8f6dbc 100644
+--- a/Lib/test/test_socket.py
++++ b/Lib/test/test_socket.py
+@@ -1016,6 +1016,8 @@ def testHostnameRes(self):
+         if not fqhn in all_host_names:
+             self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))
+ 
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_host_resolution(self):
+         for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']:
+             self.assertEqual(socket.gethostbyname(addr), addr)
+@@ -1161,6 +1163,8 @@ def testNtoHErrors(self):
+             self.assertRaises(OverflowError, socket.ntohl, k)
+             self.assertRaises(OverflowError, socket.htonl, k)
+ 
++    @unittest.skipUnless(os.path.exists("/etc/services"),
++                         "getservbyname uses /etc/services, which is not in the chroot")
+     def testGetServBy(self):
+         eq = self.assertEqual
+         # Find one service that exists, then check all the related interfaces.
+@@ -1521,6 +1525,8 @@ def test_sio_loopback_fast_path(self):
+             raise
+         self.assertRaises(TypeError, s.ioctl, socket.SIO_LOOPBACK_FAST_PATH, None)
+ 
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     def testGetaddrinfo(self):
+         try:
+             socket.getaddrinfo('localhost', 80)
+@@ -1653,6 +1659,8 @@ def test_getnameinfo(self):
+         # only IP addresses are allowed
+         self.assertRaises(OSError, socket.getnameinfo, ('mail.python.org',0), 0)
+ 
++    @unittest.skipUnless(os.path.exists("/etc/gai.conf"),
++                         "getaddrinfo() will fail")
+     @unittest.skipUnless(support.is_resource_enabled('network'),
+                          'network is not enabled')
+     def test_idna(self):
+diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py
+index 50766c2548..0c7eb7a83a 100644
+--- a/Lib/test/test_spwd.py
++++ b/Lib/test/test_spwd.py
+@@ -9,8 +9,7 @@
+     spwd = import_helper.import_module('spwd')
+ 
+ 
+-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0,
+-                     'root privileges required')
++@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
+ class TestSpwdRoot(unittest.TestCase):
+ 
+     def test_getspall(self):
+@@ -60,8 +59,7 @@ def test_getspnam(self):
+             self.assertRaises(TypeError, spwd.getspnam, bytes_name)
+ 
+ 
+-@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() != 0,
+-                     'non-root user required')
++@unittest.skipUnless(os.path.exists("/etc/shadow"), 'spwd tests require /etc/shadow')
+ class TestSpwdNonRoot(unittest.TestCase):
+ 
+     def test_getspnam_exception(self):
+diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
+index 71489ea493..33351919fe 100644
+--- a/Lib/test/test_tarfile.py
++++ b/Lib/test/test_tarfile.py
+@@ -2911,9 +2911,12 @@ def root_is_uid_gid_0():
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+ 
+diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
+index 00d9e591c7..2515603715 100644
+--- a/Lib/test/test_threading.py
++++ b/Lib/test/test_threading.py
+@@ -1962,6 +1962,7 @@ def check_interrupt_main_noerror(self, signum):
+             # Restore original handler
+             signal.signal(signum, handler)
+ 
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_subthread(self):
+         # Calling start_new_thread with a function that executes interrupt_main
+         # should raise KeyboardInterrupt upon completion.
+@@ -1973,6 +1974,8 @@ def call_interrupt():
+             t.join()
+         t.join()
+ 
++
++    @unittest.skipIf(True, 'Keyboard interrupts do not work in the Guix build container.')
+     def test_interrupt_main_mainthread(self):
+         # Make sure that if interrupt_main is called in main thread that
+         # KeyboardInterrupt is raised instantly.
+diff --git a/Lib/test/test_tools/test_freeze.py b/Lib/test/test_tools/test_freeze.py
+index 0e7ed67de7..6539a2983b 100644
+--- a/Lib/test/test_tools/test_freeze.py
++++ b/Lib/test/test_tools/test_freeze.py
+@@ -23,6 +23,7 @@
+                  'test is too slow with PGO')
+ class TestFreeze(unittest.TestCase):
+ 
++    @unittest.skipIf(True, 'Fails on Guix.')
+     @support.requires_resource('cpu') # Building Python is slow
+     def test_freeze_simple_script(self):
+         script = textwrap.dedent("""
+diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
+index 515c3840cb..a96dfad0fe 100644
+--- a/Lib/test/test_unicodedata.py
++++ b/Lib/test/test_unicodedata.py
+@@ -342,6 +342,7 @@ def test_linebreak_7643(self):
+                 self.assertEqual(len(lines), 1,
+                                  r"\u%.4x should not be a linebreak" % i)
+ 
++@requires_resource('network')
+ class NormalizationTest(unittest.TestCase):
+     @staticmethod
+     def check_version(testfile):
+diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py
+index 445a34ae3e..8f750537c3 100644
+--- a/Tools/scripts/run_tests.py
++++ b/Tools/scripts/run_tests.py
+@@ -69,7 +69,7 @@ def main(regrtest_args):
+         else:
+             args.extend(['-j', '0'])  # Use all CPU cores
+     if not any(is_resource_use_flag(arg) for arg in regrtest_args):
+-        args.extend(['-u', 'all,-largefile,-audio,-gui'])
++        args.extend(['-u', 'all,-largefile,-audio,-gui,-network'])
+ 
+     if cross_compile and hostrunner:
+         # If HOSTRUNNER is set and -p/--python option is not given, then
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 51d5f598d7..471cf190fb 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -55,7 +55,7 @@
 ;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
 ;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
-;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
+;;; Copyright © 2019, 2024 Tanguy Le Carrour <tanguy@bioneland.org>
 ;;; Copyright © 2020, 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
@@ -596,6 +596,382 @@ (define-public python-3.10
             (variable "PYTHONTZPATH")
             (files (list "share/zoneinfo")))))))
 
+(define-public python-3.12
+  (package
+    (name "python")
+    (version "3.12.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.python.org/ftp/python/" version
+                           "/Python-" version ".tar.xz"))
+       (sha256
+        (base32 "0w6qyfhc912xxav9x9pifwca40b4l49vy52wai9j0gc1mhni2a5y"))
+       (patches (search-patches "python-3-deterministic-build-info.patch"
+                                "python-3.12-fix-tests.patch"
+                                "python-3-hurd-configure.patch"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   ;; Delete the bundled copy of libexpat.
+                   (delete-file-recursively "Modules/expat")
+                   (substitute* "Modules/Setup"
+                     ;; Link Expat instead of embedding the bundled one.
+                     (("^#pyexpat.*")
+                      "pyexpat pyexpat.c -lexpat\n"))
+                   ;; Delete windows binaries
+                   (for-each delete-file
+                             (find-files "Lib/distutils/command" "\\.exe$"))))))
+    (outputs '("out" "tk" ;tkinter; adds 50 MiB to the closure
+               "idle")) ;programming environment; weighs 5MB
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "test"
+       #:configure-flags (list "--enable-shared" ;allow embedding
+                               "--with-system-expat" ;for XML support
+                               "--with-system-ffi" ;build ctypes
+                               "--with-ensurepip=install" ;install pip and setuptools
+                               "--with-computed-gotos" ;main interpreter loop optimization
+                               "--enable-unicode=ucs4"
+                               "--without-static-libpython"
+
+                               ;; FIXME: These flags makes Python significantly faster, but
+                               ;; leads to non-reproducible binaries.
+                               ;; "--with-lto"               ;increase size by 20MB, but 15% speedup
+                               ;; "--enable-optimizations"
+                               
+                               ;; Prevent the installed _sysconfigdata.py from retaining a reference
+                               ;; to coreutils.
+                               "INSTALL=install -c"
+                               "MKDIR_P=mkdir -p"
+
+                               ;; Disable runtime check failing if cross-compiling, see:
+                               ;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
+                               ,@(if (%current-target-system)
+                                     '("ac_cv_buggy_getaddrinfo=no"
+                                       "ac_cv_file__dev_ptmx=no"
+                                       "ac_cv_file__dev_ptc=no")
+                                     '())
+                               ;; -fno-semantic-interposition reinstates some optimizations by gcc
+                               ;; leading to around 15% speedup. This is the default starting from
+                               ;; python 3.10.
+                               "CFLAGS=-fno-semantic-interposition"
+                               (string-append "LDFLAGS=-Wl,-rpath="
+                                              (assoc-ref %outputs "out")
+                                              "/lib"
+                                              " -fno-semantic-interposition"))
+       ;; With no -j argument tests use all available cpus, so provide one.
+       #:make-flags (list (string-append (format #f "TESTOPTS=-j~d"
+                                                 (parallel-job-count))
+                           ;; those tests fail on low-memory systems
+                           " --exclude test_mmap test_socket test_threading test_asyncio"
+                           ,@(if (system-hurd?)
+                                 '(" test_posix" ;multiple errors
+                                   " test_time"
+                                   " test_pty"
+                                   " test_shutil"
+                                   " test_tempfile" ;chflags: invalid argument:
+                                   ;; tbv14c9t/dir0/dir0/dir0/test0.txt
+                                   " test_os" ;stty: 'standard input':
+                                   ;; Inappropriate ioctl for device
+                                   " test_openpty" ;No such file or directory
+                                   " test_selectors" ;assertEqual(NUM_FDS // 2, len(fds))
+                                   ;; 32752 != 4
+                                   " test_compileall" ;multiple errors
+                                   " test_poll" ;list index out of range
+                                   " test_subprocess" ;runs over 10min
+                                   " test_asyncore" ;multiple errors
+                                   " test_threadsignals"
+                                   " test_eintr" ;Process return code is -14
+                                   " test_io" ;multiple errors
+                                   " test_logging"
+                                   " test_signal"
+                                   " test_flags" ;ERROR
+                                   " test_bidirectional_pty"
+                                   " test_create_unix_connection"
+                                   " test_unix_sock_client_ops"
+                                   " test_open_unix_connection"
+                                   " test_open_unix_connection_error"
+                                   " test_read_pty_output"
+                                   " test_write_pty"
+                                   " test_concurrent_futures" ;freeze
+                                   " test_venv" ;freeze
+                                   " test_multiprocessing_forkserver" ;runs over 10min
+                                   " test_multiprocessing_spawn" ;runs over 10min
+                                   " test_builtin"
+                                   " test_capi"
+                                   " test_dbm_ndbm"
+                                   " test_exceptions"
+                                   " test_faulthandler"
+                                   " test_getopt"
+                                   " test_importlib"
+                                   " test_json"
+                                   " test_multiprocessing_fork"
+                                   " test_multiprocessing_main_handling"
+                                   " test_pdb "
+                                   " test_regrtest"
+                                   " test_sqlite")
+                                 '())))
+
+       #:modules ((ice-9 ftw)
+                  (ice-9 match)
+                  (guix build utils)
+                  (guix build gnu-build-system))
+
+       #:phases (modify-phases %standard-phases
+                  ,@(if (system-hurd?)
+                        `((add-after 'unpack
+                                     'disable-multi-processing
+                                     (lambda _
+                                       (substitute* "Makefile.pre.in"
+                                         (("-j0")
+                                          "-j1")))))
+                        '())
+                  (add-before 'configure 'patch-lib-shells
+                    (lambda _
+                      ;; This variable is used in setup.py to enable cross compilation
+                      ;; specific switches. As it is not set properly by configure
+                      ;; script, set it manually.
+                      ,@(if (%current-target-system)
+                            '((setenv "_PYTHON_HOST_PLATFORM" ""))
+                            '())
+                      ;; Filter for existing files, since some may not exist in all
+                      ;; versions of python that are built with this recipe.
+                      (substitute* (filter file-exists?
+                                           '("Lib/subprocess.py"
+                                             "Lib/popen2.py"
+                                             "Lib/distutils/tests/test_spawn.py"
+                                             "Lib/test/support/__init__.py"
+                                             "Lib/test/test_subprocess.py"))
+                        (("/bin/sh")
+                         (which "sh")))))
+                  (add-before 'configure 'do-not-record-configure-flags
+                    (lambda* (#:key configure-flags #:allow-other-keys)
+                      ;; Remove configure flags from the installed '_sysconfigdata.py'
+                      ;; and 'Makefile' so we don't end up keeping references to the
+                      ;; build tools.
+                      ;;
+                      ;; Preserve at least '--with-system-ffi' since otherwise the
+                      ;; thing tries to build libffi, fails, and we end up with a
+                      ;; Python that lacks ctypes.
+                      (substitute* "configure"
+                        (("^CONFIG_ARGS=.*$")
+                         (format #f "CONFIG_ARGS='~a'\n"
+                                 (if (member "--with-system-ffi"
+                                             configure-flags)
+                                     "--with-system-ffi" ""))))))
+                  (add-before 'check 'pre-check
+                    (lambda _
+                      ;; 'Lib/test/test_site.py' needs a valid $HOME
+                      (setenv "HOME"
+                              (getcwd))))
+                  (add-after 'unpack 'set-source-file-times-to-1980
+                    ;; XXX One of the tests uses a ZIP library to pack up some of the
+                    ;; source tree, and fails with "ZIP does not support timestamps
+                    ;; before 1980".  Work around this by setting the file times in the
+                    ;; source tree to sometime in early 1980.
+                    (lambda _
+                      (let ((circa-1980 (* 10 366 24 60 60)))
+                        (ftw "."
+                             (lambda (file stat flag)
+                               (utime file circa-1980 circa-1980) #t)))))
+                  (add-after 'unpack 'remove-windows-binaries
+                    (lambda _
+                      ;; Delete .exe from embedded .whl (zip) files
+                      (for-each (lambda (whl)
+                                  (let ((dir "whl-content")
+                                        (circa-1980 (* 10 366 24 60 60)))
+                                    (mkdir-p dir)
+                                    (with-directory-excursion dir
+                                      (let ((whl (string-append "../" whl)))
+                                        (invoke "unzip" whl)
+                                        (for-each delete-file
+                                                  (find-files "." "\\.exe$"))
+                                        (delete-file whl)
+                                        ;; Reset timestamps to prevent them from ending
+                                        ;; up in the Zip archive.
+                                        (ftw "."
+                                             (lambda (file stat flag)
+                                               (utime file circa-1980
+                                                      circa-1980) #t))
+                                        (apply invoke "zip" "-X" whl
+                                               (find-files "."
+                                                           #:directories? #t))))
+                                    (delete-file-recursively dir)))
+                                (find-files "Lib/ensurepip" "\\.whl$"))))
+                  (add-after 'install 'remove-tests
+                    ;; Remove 25 MiB of unneeded unit tests.  Keep test_support.*
+                    ;; because these files are used by some libraries out there.
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (match (scandir (string-append out "/lib")
+                                        (lambda (name)
+                                          (string-prefix? "python" name)))
+                          ((pythonX.Y)
+                           (let ((testdir (string-append out "/lib/" pythonX.Y
+                                                         "/test")))
+                             (with-directory-excursion testdir
+                               (for-each delete-file-recursively
+                                         (scandir testdir
+                                                  (match-lambda
+                                                    ((or "." "..")
+                                                     #f)
+                                                    ("support" #f)
+                                                    (file (not (string-prefix?
+                                                                "test_support."
+                                                                file))))))
+                               (call-with-output-file "__init__.py"
+                                 (const #t))))
+                           (let ((libdir (string-append out "/lib/" pythonX.Y)))
+                             (for-each (lambda (directory)
+                                         (let ((dir (string-append libdir "/"
+                                                                   directory)))
+                                           (when (file-exists? dir)
+                                             (delete-file-recursively dir))))
+                                       '("email/test" "ctypes/test"
+                                         "unittest/test"
+                                         "tkinter/test"
+                                         "sqlite3/test"
+                                         "bsddb/test"
+                                         "lib-tk/test"
+                                         "json/tests"
+                                         "distutils/tests"))))))))
+                  (add-after 'remove-tests 'move-tk-inter
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; When Tkinter support is built move it to a separate output so
+                      ;; that the main output doesn't contain a reference to Tcl/Tk.
+                      (let ((out (assoc-ref outputs "out"))
+                            (tk (assoc-ref outputs "tk")))
+                        (when tk
+                          (match (find-files out "tkinter.*\\.so")
+                            ((tkinter.so)
+                             ;; The .so is in OUT/lib/pythonX.Y/lib-dynload, but we
+                             ;; want it under TK/lib/pythonX.Y/site-packages.
+                             (let* ((len (string-length out))
+                                    (target (string-append tk "/"
+                                                           (string-drop (dirname
+                                                                         (dirname
+                                                                          tkinter.so))
+                                                                        len)
+                                                           "/site-packages")))
+                               (install-file tkinter.so target)
+                               (delete-file tkinter.so))))))))
+                  (add-after 'move-tk-inter 'move-idle
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      ;; when idle is built, move it to a separate output to save some
+                      ;; space (5MB)
+                      (let ((out (assoc-ref outputs "out"))
+                            (idle (assoc-ref outputs "idle")))
+                        (when idle
+                          (for-each (lambda (file)
+                                      (let ((target (string-append idle
+                                                                   "/bin/"
+                                                                   (basename
+                                                                    file))))
+                                        (install-file file
+                                                      (dirname target))
+                                        (delete-file file)))
+                                    (find-files (string-append out "/bin")
+                                                "^idle"))
+                          (match (find-files out "^idlelib$"
+                                             #:directories? #t)
+                            ((idlelib)
+                             (let* ((len (string-length out))
+                                    (target (string-append idle "/"
+                                                           (string-drop
+                                                            idlelib len)
+                                                           "/site-packages")))
+                               (mkdir-p (dirname target))
+                               (rename-file idlelib target))))))))
+                  (add-after 'move-idle 'rebuild-bytecode
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        ;; Disable hash randomization to ensure the generated .pycs
+                        ;; are reproducible.
+                        (setenv "PYTHONHASHSEED" "0")
+
+                        (for-each (lambda (output)
+                                    ;; XXX: Delete existing pycs generated by the build
+                                    ;; system beforehand because the -f argument does
+                                    ;; not necessarily overwrite all files, leading to
+                                    ;; indeterministic results.
+                                    (for-each (lambda (pyc)
+                                                (delete-file pyc))
+                                              (find-files output "\\.pyc$"))
+
+                                    (apply invoke
+                                           `(,,(if (%current-target-system)
+                                                   "python3"
+                                                   '(string-append out
+                                                     "/bin/python3")) "-m"
+                                             "compileall"
+                                             "-o"
+                                             "0"
+                                             "-o"
+                                             "1"
+                                             "-o"
+                                             "2"
+                                             "-f" ;force rebuild
+                                             "--invalidation-mode=unchecked-hash"
+                                             ;; Don't build lib2to3, because it's
+                                             ;; Python 2 code.
+                                             "-x"
+                                             "lib2to3/.*"
+                                             ,output)))
+                                  (map cdr outputs)))))
+                  (add-before 'check 'set-TZDIR
+                    (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                      ;; test_email requires the Olson time zone database.
+                      (setenv "TZDIR"
+                              (string-append (assoc-ref (or native-inputs
+                                                            inputs) "tzdata")
+                                             "/share/zoneinfo"))))
+                  (add-after 'install 'install-sitecustomize.py
+                    ,(customize-site version)))))
+    (inputs (list bzip2
+                  expat
+                  gdbm
+                  libffi ;for ctypes
+                  sqlite ;for sqlite extension
+                  openssl
+                  readline
+                  zlib
+                  tcl
+                  tk)) ;for tkinter
+    (native-inputs `(("tzdata" ,tzdata-for-tests)
+                     ("unzip" ,unzip)
+                     ("zip" ,(@ (gnu packages compression) zip))
+                     ("pkg-config" ,pkg-config)
+                     ("sitecustomize.py" ,(local-file (search-auxiliary-file
+                                                       "python/sitecustomize.py")))
+                     ;; When cross-compiling, a native version of Python itself is needed.
+                     ,@(if (%current-target-system)
+                           `(("python" ,this-package)
+                             ("which" ,which))
+                           '())))
+    (native-search-paths
+     (list (guix-pythonpath-search-path version)
+           ;; Used to locate tzdata by the zoneinfo module introduced in
+           ;; Python 3.9.
+           (search-path-specification
+            (variable "PYTHONTZPATH")
+            (files (list "share/zoneinfo")))))
+    (home-page "https://www.python.org")
+    (synopsis "High-level, dynamically-typed programming language")
+    (description
+     "Python is a remarkably powerful dynamic programming language that
+is used in a wide variety of application domains.  Some of its key
+distinguishing features include: clear, readable syntax; strong
+introspection capabilities; intuitive object orientation; natural
+expression of procedural code; full modularity, supporting hierarchical
+packages; exception-based error handling; and very high level dynamic
+data types.")
+    (properties '((cpe-name . "python")))
+    (license license:psfl)))
+
+
+;; Next 3.x version.
+(define-public python-next python-3.12)
+
 ;; Current 3.x version.
 (define-public python-3 python-3.10)
 

base-commit: 6831dfc58bf14341176f7358941ed685f34fb4c3
-- 
2.41.0





^ permalink raw reply related	[relevance 34%]

* [bug#69295] [PATCH 08/46] gnu: python-aioftp: Update to 0.22.3.
    2024-02-20 23:43 65% ` [bug#69295] [PATCH 05/46] gnu: parfive: Update to 2.0.2 Sharlatan Hellseher
  2024-02-20 23:43 64% ` [bug#69295] [PATCH 06/46] gnu: parfive: Simplify package Sharlatan Hellseher
@ 2024-02-20 23:43 65% ` Sharlatan Hellseher
  2024-02-20 23:43 65% ` [bug#69295] [PATCH 18/46] gnu: python-h5netcdf: Update to 1.3.0 Sharlatan Hellseher
  3 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-20 23:43 UTC (permalink / raw)
  To: 69295
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm (python-aioftp): Update to 0.22.3.
[build-system]: Swap to pyproject-build-system, there is no setup.py in
new release.
[arguments] <#:phases>: Use standard 'check phase.

Change-Id: I8e6a145da86e5ed56eb184d98d54bc8093a3bd1f
---
 gnu/packages/python-web.scm | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index de57d5be94..cde4ac4f58 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -3546,20 +3546,14 @@ (define-public python-requests-ftp
 (define-public python-aioftp
   (package
     (name "python-aioftp")
-    (version "0.21.4")
+    (version "0.22.3")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "aioftp" version))
               (sha256
                (base32
-                "1f8vql2j2b3ykqyh5bxzsp8x5f2if2c1ya232ld3hz3cc7a2dfr8"))))
-    (build-system python-build-system)
-    (arguments
-     (list #:phases #~(modify-phases %standard-phases
-                        (replace 'check
-                          (lambda* (#:key tests? #:allow-other-keys)
-                            (when tests?
-                              (invoke "pytest" "-vvv")))))))
+                "0w621mg956m9rn7v39jpwi4gpnpl90pprwl29cp640dahqqv38ms"))))
+    (build-system pyproject-build-system)
     (native-inputs (list python-async-timeout python-pytest
                          python-pytest-asyncio python-pytest-cov
                          python-trustme))
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69295] [PATCH 18/46] gnu: python-h5netcdf: Update to 1.3.0.
                     ` (2 preceding siblings ...)
  2024-02-20 23:43 65% ` [bug#69295] [PATCH 08/46] gnu: python-aioftp: Update to 0.22.3 Sharlatan Hellseher
@ 2024-02-20 23:43 65% ` Sharlatan Hellseher
  3 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-20 23:43 UTC (permalink / raw)
  To: 69295
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-h5netcdf): Update to 1.3.0.

Change-Id: I6652b0d7d185b4475fb574b236534bba38a2cf07
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c3dfb9603c..2a773a3bf9 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -2558,13 +2558,13 @@ (define-public python-hdf4
 (define-public python-h5netcdf
   (package
     (name "python-h5netcdf")
-    (version "1.1.0")
+    (version "1.3.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "h5netcdf" version))
        (sha256
-        (base32 "0mmzfr6k55zqxxpb64gvdqisak8s1zb2r04yzkmp0wzd7dbknb4k"))))
+        (base32 "1kw3cf01kziwxmb84x0cy6vbpsmqjm0k1dm34i6b4d7bv8kw0wd1"))))
     (build-system pyproject-build-system)
     (native-inputs
      (list python-netcdf4
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69295] [PATCH 06/46] gnu: parfive: Simplify package.
    2024-02-20 23:43 65% ` [bug#69295] [PATCH 05/46] gnu: parfive: Update to 2.0.2 Sharlatan Hellseher
@ 2024-02-20 23:43 64% ` Sharlatan Hellseher
  2024-02-20 23:43 65% ` [bug#69295] [PATCH 08/46] gnu: python-aioftp: Update to 0.22.3 Sharlatan Hellseher
  2024-02-20 23:43 65% ` [bug#69295] [PATCH 18/46] gnu: python-h5netcdf: Update to 1.3.0 Sharlatan Hellseher
  3 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-20 23:43 UTC (permalink / raw)
  To: 69295
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm (parfive) [build-system]: Swap to
pyproject-build-system.
[arguments] <#:phases>: Use standard 'check phase. <#:test-flags>: Move
disabled tests here and remove 'disable-test-requiring-network phase.

Change-Id: I08b67b2aa7027ac37e0a3df4da7ebb01ea3c451e
---
 gnu/packages/python-web.scm | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index adae8d7272..de57d5be94 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -1326,18 +1326,15 @@ (define-public parfive
               (sha256
                (base32
                 "0pf8rzfwxpkn84xzb4v8m1fy3k7kjlh8f9ln4y5xqlnbqpwi30lh"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (arguments
-     (list #:phases #~(modify-phases %standard-phases
-                        (add-before 'check 'disable-test-requiring-network
-                          (lambda _
-                            (substitute* "parfive/tests/test_downloader.py"
-                              (("def test_ftp")
-                               "def __off_test_ftp"))))
-                        (replace 'check
-                          (lambda* (#:key tests? #:allow-other-keys)
-                            (when tests?
-                              (invoke "python" "-m" "pytest" "-vvv" "parfive")))))))
+     (list
+      ;; Disable tests requiring network access.
+      #:test-flags
+      #~(list "-k" (string-append
+                    "not test_ftp"
+                    " and not test_ftp_pasv_command"
+                    " and not test_ftp_http"))))
     (propagated-inputs (list python-aiofiles python-aioftp python-aiohttp
                              python-tqdm))
     (native-inputs (list python-pytest
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#69295] [PATCH 05/46] gnu: parfive: Update to 2.0.2.
  @ 2024-02-20 23:43 65% ` Sharlatan Hellseher
  2024-02-20 23:43 64% ` [bug#69295] [PATCH 06/46] gnu: parfive: Simplify package Sharlatan Hellseher
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-20 23:43 UTC (permalink / raw)
  To: 69295
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-web.scm (parfive): Update to 2.0.2.

Change-Id: I3890cbae4d706c5f3391809fc6b4ce36140f059d
---
 gnu/packages/python-web.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 5a6f401f89..adae8d7272 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -1319,13 +1319,13 @@ (define-public httpie
 (define-public parfive
   (package
     (name "parfive")
-    (version "2.0.1")
+    (version "2.0.2")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "parfive" version))
               (sha256
                (base32
-                "19dcbb6g56l5s3ih0bhs3p4acgc0gf4zdzpj4w87m69li2nhmgpx"))))
+                "0pf8rzfwxpkn84xzb4v8m1fy3k7kjlh8f9ln4y5xqlnbqpwi30lh"))))
     (build-system python-build-system)
     (arguments
      (list #:phases #~(modify-phases %standard-phases
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69268] [PATCH 1/2] gnu: Add python-monthdelta.
  @ 2024-02-19  9:53 65% ` Wilko Meyer
  2024-02-19  9:53 64% ` [bug#69268] [PATCH 2/2] gnu: Add python-heatwave Wilko Meyer
  1 sibling, 0 replies; 200+ results
From: Wilko Meyer @ 2024-02-19  9:53 UTC (permalink / raw)
  To: 69268
  Cc: Wilko Meyer, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-monthdelta): New variable.

Change-Id: I0e651f41252ec50cd2d7063e37d428265b17d8c2
---
 gnu/packages/python-xyz.scm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c3dfb9603c..c8fc5e1f7c 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -17727,6 +17727,23 @@ (define-public python-colorama-for-awscli
        (sha256
         (base32 "189n8hpijy14jfan4ha9f5n06mnl33cxz7ay92wjqgkr639s0vg9"))))))
 
+(define-public python-monthdelta
+  (package
+    (name "python-monthdelta")
+    (version "0.9.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "MonthDelta" version))
+       (sha256
+        (base32 "0iwcsk7ryjw5h1wp10ykwd01f3am8gdlga6461q1v1njsk0rxh41"))))
+    (build-system pyproject-build-system)
+    (home-page "http://packages.python.org/MonthDelta")
+    (synopsis "Date computations with months")
+    (description "MonthDelta provides functionality to do date computations
+with months.")
+    (license license:expat)))
+
 (define-public python-moto
   (package
     (name "python-moto")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#69268] [PATCH 2/2] gnu: Add python-heatwave.
    2024-02-19  9:53 65% ` [bug#69268] [PATCH 1/2] gnu: Add python-monthdelta Wilko Meyer
@ 2024-02-19  9:53 64% ` Wilko Meyer
  1 sibling, 0 replies; 200+ results
From: Wilko Meyer @ 2024-02-19  9:53 UTC (permalink / raw)
  To: 69268
  Cc: Wilko Meyer, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-heatwave): New variable.
* gnu/packages/python-xyz.scm: Add my copyright header.

Change-Id: I640aecb3a0d9c454333a3913c039c637d24d9f79
---
 gnu/packages/python-xyz.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c8fc5e1f7c..e318438c94 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -147,6 +147,7 @@
 ;;; Copyright © 2023 Attila Lendvai <attila@lendvai.name>
 ;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
 ;;; Copyright © 2024 Timothee Mathieu <timothee.mathieu@inria.fr>
+;;; Copyright © 2024 Wilko Meyer <w@wmeyer.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31533,6 +31534,24 @@ (define-public python-roundrobin
 distribution in Python.")
     (license license:expat)))
 
+(define-public python-heatwave
+  (package
+    (name "python-heatwave")
+    (version "1.2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "heatwave" version))
+       (sha256
+        (base32 "1zzwmb9hvbyswzjgap02rrq8p44hb6xlzk1wd8w01mh2vva0xlx7"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-click python-gitpython python-monthdelta))
+    (home-page "https://github.com/james-stoup/heatwave")
+    (synopsis "A way of visualizing a heat map of a git repo")
+    (description
+     "This package provides a way of visualizing a heat map of a git repo.")
+    (license license:gpl3)))
+
 (define-public python-helpdev
   (package
     (name "python-helpdev")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#67120] [PATCH v5 1/5] gnu: Add python-mpv-jsonipc.
  @ 2024-02-17 19:02 65% ` Ian Eure
  2024-02-17 19:02 65% ` [bug#67120] [PATCH v5 2/5] gnu: Add python-jellyfin-apiclient Ian Eure
  2024-02-17 19:02 64% ` [bug#67120] [PATCH v5 3/5] gnu: Add python-pystray Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 19:02 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-mpv-jsonipc): New variable.

Change-Id: Iec7679213d9b9e8e5cbf01a30838e27e71704e54
---
 gnu/packages/python-xyz.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2dd8a12af5..ed80ee1d5e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25808,6 +25808,22 @@ (define-public online-judge-tools
 submitting it.")
     (license license:expat)))
 
+(define-public python-mpv-jsonipc
+  (package
+    (name "python-mpv-jsonipc")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-mpv-jsonipc" version))
+       (sha256
+        (base32 "0ymdwrx544a6gn6wm9dixpgzbfrbpxvcj5ys7m41cgb4lvpvx691"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/iwalton3/python-mpv-jsonipc")
+    (synopsis "Python API to MPV using JSON IPC")
+    (description "Python API to MPV using JSON IPC")
+    (license license:asl2.0)))
+
 (define-public python-parso
   (package
     (name "python-parso")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#67120] [PATCH v5 2/5] gnu: Add python-jellyfin-apiclient.
    2024-02-17 19:02 65% ` [bug#67120] [PATCH v5 1/5] gnu: Add python-mpv-jsonipc Ian Eure
@ 2024-02-17 19:02 65% ` Ian Eure
  2024-02-17 19:02 64% ` [bug#67120] [PATCH v5 3/5] gnu: Add python-pystray Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 19:02 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-jellyfin-apiclient): New variable.

Change-Id: If84546b14d380a3a10af63d4f41711125298487a
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ed80ee1d5e..ba01a008bf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25824,6 +25824,24 @@ (define-public python-mpv-jsonipc
     (description "Python API to MPV using JSON IPC")
     (license license:asl2.0)))
 
+(define-public python-jellyfin-apiclient
+  (package
+    (name "python-jellyfin-apiclient")
+    (version "1.9.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "jellyfin-apiclient-python" version))
+       (sha256
+        (base32 "0r67cp9nizvn3cbslgi30zpd3mw4a6zal0ygik3jv5lni1xdkk5w"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-certifi python-requests python-urllib3
+                             python-websocket-client))
+    (home-page "https://github.com/jellyfin/jellyfin-apiclient-python")
+    (synopsis "Python API client for Jellyfin")
+    (description "Python API client for Jellyfin")
+    (license license:gpl3)))
+
 (define-public python-parso
   (package
     (name "python-parso")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#67120] [PATCH v5 3/5] gnu: Add python-pystray.
    2024-02-17 19:02 65% ` [bug#67120] [PATCH v5 1/5] gnu: Add python-mpv-jsonipc Ian Eure
  2024-02-17 19:02 65% ` [bug#67120] [PATCH v5 2/5] gnu: Add python-jellyfin-apiclient Ian Eure
@ 2024-02-17 19:02 64% ` Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 19:02 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-pystray): New variable.

Change-Id: If10777c9ec91b549b9937b4825565223786a75cb
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ba01a008bf..05c29049b8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31694,6 +31694,32 @@ (define-public python-qdarkstyle
 Qt applications.")
     (license license:expat)))
 
+(define-public python-pystray
+  (package
+    (name "python-pystray")
+    (version "0.19.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/moses-palmer/pystray")
+             (commit "1907f8681d6d421517c63d94f425f9cdd74d0034")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vj6c8s7rbc7xc4bi5brx5629ls1ri9prcw9290v85hagilmp609"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'check)
+                   (delete 'sanity-check))))
+    (native-inputs (list python-sphinx xorg-server-for-tests))
+    (propagated-inputs (list python-pillow python-six python-xlib))
+    (home-page "https://github.com/moses-palmer/pystray")
+    (synopsis "Create a system tray icon")
+    (description "This library allows you to create a system tray icon.")
+    (license license:lgpl3)))
+
 (define-public python-bitstring
   (package
     (name "python-bitstring")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#67120] [PATCH v4 2/4] gnu: Add python-jellyfin-apiclient.
    2024-02-17 17:49 65% ` [bug#67120] [PATCH v4 1/4] gnu: Add python-mpv-jsonipc Ian Eure
@ 2024-02-17 17:49 65% ` Ian Eure
  2024-02-17 17:49 64% ` [bug#67120] [PATCH v4 3/4] gnu: Add python-pystray Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 17:49 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-jellyfin-apiclient): New variable.

Change-Id: If84546b14d380a3a10af63d4f41711125298487a
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ed80ee1d5e..ba01a008bf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25824,6 +25824,24 @@ (define-public python-mpv-jsonipc
     (description "Python API to MPV using JSON IPC")
     (license license:asl2.0)))
 
+(define-public python-jellyfin-apiclient
+  (package
+    (name "python-jellyfin-apiclient")
+    (version "1.9.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "jellyfin-apiclient-python" version))
+       (sha256
+        (base32 "0r67cp9nizvn3cbslgi30zpd3mw4a6zal0ygik3jv5lni1xdkk5w"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-certifi python-requests python-urllib3
+                             python-websocket-client))
+    (home-page "https://github.com/jellyfin/jellyfin-apiclient-python")
+    (synopsis "Python API client for Jellyfin")
+    (description "Python API client for Jellyfin")
+    (license license:gpl3)))
+
 (define-public python-parso
   (package
     (name "python-parso")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#67120] [PATCH v4 3/4] gnu: Add python-pystray.
    2024-02-17 17:49 65% ` [bug#67120] [PATCH v4 1/4] gnu: Add python-mpv-jsonipc Ian Eure
  2024-02-17 17:49 65% ` [bug#67120] [PATCH v4 2/4] gnu: Add python-jellyfin-apiclient Ian Eure
@ 2024-02-17 17:49 64% ` Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 17:49 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-pystray): New variable.

Change-Id: If10777c9ec91b549b9937b4825565223786a75cb
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ba01a008bf..05c29049b8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31694,6 +31694,32 @@ (define-public python-qdarkstyle
 Qt applications.")
     (license license:expat)))
 
+(define-public python-pystray
+  (package
+    (name "python-pystray")
+    (version "0.19.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/moses-palmer/pystray")
+             (commit "1907f8681d6d421517c63d94f425f9cdd74d0034")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vj6c8s7rbc7xc4bi5brx5629ls1ri9prcw9290v85hagilmp609"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'check)
+                   (delete 'sanity-check))))
+    (native-inputs (list python-sphinx xorg-server-for-tests))
+    (propagated-inputs (list python-pillow python-six python-xlib))
+    (home-page "https://github.com/moses-palmer/pystray")
+    (synopsis "Create a system tray icon")
+    (description "This library allows you to create a system tray icon.")
+    (license license:lgpl3)))
+
 (define-public python-bitstring
   (package
     (name "python-bitstring")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#67120] [PATCH v4 1/4] gnu: Add python-mpv-jsonipc.
  @ 2024-02-17 17:49 65% ` Ian Eure
  2024-02-17 17:49 65% ` [bug#67120] [PATCH v4 2/4] gnu: Add python-jellyfin-apiclient Ian Eure
  2024-02-17 17:49 64% ` [bug#67120] [PATCH v4 3/4] gnu: Add python-pystray Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 17:49 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-mpv-jsonipc): New variable.

Change-Id: Iec7679213d9b9e8e5cbf01a30838e27e71704e54
---
 gnu/packages/python-xyz.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2dd8a12af5..ed80ee1d5e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25808,6 +25808,22 @@ (define-public online-judge-tools
 submitting it.")
     (license license:expat)))
 
+(define-public python-mpv-jsonipc
+  (package
+    (name "python-mpv-jsonipc")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-mpv-jsonipc" version))
+       (sha256
+        (base32 "0ymdwrx544a6gn6wm9dixpgzbfrbpxvcj5ys7m41cgb4lvpvx691"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/iwalton3/python-mpv-jsonipc")
+    (synopsis "Python API to MPV using JSON IPC")
+    (description "Python API to MPV using JSON IPC")
+    (license license:asl2.0)))
+
 (define-public python-parso
   (package
     (name "python-parso")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#67120] [PATCH v3 3/4] gnu: Add python-pystray.
    2024-02-17 17:20 65% ` [bug#67120] [PATCH v3 1/4] gnu: Add python-mpv-jsonipc Ian Eure
  2024-02-17 17:20 65% ` [bug#67120] [PATCH v3 2/4] gnu: Add python-jellyfin-apiclient Ian Eure
@ 2024-02-17 17:20 64% ` Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 17:20 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-pystray): New variable.

Change-Id: If10777c9ec91b549b9937b4825565223786a75cb
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ba01a008bf..05c29049b8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31694,6 +31694,32 @@ (define-public python-qdarkstyle
 Qt applications.")
     (license license:expat)))
 
+(define-public python-pystray
+  (package
+    (name "python-pystray")
+    (version "0.19.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/moses-palmer/pystray")
+             (commit "1907f8681d6d421517c63d94f425f9cdd74d0034")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1vj6c8s7rbc7xc4bi5brx5629ls1ri9prcw9290v85hagilmp609"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'check)
+                   (delete 'sanity-check))))
+    (native-inputs (list python-sphinx xorg-server-for-tests))
+    (propagated-inputs (list python-pillow python-six python-xlib))
+    (home-page "https://github.com/moses-palmer/pystray")
+    (synopsis "Create a system tray icon")
+    (description "This library allows you to create a system tray icon.")
+    (license license:lgpl3)))
+
 (define-public python-bitstring
   (package
     (name "python-bitstring")
-- 
2.41.0





^ permalink raw reply related	[relevance 64%]

* [bug#67120] [PATCH v3 2/4] gnu: Add python-jellyfin-apiclient.
    2024-02-17 17:20 65% ` [bug#67120] [PATCH v3 1/4] gnu: Add python-mpv-jsonipc Ian Eure
@ 2024-02-17 17:20 65% ` Ian Eure
  2024-02-17 17:20 64% ` [bug#67120] [PATCH v3 3/4] gnu: Add python-pystray Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 17:20 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-jellyfin-apiclient): New variable.

Change-Id: If84546b14d380a3a10af63d4f41711125298487a
---
 gnu/packages/python-xyz.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ed80ee1d5e..ba01a008bf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25824,6 +25824,24 @@ (define-public python-mpv-jsonipc
     (description "Python API to MPV using JSON IPC")
     (license license:asl2.0)))
 
+(define-public python-jellyfin-apiclient
+  (package
+    (name "python-jellyfin-apiclient")
+    (version "1.9.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "jellyfin-apiclient-python" version))
+       (sha256
+        (base32 "0r67cp9nizvn3cbslgi30zpd3mw4a6zal0ygik3jv5lni1xdkk5w"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-certifi python-requests python-urllib3
+                             python-websocket-client))
+    (home-page "https://github.com/jellyfin/jellyfin-apiclient-python")
+    (synopsis "Python API client for Jellyfin")
+    (description "Python API client for Jellyfin")
+    (license license:gpl3)))
+
 (define-public python-parso
   (package
     (name "python-parso")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#67120] [PATCH v3 1/4] gnu: Add python-mpv-jsonipc.
  @ 2024-02-17 17:20 65% ` Ian Eure
  2024-02-17 17:20 65% ` [bug#67120] [PATCH v3 2/4] gnu: Add python-jellyfin-apiclient Ian Eure
  2024-02-17 17:20 64% ` [bug#67120] [PATCH v3 3/4] gnu: Add python-pystray Ian Eure
  2 siblings, 0 replies; 200+ results
From: Ian Eure @ 2024-02-17 17:20 UTC (permalink / raw)
  To: 67120
  Cc: Ian Eure, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-mpv-jsonipc): New variable.

Change-Id: Iec7679213d9b9e8e5cbf01a30838e27e71704e54
---
 gnu/packages/python-xyz.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2dd8a12af5..ed80ee1d5e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -25808,6 +25808,22 @@ (define-public online-judge-tools
 submitting it.")
     (license license:expat)))
 
+(define-public python-mpv-jsonipc
+  (package
+    (name "python-mpv-jsonipc")
+    (version "1.2.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-mpv-jsonipc" version))
+       (sha256
+        (base32 "0ymdwrx544a6gn6wm9dixpgzbfrbpxvcj5ys7m41cgb4lvpvx691"))))
+    (build-system pyproject-build-system)
+    (home-page "https://github.com/iwalton3/python-mpv-jsonipc")
+    (synopsis "Python API to MPV using JSON IPC")
+    (description "Python API to MPV using JSON IPC")
+    (license license:asl2.0)))
+
 (define-public python-parso
   (package
     (name "python-parso")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#67999] [PATCH] gnu: python-kalamine: Update to 0.30.
  @ 2024-02-16 14:57 59% ` Adriel Dumas--Jondeau via Guix-patches via
  2024-03-01 11:32 59% ` [bug#67999] [PATCH] gnu: Add python-kalamine Adriel Dumas--Jondeau via Guix-patches via
  2024-03-02 14:08 60% ` [bug#67999] [PATCH v2] gnu: Add kalamine Sharlatan Hellseher
  2 siblings, 0 replies; 200+ results
From: Adriel Dumas--Jondeau via Guix-patches via @ 2024-02-16 14:57 UTC (permalink / raw)
  To: 67999
  Cc: Adriel Dumas--Jondeau, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-kalamine): Update to 0.30.

Change-Id: I95bac1364a22b75bb6f42509da73e1b58bc81d42
---
 gnu/packages/python-xyz.scm | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 62daa6f889..64060d44e3 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6330,19 +6330,38 @@ (define-public autokey
 (define-public python-kalamine
   (package
     (name "python-kalamine")
-    (version "0.18")
+    (version "0.30")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "kalamine" version))
        (sha256
-        (base32 "1qcpn3kknxlh1jcragzgsihn5pysvs82lcrkvk1047im94rgp0i2"))))
+        (base32 "1aqwfp0m2fr9miwh0d8ljmb58k4mw7bp9bzn5fk3kyj2d6zr0cxg"))))
     (build-system pyproject-build-system)
-    (propagated-inputs (list python-click python-lxml python-pyyaml python-tomli))
-    (home-page "http://github.com/fabi1cazenave/kalamine")
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (apply invoke
+                            (cons* "python" "-m" "kalamine.cli" "make"
+                                   (find-files "layouts" "\\.toml")))
+                     (invoke "pytest" "-vv" "tests")))))))
+    (propagated-inputs (list python-click python-livereload python-lxml
+                             python-pyyaml python-tomli python-hatchling))
+    (native-inputs (list python-black
+                         python-isort
+                         python-mypy
+                         python-pytest))
+    (home-page "https://github.com/OneDeadKey/kalamine")
     (synopsis "A cross-platform Keyboard Layout Maker")
-    (description "Creates keyboard descriptions for various operating systems
-from a ASCII-art template within a TOML document.")
+    (description "Kalamine provides a CLI to create advanced keyboard layout
+for Windows (@file{.ahk} or @file{.klc} files), MacOS (@file{.keylayout} files)
+and GNU/Linux (@file{.xkb_custom} or @file{.xkb} files) from a textual,
+portable description.  It also provides @command{xkalamine} to install XKB
+files on GNU/Linux in either @file{/usr/share/X11/xbk} or the rootless
+user-only equivalent @file{.config/xkb}.")
     (license license:expat)))
 
 (define-public python-dm-tree

base-commit: 203344cc37c8a7df1ec1454381b5069d53ce7f9e
prerequisite-patch-id: cefc174692b72660bf5ed4c03442f33dbaf6e784
prerequisite-patch-id: 6b1015959d122056b883e766306b0ff8ba30bde9
prerequisite-patch-id: a3116f7908bc9fdb237e4cde52260856b083596d
prerequisite-patch-id: db1d3d945579284d401944b18fcbc506a000714f
prerequisite-patch-id: 84bff5e4689979f565315edf96250ccc367f8fb8
prerequisite-patch-id: bd69d4115bc86b7d2739e9890625788f1fa5a006
prerequisite-patch-id: 0834ca6f4e7f1ed91b5dcb679096a953a6e36273
prerequisite-patch-id: 9812bf7906d21768559f10f97d8363d2a18fc7e9
prerequisite-patch-id: 68e70365da7db55420105f7cb12c9fffb80d2415
-- 
2.41.0





^ permalink raw reply related	[relevance 59%]

* [bug#69074] [PATCH] gnu: Add python-angr.
    2024-02-12 14:58 81% ` [bug#69074] [PATCH] gnu: Add python-pysmt Troy Figiel
@ 2024-02-12 14:58 69% ` Troy Figiel
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
  2 siblings, 0 replies; 200+ results
From: Troy Figiel @ 2024-02-12 14:58 UTC (permalink / raw)
  To: 69074

And here the patch for python-angr. I changed a couple of things:
- Used pytest test-flags
- Used (which "false")
- Used #$(this-package-native-inputs "binaries")
- Removed the "-x" flag in pytest. If it fails in the CI, it can be nice to see all tests that failed

* gnu/packages/python-xyz.scm (python-angr): New variable.
---
 gnu/local.mk                                  |  2 +
 .../python-angr-addition-type-error.patch     | 18 ++++
 .../patches/python-angr-check-exec-deps.patch | 93 ++++++++++++++++++
 gnu/packages/python-xyz.scm                   | 97 +++++++++++++++++++
 4 files changed, 210 insertions(+)
 create mode 100644 gnu/packages/patches/python-angr-addition-type-error.patch
 create mode 100644 gnu/packages/patches/python-angr-check-exec-deps.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 59e930ffb9..716bde347b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1899,6 +1899,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-3-search-paths.patch		\
   %D%/packages/patches/python-3-fix-tests.patch			\
   %D%/packages/patches/python-3-hurd-configure.patch		\
+  %D%/packages/patches/python-angr-addition-type-error.patch	\
+  %D%/packages/patches/python-angr-check-exec-deps.patch	\
   %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch	\
   %D%/packages/patches/python-argcomplete-1.11.1-fish31.patch	\
   %D%/packages/patches/python-capstone-fix-python-constants.patch	\
diff --git a/gnu/packages/patches/python-angr-addition-type-error.patch b/gnu/packages/patches/python-angr-addition-type-error.patch
new file mode 100644
index 0000000000..7301d8b505
--- /dev/null
+++ b/gnu/packages/patches/python-angr-addition-type-error.patch
@@ -0,0 +1,18 @@
+This fixes failures of the test_ln_gcc_O2 and other related tests
+in the angr test suite.  The patch has been proposed upstream.
+
+Taken form: https://github.com/angr/angr/pull/4443
+
+diff --git a/angr/analyses/reassembler.py b/angr/analyses/reassembler.py
+index 7a2399a60..b09b3a8cb 100644
+--- a/angr/analyses/reassembler.py
++++ b/angr/analyses/reassembler.py
+@@ -730,7 +730,7 @@ class Instruction:
+             elif operand.type == capstone.CS_OP_MEM:
+                 operand_offsets.append(capstone_instr.disp_offset)
+             else:
+-                operand_offsets.append(None)
++                operand_offsets.append(0)
+ 
+         if self.addr is not None:
+             self._initialize(capstone_instr.operands, operand_offsets)
diff --git a/gnu/packages/patches/python-angr-check-exec-deps.patch b/gnu/packages/patches/python-angr-check-exec-deps.patch
new file mode 100644
index 0000000000..438f8ef183
--- /dev/null
+++ b/gnu/packages/patches/python-angr-check-exec-deps.patch
@@ -0,0 +1,93 @@
+The angr test suite performs analysis on several pre-compiled binaries
+to ensure its binary analysis capabilities are working as intended.
+Some of these binaries are also executed as part of the test suite to
+test if the simulation engine provided by angr results in the same
+output as native execution of the binary.
+
+For Guix, this files as the glibc shared objects cannot be found.
+Additionally, we don't really want to execute pre-compiled binaries
+on Guix, hence we disable those tests.
+
+diff --git a/tests/test_ctype_locale.py b/tests/test_ctype_locale.py
+index 08cb89836..2b9233558 100644
+--- a/tests/test_ctype_locale.py
++++ b/tests/test_ctype_locale.py
+@@ -14,7 +14,7 @@ test_location = os.path.dirname(os.path.abspath(__file__))
+ 
+ 
+ class TestCtypeLocale(unittest.TestCase):
+-    @skip_if_not_linux
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_ctype_b_loc(self):
+         """
+         test_ctype_locale.test_ctype_b_loc
+@@ -60,7 +60,7 @@ class TestCtypeLocale(unittest.TestCase):
+         output = subprocess.check_output(bin_path, shell=True)
+         assert result == output
+ 
+-    @skip_if_not_linux
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_ctype_tolower_loc(self):
+         """
+         test_ctype_locale.test_ctype_tolower_loc
+@@ -109,7 +109,7 @@ class TestCtypeLocale(unittest.TestCase):
+         output = subprocess.check_output(bin_path, shell=True)
+         assert result == output
+ 
+-    @skip_if_not_linux
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_ctype_toupper_loc(self):
+         """
+         test_ctype_locale.test_ctype_toupper_loc
+diff --git a/tests/test_signed_div.py b/tests/test_signed_div.py
+index 59cb9b8d1..994ed9c65 100644
+--- a/tests/test_signed_div.py
++++ b/tests/test_signed_div.py
+@@ -1,6 +1,7 @@
+ import angr
+ import subprocess
+ import sys
++import pytest
+ 
+ import logging
+ 
+@@ -13,7 +14,7 @@ import os
+ test_location = os.path.dirname(os.path.realpath(__file__))
+ 
+ 
+-@skipUnless(sys.platform.startswith("linux"), "linux only")
++@pytest.mark.skip(reason="test executes pre-compiled binaries")
+ def test_signed_div():
+     test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "test_signed_div")
+     b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_sscanf.py b/tests/test_sscanf.py
+index 29d2c8403..ea799b310 100644
+--- a/tests/test_sscanf.py
++++ b/tests/test_sscanf.py
+@@ -1,3 +1,4 @@
++import pytest
+ import angr
+ import subprocess
+ import sys
+@@ -14,7 +15,7 @@ test_location = os.path.dirname(os.path.realpath(__file__))
+ 
+ 
+ class TestSscanf(unittest.TestCase):
+-    @unittest.skipUnless(sys.platform.startswith("linux"), "linux only")
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_sscanf(self):
+         test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "sscanf_test")
+         b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_strtol.py b/tests/test_strtol.py
+index 6c29cab22..f36181407 100644
+--- a/tests/test_strtol.py
++++ b/tests/test_strtol.py
+@@ -11,7 +11,7 @@ class TestStrtol(unittest.TestCase):
+     # pylint: disable=no-self-use
+ 
+     @slow_test
+-    @unittest.skipUnless(sys.platform.startswith("linux"), "linux-only")
++    @unittest.skip("test executes pre-compiled binaries")
+     def test_strtol(self, threads=None):
+         test_bin = os.path.join(bin_location, "tests", "x86_64", "strtol_test")
+         # disabling auto_load_libs increases the execution time of the test case.
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e42cbde76e..b3a0f70bd2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -189,6 +189,7 @@ (define-module (gnu packages python-xyz)
   #:use-module (gnu packages djvu)
   #:use-module (gnu packages docker)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages emulators)
   #:use-module (gnu packages engineering)
   #:use-module (gnu packages enchant)
   #:use-module (gnu packages file)
@@ -32390,6 +32391,102 @@ (define-public python-pyvex
 to enable all kinds of binary analysis tasks.")
     (license license:bsd-2)))
 
+(define-public python-angr
+  (package
+    (name "python-angr")
+    (version "9.2.46")
+    (source
+     (origin
+       (method git-fetch)
+       (patches (search-patches "python-angr-addition-type-error.patch"
+                                "python-angr-check-exec-deps.patch"))
+       (uri (git-reference
+             (url "https://github.com/angr/angr")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "18y9wyf7va7gvp9zd6lhw82j9a2x2ajsvbawh96xnxzml0jwlwjm"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:test-flags '(list "tests"
+                          "--dist"
+                          "loadfile"
+                          "-k"
+                          ;; test_mips32_missing_offset_in_instructions fails
+                          ;; with capstone 5 and passes with capstone 4. Might
+                          ;; be a capstone regressions, needs investigation.
+                          "not test_mips32_missing_offset_in_instructions"
+                          "-n"
+                          (number->string (parallel-job-count)))
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'patch-tests
+                     (lambda _
+                       (substitute* "tests/test_vault.py"
+                         (("/bin/false")
+                          (which "false")))
+                       (substitute* "tests/common.py"
+                         (("\\[\"cc\"\\]")
+                          "[\"gcc\"]"))))
+                   (add-before 'build 'set-cc
+                     (lambda _
+                       (setenv "CC" "gcc")))
+                   (add-before 'check 'copy-binaries
+                     (lambda _
+                       (copy-recursively #$(this-package-native-input
+                                            "binaries") "../binaries"))))))
+    (propagated-inputs (list python-ailment
+                             python-archinfo
+                             python-cachetools
+                             python-capstone
+                             python-cffi
+                             python-claripy
+                             python-cle
+                             python-colorama
+                             python-cppheaderparser
+                             python-dpkt
+                             python-gitpython
+                             python-mulpyplexer
+                             python-nampa
+                             python-networkx
+                             python-protobuf
+                             python-psutil
+                             python-itanium-demangle
+                             python-pycparser
+                             python-pyvex
+                             python-progressbar2
+                             python-rpyc
+                             python-sortedcontainers
+                             python-sqlalchemy
+                             python-sympy
+                             unicorn))
+    (native-inputs `(("python-pytest" ,python-pytest)
+                     ("python-pytest-xdist" ,python-pytest-xdist)
+                     ("binaries"
+                      ;; This repository ships several binaries used only for testing
+                      ;; purpose.  The binaries are not executed and not part of the
+                      ;; angr distribution, they are only used to test angr's binary
+                      ;; analysis capabilities.  In the context of the GNU FSDG, these
+                      ;; files should be considered non-functional data.
+                      ,(origin
+                         (method git-fetch)
+                         (uri (git-reference (url
+                                              "https://github.com/angr/binaries")
+                                             (commit (string-append "v"
+                                                                    version))))
+                         (file-name (git-file-name "angr-binaries" version))
+                         (sha256 (base32
+                                  "1f286b2239zavxzwg1184hj1zs380cr9qr549mvy3vywvm8bsmgr"))))))
+    (home-page "https://github.com/angr/angr")
+    (synopsis "Multi-architecture binary analysis toolkit")
+    (description
+     "This package provides a versatile binary analysis platform with the
+ability to perform dynamic symbolic execution as well as various
+static analyses directly on binaries.  As such, it can be used for all
+kinds of reverse engineering, vulnerability discovery, exploit
+generation, and software testing purposes.")
+    (license license:bsd-2)))
+
 (define-public python-archinfo
   (package
     (name "python-archinfo")
-- 
2.42.0





^ permalink raw reply related	[relevance 69%]

* [bug#69074] [PATCH] gnu: Add python-pysmt.
  @ 2024-02-12 14:58 81% ` Troy Figiel
  2024-02-12 14:58 69% ` [bug#69074] [PATCH] gnu: Add python-angr Troy Figiel
  2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
  2 siblings, 0 replies; 200+ results
From: Troy Figiel @ 2024-02-12 14:58 UTC (permalink / raw)
  To: 69074

Hi Sören, here an example for python-pysmt, taken from your commit. It might
be good to add a comment why you cannot stick to a fixed version like
0.9.5. Or ask upstream for a new version :-)

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

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5fe5c0d60a..bb58e3aaa8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,39 @@ (define-public python-opcodes
 and BMI2).")
       (license license:bsd-2))))
 
+(define-public python-pysmt
+  (let ((commit "f7b599c228ee8b429aab1b82ddf167bd956ea8a3")
+        (version "0.9.5")
+        (revision "0"))
+    (package
+      (name "python-pysmt")
+      (version (git-version version revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/pysmt/pysmt")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "05q70hk9rq3037f999ph5yi1ix4c91db29i17rxwcl6q24vlxiwg"))))
+      (build-system pyproject-build-system)
+      (arguments
+       '(#:phases (modify-phases %standard-phases
+                    (add-before 'check 'set-pysmt-solver
+                      (lambda _
+                        (setenv "PYSMT_SOLVER" "z3"))))))
+      (native-inputs (list python-pytest))
+      (propagated-inputs (list z3))
+      (home-page "https://github.com/pysmt/pysmt")
+      (synopsis
+       "Solver-agnostic library for SMT formula manipulation and solving")
+      (description
+       "This Python module provides a solver-agnostic abstraction for working
+with @acronym{SMT, Satisfiability Modulo Theory} formulas.  For example, it
+allows manipulation and solving such formulas.")
+      (license license:asl2.0))))
+
 (define-public python-rpyc
   (package
     (name "python-rpyc")
-- 
2.42.0





^ permalink raw reply related	[relevance 81%]

* [bug#68207] [PATCH v4 3/8] gnu: Add python-pygments-next.
  2024-02-13 14:15 62% ` [bug#68207] [PATCH v4 1/8] gnu: python-markdown-it-py: Update to 3.0.0 Sharlatan Hellseher
  2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 2/8] gnu: python-mdit-py-plugins: Update to 0.4.0 Sharlatan Hellseher
@ 2024-02-13 14:15 65%   ` Sharlatan Hellseher
  2024-02-13 14:15 57%   ` [bug#68207] [PATCH v4 4/8] gnu: python-rich: Update to 13.7.0 Sharlatan Hellseher
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-13 14:15 UTC (permalink / raw)
  To: 68207
  Cc: Felix Gruber, Sharlatan Hellseher, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

From: Felix Gruber <felgru@posteo.net>

* gnu/packages/python-xyz.scm (python-pygments-next): New variable.

Change-Id: I12e3e0d6042f34e0375bcbb1dc90ccc9ed9ce050
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-xyz.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 30f6f1fb3e..b3eed56d06 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6588,6 +6588,21 @@ (define-public python-pygments
      "Pygments is a syntax highlighting package written in Python.")
     (license license:bsd-2)))
 
+(define-public python-pygments-next
+  (package
+    (inherit python-pygments)
+    (name "python-pygments-next")
+    (version "2.17.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "pygments" version))
+       (sha256
+        (base32
+         "0ry3qi4rszkiqb20bmjlzys71dja9i746kvqi8xbxr9dzp4wwins"))))
+    (build-system pyproject-build-system)
+    (native-inputs (list python-hatchling))))
+
 (define-public python-pygments-github-lexers
   (package
     (name "python-pygments-github-lexers")
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#68207] [PATCH v4 4/8] gnu: python-rich: Update to 13.7.0.
  2024-02-13 14:15 62% ` [bug#68207] [PATCH v4 1/8] gnu: python-markdown-it-py: Update to 3.0.0 Sharlatan Hellseher
  2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 2/8] gnu: python-mdit-py-plugins: Update to 0.4.0 Sharlatan Hellseher
  2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 3/8] gnu: Add python-pygments-next Sharlatan Hellseher
@ 2024-02-13 14:15 57%   ` Sharlatan Hellseher
  2024-02-13 14:15 53%   ` [bug#68207] [PATCH v4 5/8] gnu: python-textual: Update to 0.50.1 Sharlatan Hellseher
  2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 6/8] gnu: python-jupytext: Update to 1.15.0 Sharlatan Hellseher
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-13 14:15 UTC (permalink / raw)
  To: 68207
  Cc: Felix Gruber, Sharlatan Hellseher, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

From: Felix Gruber <felgru@posteo.net>

* gnu/packages/python-xyz.scm (python-rich): Update to 13.7.0.
[source]: Use git-fetch since pypi package doesn't include tests.
[build-system]: Use pyproject-build-system.
[arguments]: Remove custom 'check phase.
[propagated-inputs]: Remove python-attrs, python-colorama,
python-commonmark and python-typingextensions; add
python-ipywidgets and python-markdown-it-py; replace python-pygments
with python-pygments-next.
[native-inputs]: Add python-poetry-core; remove tests (which are now
included in new [source]).

Change-Id: I15f7928fc376d8c2556ca2965fe44453bd15f248
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-xyz.scm | 49 ++++++++++++-------------------------
 1 file changed, 15 insertions(+), 34 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b3eed56d06..afd5caf541 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -19192,42 +19192,23 @@ (define-public python-slugid
 (define-public python-rich
   (package
     (name "python-rich")
-    (version "12.4.1")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "rich" version))
-              (sha256
-               (base32
-                "149vjb4cpf9mz14iig0b6d8065dm8aslp6pc45g9ipmp1wf00ffj"))))
-    (build-system python-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda* (#:key inputs tests? #:allow-other-keys)
-             (when tests?
-               (copy-recursively (string-append
-                                  (assoc-ref inputs "tests") "/tests")
-                                 "tests")
-               (invoke "python" "-m" "pytest" "-vv")))))))
+    (version "13.7.0")
+    (source
+      (origin
+        ;; There are no tests in the PyPI tarball.
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://github.com/willmcgugan/rich")
+              (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "0qyhw2vvk17qdmfrmi45z4dd0fkwx3l2qrf3iy0yc2y7pfgrmg9g"))))
+    (build-system pyproject-build-system)
     (propagated-inputs
-     (list python-attrs python-colorama python-commonmark python-pygments
-           python-typing-extensions))
+     (list python-ipywidgets python-markdown-it-py python-pygments-next))
     (native-inputs
-     `(("python-pytest" ,python-pytest)
-       ("tests"
-        ;; The release on pypi comes without tests.  We can't build from this
-        ;; checkout, though, because installation requires an invocation of
-        ;; poetry.
-        ,(origin
-           (method git-fetch)
-           (uri (git-reference
-                 (url "https://github.com/willmcgugan/rich")
-                 (commit (string-append "v" version))))
-           (file-name (git-file-name name version))
-           (sha256
-            (base32
-             "17c3gljn8zv32xnpsgd3fqgqn4r7cdfqri41hridcpbhssdgkyp9"))))))
+     (list python-poetry-core python-pytest))
     (home-page "https://github.com/willmcgugan/rich")
     (synopsis "Render rich text and more to the terminal")
     (description
-- 
2.41.0





^ permalink raw reply related	[relevance 57%]

* [bug#68207] [PATCH v4 5/8] gnu: python-textual: Update to 0.50.1.
  2024-02-13 14:15 62% ` [bug#68207] [PATCH v4 1/8] gnu: python-markdown-it-py: Update to 3.0.0 Sharlatan Hellseher
                     ` (2 preceding siblings ...)
  2024-02-13 14:15 57%   ` [bug#68207] [PATCH v4 4/8] gnu: python-rich: Update to 13.7.0 Sharlatan Hellseher
@ 2024-02-13 14:15 53%   ` Sharlatan Hellseher
  2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 6/8] gnu: python-jupytext: Update to 1.15.0 Sharlatan Hellseher
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-13 14:15 UTC (permalink / raw)
  To: 68207
  Cc: Felix Gruber, Sharlatan Hellseher, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

From: Felix Gruber <felgru@posteo.net>

* gnu/packages/python-xyz.scm (python-textual): Update to 0.50.1.
[source]: Download from github as pypi package does not include tests.
[build-system]: Change to pyproject-build-system.
[arguments]: Remove custom 'check phase; add #:test-flags to disable
broken tests.
[propagated-inputs]: Add python-markdown-it-py, python-mdit-py-plugins
and python-tree-sitter.
[native-inputs]: Add python-poetry-core and python-pytest-asyncio.

Change-Id: Ib144dc87f73e91d4c9d2e8f91ce6ce7a86a481a9
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-xyz.scm | 49 ++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index afd5caf541..27665e1cad 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -108,7 +108,7 @@
 ;;; Copyright © 2021 Simon Streit <simon@netpanic.org>
 ;;; Copyright © 2021, 2022, 2023 Daniel Meißner <daniel.meissner-i4k@ruhr-uni-bochum.de>
 ;;; Copyright © 2021, 2022 Pradana Aumars <paumars@courrier.dev>
-;;; Copyright © 2021, 2022, 2023 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2021–2024 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2021 Sébastien Lerique <sl@eauchat.org>
 ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
 ;;; Copyright © 2021 ZmnSCPxj <ZmnSCPxj@protonmail.com>
@@ -266,6 +266,7 @@ (define-module (gnu packages python-xyz)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages tree-sitter)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
@@ -19242,20 +19243,8 @@ (define-public python-rich-click
 (define-public python-textual
   (package
     (name "python-textual")
-    (version "0.1.18")
+    (version "0.50.1")
     (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "textual" version))
-              (sha256
-               (base32
-                "08yg5a51hz1axfj5hx28hx31gq5apcj6vpkkmawmiplisa73z25j"))))
-    (build-system python-build-system)
-    (arguments
-     (let ((tests
-            ;; The release on pypi comes without tests.  We can't build
-            ;; from this checkout, though, because installation requires
-            ;; an invocation of poetry.
-            (origin
               (method git-fetch)
               (uri (git-reference
                     (url "https://github.com/Textualize/textual")
@@ -19263,19 +19252,29 @@ (define-public python-textual
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0b3ycwqhp21mg9fvmadgxhgbvkwq6fd784l2xcmvy77rravrnnax")))))
-       (list #:phases
-             #~(modify-phases %standard-phases
-                 (replace 'check
-                   (lambda* (#:key tests? #:allow-other-keys)
-                     (when tests?
-                       (copy-recursively #$(file-append tests "/tests")
-                                         "tests")
-                       (invoke "python" "-m" "pytest" "-vv"))))))))
+                "10mmmgsq5pblr9ijgyln79p3hc7sah56k2hkzlvm2abrr9gwgpcf"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:test-flags
+           ;; Snapshot tests require python-pytest-textual-snapshot which
+           ;; in turn depends on python-textual.
+           '(list "--ignore=tests/snapshot_tests/test_snapshots.py"
+             "-k" (string-append
+                   ;; Broken for unknown reason.
+                   "not test_textual_env_var"
+                   ;; Tests that require python-treesitter-languages.
+                   " and not test_language_binary_missing"
+                   " and not test_register_language"
+                   " and not test_register_language_existing_language"))))
     (propagated-inputs
-     (list python-rich python-typing-extensions))
+     (list python-markdown-it-py
+           python-mdit-py-plugins
+           python-rich
+           python-tree-sitter
+           ;; python-tree-sitter-languages ; optional, not packed yet
+           python-typing-extensions))
     (native-inputs
-     (list python-pytest))
+     (list python-poetry-core python-pytest python-pytest-asyncio))
     (home-page "https://github.com/Textualize/textual")
     (synopsis "Build text user interfaces in Python")
     (description "Textual is a @acronym{TUI, Text User Interface} framework
-- 
2.41.0





^ permalink raw reply related	[relevance 53%]

* [bug#68207] [PATCH v4 6/8] gnu: python-jupytext: Update to 1.15.0.
  2024-02-13 14:15 62% ` [bug#68207] [PATCH v4 1/8] gnu: python-markdown-it-py: Update to 3.0.0 Sharlatan Hellseher
                     ` (3 preceding siblings ...)
  2024-02-13 14:15 53%   ` [bug#68207] [PATCH v4 5/8] gnu: python-textual: Update to 0.50.1 Sharlatan Hellseher
@ 2024-02-13 14:15 65%   ` Sharlatan Hellseher
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-13 14:15 UTC (permalink / raw)
  To: 68207
  Cc: Sharlatan Hellseher, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, Sharlatan Hellseher, jgart

* gnu/packages/python-xyz.scm (python-jupytext): Update to 1.15.0.

Change-Id: I8cbd4e45eae838cb1733bf8feeb3bc2abe960513
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 27665e1cad..e04c55738e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -339,7 +339,7 @@ (define-public python-janus
 (define-public python-jupytext
   (package
     (name "python-jupytext")
-    (version "1.14.4")
+    (version "1.15.0")
     (source
      (origin
        (method git-fetch)
@@ -348,7 +348,7 @@ (define-public python-jupytext
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "19d443vx597zzxna09qpync9iic3mris80bwm3kd8xaxaq0zq9w4"))))
+        (base32 "0bgf0c4py22ip7qfla8mrmypfh3bg151c8awsr1gvcbw7m4ni01k"))))
     (build-system python-build-system)
     (arguments
      (list
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

* [bug#68207] [PATCH v4 1/8] gnu: python-markdown-it-py: Update to 3.0.0.
  @ 2024-02-13 14:15 62% ` Sharlatan Hellseher
  2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 2/8] gnu: python-mdit-py-plugins: Update to 0.4.0 Sharlatan Hellseher
                     ` (4 more replies)
  0 siblings, 5 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-13 14:15 UTC (permalink / raw)
  To: 68207
  Cc: Felix Gruber, Sharlatan Hellseher, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

From: Felix Gruber <felgru@posteo.net>

* gnu/packages/python-xyz.scm (python-markdown-it-py): Update to 3.0.0.
[propagated-inputs]: Remove python-typing-extensions; add python-commonmark,
python-linkify-it-py, python-markdown, python-mistletoe,
python-mistune, python-panflute, python-psutil, and python-pyyaml.
[native-inputs]: Remove python-flit; add python-flit-core.

Change-Id: I5dc06b163ddbec0a32a9d7c3da2c834b2e74cd74
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-xyz.scm | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a645c45a4c..6a28836acf 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5881,19 +5881,26 @@ (define-public python-makefun
 (define-public python-markdown-it-py
   (package
     (name "python-markdown-it-py")
-    (version "2.1.0")
+    (version "3.0.0")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "markdown-it-py" version))
               (sha256
                (base32
-                "1nh75i72584r70alhqc479gys04s5m5g3vq601yf2njbs7z5jzng"))))
+                "1swgvyiavak0nmfb31lq5zck5chwhmyf6qb6qwpcav86zaa0mxp3"))))
     (build-system pyproject-build-system)
     (arguments (list #:tests? #f))      ;pypi source does not contains tests
-    (native-inputs (list python-flit))
+    (native-inputs (list python-flit-core))
     (propagated-inputs
-     (list python-mdurl
-           python-typing-extensions))
+     (list python-commonmark
+           python-linkify-it-py
+           python-markdown
+           python-mdurl
+           python-mistletoe
+           python-mistune
+           python-panflute
+           python-psutil
+           python-pyyaml))
     (home-page "https://github.com/executablebooks/markdown-it-py")
     (synopsis "Python port of markdown-it")
     (description

base-commit: e9a6c7094822bc859d0694eeaf8f434317219367
-- 
2.41.0





^ permalink raw reply related	[relevance 62%]

* [bug#68207] [PATCH v4 2/8] gnu: python-mdit-py-plugins: Update to 0.4.0.
  2024-02-13 14:15 62% ` [bug#68207] [PATCH v4 1/8] gnu: python-markdown-it-py: Update to 3.0.0 Sharlatan Hellseher
@ 2024-02-13 14:15 65%   ` Sharlatan Hellseher
  2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 3/8] gnu: Add python-pygments-next Sharlatan Hellseher
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Sharlatan Hellseher @ 2024-02-13 14:15 UTC (permalink / raw)
  To: 68207
  Cc: Felix Gruber, Sharlatan Hellseher, Lars-Dominik Braun,
	Marius Bakke, Munyoki Kilyungi, Sharlatan Hellseher, jgart

From: Felix Gruber <felgru@posteo.net>

* gnu/packages/python-xyz.scm (python-mdit-py-plugins): Update to 0.4.0.

Change-Id: I18ca46abebe125d1a6729c10a3f4fa4a62a145ba
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/python-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6a28836acf..30f6f1fb3e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -1124,7 +1124,7 @@ (define-public python-lunr
 (define-public python-mdit-py-plugins
   (package
     (name "python-mdit-py-plugins")
-    (version "0.3.1")
+    (version "0.4.0")
     (source (origin
               (method git-fetch)        ;for tests
               (uri (git-reference
@@ -1133,7 +1133,7 @@ (define-public python-mdit-py-plugins
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "00ybbfb6dzn9q5qnvnm8bmhd84s215ik7pcdb4r35zhwiv2ikizz"))))
+                "1790fcf3nd9c5j37fx87x3ivfyihk6l74jxj1qxvw3qfyb96w4k0"))))
     (build-system pyproject-build-system)
     (propagated-inputs
      (list python-markdown-it-py
-- 
2.41.0





^ permalink raw reply related	[relevance 65%]

Results 1-200 of ~3787   | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-12-21 15:32     [bug#60240] [PATCH] [WIP] gnu: Add python-3.11 Tanguy Le Carrour
2024-02-21 12:13 34% ` [bug#60240] [PATCH v2] gnu: Add python-3.12 and python-next Tanguy Le Carrour
2024-02-25 14:08       ` Lars-Dominik Braun
2024-02-26  8:25         ` Tanguy LE CARROUR
2024-03-02  9:59 57%       ` Lars-Dominik Braun
2024-03-06 12:55 35% ` [bug#60240] [PATCH v3] " Tanguy Le Carrour
2024-03-07 18:45 34% ` [bug#60240] [PATCH v4] " Tanguy Le Carrour
2024-03-07 18:58 35% ` [bug#60240] [PATCH v5] " Tanguy Le Carrour
2023-09-26  9:29     [bug#66208] [PATCH] gnu: add python-shshsh Andrew Jose
2024-04-04 21:44     ` [bug#66208] [PATCH v2 0/1] Review python-shshsh Steve George
2024-04-04 21:46 64%   ` [bug#66208] [PATCH v2 1/1] gnu: Add python-shshsh Steve George
2023-12-24  0:20     [bug#67999] [PATCH] gnu: Add python-kalamine Adriel Dumas--Jondeau via Guix-patches via
2024-02-16 14:57 59% ` [bug#67999] [PATCH] gnu: python-kalamine: Update to 0.30 Adriel Dumas--Jondeau via Guix-patches via
2024-03-01 11:32 59% ` [bug#67999] [PATCH] gnu: Add python-kalamine Adriel Dumas--Jondeau via Guix-patches via
2024-03-02 14:08 60% ` [bug#67999] [PATCH v2] gnu: Add kalamine Sharlatan Hellseher
2023-12-26 22:10     [bug#68052] [PATCH 0/4] Collected patches fixing builds of various Frescobaldi dependencies Marco Rimoldi via Guix-patches via
2024-02-21 19:30 45% ` [bug#68052] [PATCH v3 1/4] gnu: python-poppler-qt5: Update to 21.3.0 Marco Rimoldi via Guix-patches via
2024-01-02 15:03     [bug#68207] [PATCH 0/5] Update python-textual to 0.46.0 Felix Gruber
2024-02-13 14:15 62% ` [bug#68207] [PATCH v4 1/8] gnu: python-markdown-it-py: Update to 3.0.0 Sharlatan Hellseher
2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 2/8] gnu: python-mdit-py-plugins: Update to 0.4.0 Sharlatan Hellseher
2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 3/8] gnu: Add python-pygments-next Sharlatan Hellseher
2024-02-13 14:15 57%   ` [bug#68207] [PATCH v4 4/8] gnu: python-rich: Update to 13.7.0 Sharlatan Hellseher
2024-02-13 14:15 53%   ` [bug#68207] [PATCH v4 5/8] gnu: python-textual: Update to 0.50.1 Sharlatan Hellseher
2024-02-13 14:15 65%   ` [bug#68207] [PATCH v4 6/8] gnu: python-jupytext: Update to 1.15.0 Sharlatan Hellseher
2024-01-15 23:25     [bug#68492] [PATCH] gnu: Add python-fastapi-pagination Giacomo Leidi via Guix-patches via
2024-02-28 23:35 60% ` [bug#68492] [PATCH v2 1/2] gnu: Add python-fastapi-pagination-minimal Giacomo Leidi via Guix-patches via
2024-02-28 23:35 63%   ` [bug#68492] [PATCH v2 2/2] gnu: Add python-fastapi-pagination Giacomo Leidi via Guix-patches via
2024-01-25 21:41     [bug#68721] [PATCH 0/2] gnu: Add python-fastparquet Troy Figiel
2024-03-02 18:40 72% ` [bug#68721] [PATCH 1/2] gnu: Add python-cramjam Troy Figiel
2024-02-12 14:55     [bug#69074] [PATCH] Add python-angr soeren
2024-02-12 14:58 81% ` [bug#69074] [PATCH] gnu: Add python-pysmt Troy Figiel
2024-02-12 14:58 69% ` [bug#69074] [PATCH] gnu: Add python-angr Troy Figiel
2024-03-10 20:09 61% ` [bug#69074] [PATCH v2 01/14] gnu: Add python-itanium-demangle soeren
2024-03-10 20:09 65%   ` [bug#69074] [PATCH v2 03/14] gnu: Add python-mulpyplexer soeren
2024-03-10 20:09 65%   ` [bug#69074] [PATCH v2 04/14] gnu: Add python-nampa soeren
2024-03-10 20:09 61%   ` [bug#69074] [PATCH v2 05/14] gnu: Add python-rpyc soeren
2024-03-10 20:09 62%   ` [bug#69074] [PATCH v2 06/14] gnu: Add python-pysmt soeren
2024-03-10 20:09 62%   ` [bug#69074] [PATCH v2 07/14] gnu: Add python-claripy soeren
2024-03-10 20:09 66%   ` [bug#69074] [PATCH v2 09/14] gnu: Add python-pyvex soeren
2024-03-10 20:09 63%   ` [bug#69074] [PATCH v2 10/14] gnu: Add python-cle soeren
2024-03-10 20:09 64%   ` [bug#69074] [PATCH v2 11/14] gnu: Add python-ailment soeren
2024-03-10 20:09 70%   ` [bug#69074] [PATCH v2 13/14] gnu: capstone: Backport upstream fix for Python bindings soeren
2024-03-10 20:09 69%   ` [bug#69074] [PATCH v2 14/14] gnu: Add python-angr soeren
2024-02-17 17:20     [bug#67120] [PATCH v3 0/4] Add jellyfin-mpv-shim and deps Ian Eure
2024-02-17 17:20 65% ` [bug#67120] [PATCH v3 1/4] gnu: Add python-mpv-jsonipc Ian Eure
2024-02-17 17:20 65% ` [bug#67120] [PATCH v3 2/4] gnu: Add python-jellyfin-apiclient Ian Eure
2024-02-17 17:20 64% ` [bug#67120] [PATCH v3 3/4] gnu: Add python-pystray Ian Eure
2024-02-17 17:49     [bug#67120] [PATCH v4 0/4] Add jellyfin-mpv-player and deps Ian Eure
2024-02-17 17:49 65% ` [bug#67120] [PATCH v4 1/4] gnu: Add python-mpv-jsonipc Ian Eure
2024-02-17 17:49 65% ` [bug#67120] [PATCH v4 2/4] gnu: Add python-jellyfin-apiclient Ian Eure
2024-02-17 17:49 64% ` [bug#67120] [PATCH v4 3/4] gnu: Add python-pystray Ian Eure
2024-02-17 19:02     [bug#67120] [PATCH v5 0/5] Add jellyfin-mpv-player and deps Ian Eure
2024-02-17 19:02 65% ` [bug#67120] [PATCH v5 1/5] gnu: Add python-mpv-jsonipc Ian Eure
2024-02-17 19:02 65% ` [bug#67120] [PATCH v5 2/5] gnu: Add python-jellyfin-apiclient Ian Eure
2024-02-17 19:02 64% ` [bug#67120] [PATCH v5 3/5] gnu: Add python-pystray Ian Eure
2024-02-19  9:50     [bug#69268] [PATCH 0/2] Add python-heatwave Wilko Meyer
2024-02-19  9:53 65% ` [bug#69268] [PATCH 1/2] gnu: Add python-monthdelta Wilko Meyer
2024-02-19  9:53 64% ` [bug#69268] [PATCH 2/2] gnu: Add python-heatwave Wilko Meyer
2024-02-20 23:41     [bug#69295] [PATCH 00/46] gnu: Astronomy 2024/02 updates Sharlatan Hellseher
2024-02-20 23:43 65% ` [bug#69295] [PATCH 05/46] gnu: parfive: Update to 2.0.2 Sharlatan Hellseher
2024-02-20 23:43 64% ` [bug#69295] [PATCH 06/46] gnu: parfive: Simplify package Sharlatan Hellseher
2024-02-20 23:43 65% ` [bug#69295] [PATCH 08/46] gnu: python-aioftp: Update to 0.22.3 Sharlatan Hellseher
2024-02-20 23:43 65% ` [bug#69295] [PATCH 18/46] gnu: python-h5netcdf: Update to 1.3.0 Sharlatan Hellseher
2024-02-24 10:41     [bug#69352] [PATCH 00/13] Update Clingo to 5.7.1, etc pp Liliana Marie Prikler
2024-02-24  6:57 65% ` [bug#69352] [PATCH 02/13] gnu: python-scikit-build: Install cmake modules Liliana Marie Prikler
2024-02-24  7:59 57% ` [bug#69352] [PATCH 12/13] gnu: python-telingo: Update to 2.1.3 Liliana Marie Prikler
2024-02-24  9:17 65% ` [bug#69352] [PATCH OPTIONAL 13/13] gnu: python: python-scikit-build: Add more non-deterministic test failures Liliana Marie Prikler
2024-02-25 17:42 66% [bug#69389] [PATCH] gnu: Add python-xmp-toolkit Felix Gruber
2024-02-25 22:20     [bug#67120] [PATCH v6 0/5] Add jellyfin-mpv-player and deps Ian Eure
2024-02-25 22:20 65% ` [bug#67120] [PATCH v6 1/5] gnu: Add python-mpv-jsonipc Ian Eure
2024-02-25 22:20 64% ` [bug#67120] [PATCH v6 2/5] gnu: Add python-jellyfin-apiclient Ian Eure
2024-02-25 22:20 62% ` [bug#67120] [PATCH v6 3/5] gnu: Add python-pystray Ian Eure
2024-02-27 19:09 60% [bug#69434] [PATCH] gnu: Add python-ldaptor Sharlatan Hellseher
2024-03-02 14:15 61% ` [bug#69434] [PATCH v2] " Sharlatan Hellseher
2024-02-28  9:42     [bug#69449] [PATCH python-team 0/9] gnu: Add python-flask-3 Tanguy Le Carrour
2024-02-28 10:15 64% ` [bug#69449] [PATCH python-team 1/9] gnu: python-itsdangerous: Update to 2.1.2 Tanguy Le Carrour
2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 2/9] gnu: python-jinja2: Update to 3.1.3 Tanguy Le Carrour
2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 3/9] gnu: python-click: Update to 8.1.7 Tanguy Le Carrour
2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 4/9] gnu: python-blinker: Update to 1.7.0 Tanguy Le Carrour
2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 5/9] gnu: Add python-ephemeral-port-reserve Tanguy Le Carrour
2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 6/9] gnu: python-werkzeug: Rename variable to python-werkzeug-2 Tanguy Le Carrour
2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 7/9] gnu: Add python-werkzeug-3 Tanguy Le Carrour
2024-02-28 10:15 65% ` [bug#69449] [PATCH python-team 8/9] gnu: python-flask: Rename to python-flask-2 Tanguy Le Carrour
2024-02-28 10:15 62% ` [bug#69449] [PATCH python-team 9/9] gnu: Add python-flask-3 Tanguy Le Carrour
2024-02-28 10:13 64% [bug#69450] [PATCH python-team] gnu: python-markdown: Update to 3.5.2 Tanguy Le Carrour
2024-02-28 10:27 63% [bug#69452] [PATCH] gnu: Add python-mistune-3 Tanguy Le Carrour
2024-02-28 11:20 63% [bug#69453] [PATCH] gnu: Add python-jinja2-fragments Tanguy Le Carrour
2024-03-01  9:22 61% [bug#69486] [PATCH] gnu: Add python-pypugjs Tanguy Le Carrour
2024-03-17 16:32 60% ` [bug#69486] [PATCH v2] " Tanguy Le Carrour
2024-03-19 16:18 65%   ` bug#69486: " Ludovic Courtès
2024-03-02 20:46 62% [bug#69514] [PATCH] gnu: python-pandera: Update to 0.18.0 Troy Figiel
2024-03-06  9:38 64% [bug#69579] [PATCH] gnu: python-joblib: Update to 1.3.2 Nicolas Graves via Guix-patches via
2024-03-06 19:37     [bug#69591] [PATCH 00/31] Unbundle and update python-pytorch David Elsing
2024-03-06 19:40 65% ` [bug#69591] [PATCH 02/31] gnu: Add python-typing-extensions-4.10 David Elsing
2024-03-06 19:40 64% ` [bug#69591] [PATCH 03/31] gnu: Add python-optree David Elsing
2024-03-06 19:40 65% ` [bug#69591] [PATCH 04/31] gnu: Add python-pytest-flakefinder David Elsing
2024-03-06 19:40 65% ` [bug#69591] [PATCH 05/31] gnu: Add python-pytest-shard David Elsing
2024-03-06 19:40 64% ` [bug#69591] [PATCH 06/31] gnu: Add python-expecttest David Elsing
2024-03-06 19:40 65% ` [bug#69591] [PATCH 07/31] gnu: Add python-pytest-rerunfailures-13 David Elsing
2024-03-06 19:40 48% ` [bug#69591] [PATCH 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
2024-03-06 19:40 43% ` [bug#69591] [PATCH 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
2024-03-10 21:22 65% [bug#69716] [PATCH] gnu: python-3.12: Enable loadable sqlite extensions Felix Gruber
2024-03-11 18:11     [bug#69736] [PATCH 0/7] Add toil Arun Isaac
2024-03-11 18:22 65% ` [bug#69736] [PATCH 1/7] gnu: Add python-typing-extensions-4.10 Arun Isaac
2024-03-11 18:22 62% ` [bug#69736] [PATCH 2/7] gnu: Add python-pypubsub Arun Isaac
2024-03-11 18:22 65% ` [bug#69736] [PATCH 3/7] gnu: Add python-addict Arun Isaac
2024-03-11 18:22 65% ` [bug#69736] [PATCH 4/7] gnu: Add python-prefixed Arun Isaac
2024-03-11 18:22 64% ` [bug#69736] [PATCH 5/7] gnu: Add python-enlighten Arun Isaac
2024-03-12 22:46     [bug#69591] [PATCH v2 00/31] Unbundle and update python-pytorch David Elsing
2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 02/31] gnu: Add python-typing-extensions-4.10 David Elsing
2024-03-12 22:51 63% ` [bug#69591] [PATCH v2 03/31] gnu: Add python-optree David Elsing
2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 04/31] gnu: Add python-pytest-flakefinder David Elsing
2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 05/31] gnu: Add python-pytest-shard David Elsing
2024-03-12 22:51 64% ` [bug#69591] [PATCH v2 06/31] gnu: Add python-expecttest David Elsing
2024-03-12 22:51 65% ` [bug#69591] [PATCH v2 07/31] gnu: Add python-pytest-rerunfailures-13 David Elsing
2024-03-12 22:51 48% ` [bug#69591] [PATCH v2 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
2024-03-12 22:51 42% ` [bug#69591] [PATCH v2 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
2024-03-12 23:40 63% [bug#69763] [PATCH] gnu: python-build: Update python-pypa-build to 1.1.1 Daniel Ziltener via Guix-patches via
2024-03-12 23:47 65% [bug#69764] [PATCH] gnu: python-build: Update python-wheel to 0.43.0 Daniel Ziltener via Guix-patches via
2024-03-13  1:09 65% [bug#69769] [PATCH 1/4] gnu: python-xyz: Update python-botocore to 1.34.61 Daniel Ziltener via Guix-patches via
2024-03-13  1:10 65% [bug#69766] [PATCH 2/4] gnu: python-xyz: Update python-boto3 " Daniel Ziltener via Guix-patches via
2024-03-13  1:11 65% [bug#69765] [PATCH 3/4] gnu: python-web: Update python-s3transfer to 0.10.0 Daniel Ziltener via Guix-patches via
2024-03-13  1:12 65% [bug#69768] [PATCH 4/4] gnu: python-web: Update awscli to 1.32.61 Daniel Ziltener via Guix-patches via
2024-03-14  8:29     [bug#69794] [PATCH 0/2] Package some dependencies for Argos Translate guix-patches--- via
2024-03-14  8:32 61% ` [bug#69794] [PATCH 1/2] gnu: Add python-sacremoses guix-patches--- via
2024-03-15 19:12 62% [bug#69817] [PATCH] gnu: Add python-pynsee Nicolas Graves via Guix-patches via
2024-04-16 12:34 62% ` [bug#69817] [PATCH v2] " Nicolas Graves via Guix-patches via
2024-03-17 17:08     [bug#60238] [PATCH v3 1/7] gnu: beancount: Adjust packages style Sharlatan Hellseher
2024-03-17 17:08 59% ` [bug#60238] [PATCH v3 4/7] gnu: Add python-markdown2 Sharlatan Hellseher
2024-03-17 17:08 64% ` [bug#60238] [PATCH v3 5/7] gnu: Add python-pypytools Sharlatan Hellseher
2024-03-17 17:08 59% ` [bug#60238] [PATCH v3 6/7] gnu: Add python-cheroot Sharlatan Hellseher
2024-03-18 22:49 79% [bug#69885] [PATCH] gnu: Add python-x-wr-timezone Benjamin Slade
2024-03-18 22:51 63% [bug#69884] [PATCH] gnu: Add python-recurring-ical-events Benjamin Slade
2024-03-18 22:53 62% [bug#69887] [PATCH] gnu: Add python-ical2orgpy Benjamin Slade
2024-03-20 18:52     [bug#69867] [PATCH 0/2] gnu: magic-wormhole: Update to 0.13.0 normalmente
2024-03-20 18:55 64% ` [bug#69867] [PATCH 1/2] gnu: Add python-noiseprotocol normalmente
2024-03-20 22:24     [bug#69924] [PATCH 00/49] gnu: Astronomy 2024/02 updates Sharlatan Hellseher
2024-03-20 22:27 69% ` [bug#69924] [PATCH 03/49] gnu: python-blosc: Move to python-compression Sharlatan Hellseher
2024-03-20 22:27 65% ` [bug#69924] [PATCH 04/49] gnu: python-blosc: Simplify package Sharlatan Hellseher
2024-03-20 22:27 63% ` [bug#69924] [PATCH 05/49] gnu: python-pytest-doctestplus: Update to 1.2.0 Sharlatan Hellseher
2024-03-20 22:27 65% ` [bug#69924] [PATCH 06/49] gnu: python-pytest-arraydiff: Update to 0.6.1 Sharlatan Hellseher
2024-03-20 22:27 64% ` [bug#69924] [PATCH 07/49] gnu: python-pytest-arraydiff: Enable tests Sharlatan Hellseher
2024-03-20 22:27 65% ` [bug#69924] [PATCH 08/49] gnu: python-pytest-filter-subpackage: Update to 0.2.0 Sharlatan Hellseher
2024-03-20 22:27 65% ` [bug#69924] [PATCH 09/49] gnu: python-zarr: Update to 2.17.1 Sharlatan Hellseher
2024-03-20 22:27 65% ` [bug#69924] [PATCH 10/49] gnu: python-partd: Enable tests Sharlatan Hellseher
2024-03-20 22:27 62% ` [bug#69924] [PATCH 11/49] gnu: python-zarr: Speed up tests Sharlatan Hellseher
2024-03-20 22:27 62% ` [bug#69924] [PATCH 12/49] gnu: python-distributed: " Sharlatan Hellseher
2024-03-20 22:27 65% ` [bug#69924] [PATCH 13/49] gnu: python-dask: " Sharlatan Hellseher
2024-03-20 22:27 65% ` [bug#69924] [PATCH 15/49] gnu: python-glymur: " Sharlatan Hellseher
2024-03-20 22:28 65% ` [bug#69924] [PATCH 34/49] gnu: python-glymur: Update to 0.12.9 Sharlatan Hellseher
2024-03-20 22:28 63% ` [bug#69924] [PATCH 45/49] gnu: Add python-ewah-bool-utils Sharlatan Hellseher
2024-03-20 22:28 57% ` [bug#69924] [PATCH 48/49] gnu: Add python-pydantic-settings Sharlatan Hellseher
2024-03-20 22:37     [bug#69591] [PATCH v3 00/32] Unbundle and update python-pytorch David Elsing
2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 02/32] gnu: Add python-typing-extensions-4.10 David Elsing
2024-03-20 22:38 63% ` [bug#69591] [PATCH v3 03/32] gnu: Add python-optree David Elsing
2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 04/32] gnu: Add python-pytest-flakefinder David Elsing
2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 05/32] gnu: Add python-pytest-shard David Elsing
2024-03-20 22:38 64% ` [bug#69591] [PATCH v3 06/32] gnu: Add python-expecttest David Elsing
2024-03-20 22:38 65% ` [bug#69591] [PATCH v3 07/32] gnu: Add python-pytest-rerunfailures-13 David Elsing
2024-03-20 22:38 47% ` [bug#69591] [PATCH v3 26/32] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
2024-03-20 22:38 43% ` [bug#69591] [PATCH v3 32/32] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
2024-03-22 20:12 60% [bug#69947] [PATCH] gnu: python-box: Update to 7.1.1 Felix Gruber
2024-03-23 21:40     [bug#69591] [PATCH v4 00/32] Unbundle and update python-pytorch David Elsing
2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 02/32] gnu: Add python-typing-extensions-4.10 David Elsing
2024-03-23 22:04 63% ` [bug#69591] [PATCH v4 03/32] gnu: Add python-optree David Elsing
2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 04/32] gnu: Add python-pytest-flakefinder David Elsing
2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 05/32] gnu: Add python-pytest-shard David Elsing
2024-03-23 22:04 64% ` [bug#69591] [PATCH v4 06/32] gnu: Add python-expecttest David Elsing
2024-03-23 22:04 65% ` [bug#69591] [PATCH v4 07/32] gnu: Add python-pytest-rerunfailures-13 David Elsing
2024-03-23 22:05 46% ` [bug#69591] [PATCH v4 26/32] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies David Elsing
2024-03-23 22:05 43% ` [bug#69591] [PATCH v4 32/32] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch David Elsing
2024-03-24 11:18     [bug#69978] [PATCH 0/4] Update and cleanup python-celery & friends Vinicius Monego
2024-03-24 11:20 65% ` [bug#69978] [PATCH 1/4] gnu: python-billiard: Update to 4.2.0 Vinicius Monego
2024-03-24 11:20 62% ` [bug#69978] [PATCH 2/4] gnu: python-kombu: Update to 5.3.5 Vinicius Monego
2024-03-24 11:20 65% ` [bug#69978] [PATCH 3/4] gnu: python-vine: Update to 5.1.0 Vinicius Monego
2024-03-24 11:20 59% ` [bug#69978] [PATCH 4/4] gnu: python-celery: Update to 5.3.6 Vinicius Monego
2024-03-24 13:38     [bug#69980] [PATCH 00/13] Update and cleanup pre-commit & friends Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 01/13] gnu: python-loguru: Remove pre-commit from native-inputs Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 02/13] gnu: python-jsonargparse: " Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 03/13] gnu: python-traitlets: " Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 04/13] gnu: python-seaborn: " Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 05/13] gnu: python-rich-click: " Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 06/13] gnu: python-lazy-loader: " Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 07/13] gnu: python-jupytext: " Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 08/13] gnu: python-omnipath: " Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 09/13] gnu: python-cfgv: Update to 3.4.0 Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 10/13] gnu: Add python-ukkonen Vinicius Monego
2024-03-24 13:40 64% ` [bug#69980] [PATCH 11/13] gnu: python-identify: Update to 2.5.35 Vinicius Monego
2024-03-24 13:40 65% ` [bug#69980] [PATCH 12/13] gnu: python-nodeenv: Update to 1.8.0 Vinicius Monego
2024-03-28  6:54 65% [bug#70045] [PATCH] Updated the package from version 1.4.0 to version 1.5.0 nafkhamdc
2024-03-28 11:04 65% [bug#70050] [PATCH] gnu: Add python-pytest-testmon nafkhamdc
2024-03-28 12:29 65% [bug#70052] [PATCH] Updated the package from 0.6.0 to 0.9.0 nafkhamdc
2024-03-28 16:15 59% [bug#70057] [PATCH] gnu: Add python-apprise Fabio Natali via Guix-patches via
2024-03-29  8:57 65% [bug#70067] [PATCH] gnu: Add python-find-libpython Cayetano Santos via Guix-patches via
2024-03-30 12:30 58% [bug#70089] [PATCH] gnu: python-scikit-optimize: Update to 0.10.1 Vinicius Monego
2024-03-31 14:52     [bug#70107] [PATCH 0/3] Update Komikku Liliana Marie Prikler
2024-03-31 14:48 65% ` [bug#70107] [PATCH 1/3] gnu: Add python-colorthief Liliana Marie Prikler
2024-04-03 22:16     [bug#70171] [PATCH 0/3] gnu: magic-wormhole: Update to 0.14.0 TakeV via Guix-patches via
2024-04-03 22:21 65% ` [bug#70171] [PATCH 1/3] gnu: Add python-iterable-io TakeV via Guix-patches via
2024-04-03 22:21 64% ` [bug#70171] [PATCH 2/3] gnu: Add python-zipstream-ng TakeV via Guix-patches via
2024-04-04  5:55     [bug#70179] [PATCH 0/3] Use system nss-certs in Python Efraim Flashner
2024-04-04  5:56 62% ` [bug#70179] [PATCH v2 1/3] gnu: python-certifi: Use system SSL certificates Efraim Flashner
2024-04-04  5:56 62% ` [bug#70179] [PATCH v2 2/3] gnu: python-pip: " Efraim Flashner
2024-04-04  5:56 55% ` [bug#70179] [PATCH v2 3/3] gnu: python: " Efraim Flashner
2024-04-07 21:49 65% [bug#70268] [PATCH] gnu: Add python-vdf Giacomo Leidi via Guix-patches via
2024-04-17  9:34     ` [bug#70268] [PATCH v2 0/1] " Steve George
2024-04-17  9:34 65%   ` [bug#70268] [PATCH v2 1/1] gnu: " Steve George
2024-04-07 22:13 63% [bug#70269] [PATCH] gnu: Add python-pybadges Giacomo Leidi via Guix-patches via
2024-04-09 10:13     [bug#70305] [PATCH 0/5] gnu: coin3d: Improve and update to 4.0.2 Jean-Pierre De Jesus DIAZ
2024-04-09 10:22 58% ` [bug#70305] [PATCH 1/5] gnu: coin3D: Rename to coin3d Jean-Pierre De Jesus DIAZ
2024-04-15  8:25 65% [bug#70393] [PATCH] gnu: python-pydevd: Use gdb/pinned Christopher Baines
2024-04-15 17:34     [bug#70400] [PATCH] Update python-lsp-server Jonathan Pieper via Guix-patches via
2024-04-15 17:45 64% ` [bug#70400] [PATCH 1/7] gnu: Add python-docstring-to-markdown Jonathan Pieper via Guix-patches via
2024-04-15 17:45 61%   ` [bug#70400] [PATCH 2/7] gnu: Add python-pytoolconfig Jonathan Pieper via Guix-patches via
2024-04-15 17:45 63%   ` [bug#70400] [PATCH 3/7] gnu: python-lsp-jsonrpc: Update to 1.1.2 Jonathan Pieper via Guix-patches via
2024-04-15 17:45 64%   ` [bug#70400] [PATCH 4/7] gnu: python-snowballstemmer: Update to 2.2.0 Jonathan Pieper via Guix-patches via
2024-04-15 17:45 65%   ` [bug#70400] [PATCH 5/7] gnu: python-pydocstyle: Update to 6.3.0 Jonathan Pieper via Guix-patches via
2024-04-15 17:45 61%   ` [bug#70400] [PATCH 6/7] gnu: python-rope: Update to 1.13.0 Jonathan Pieper via Guix-patches via
2024-04-15 17:45 55%   ` [bug#70400] [PATCH 7/7] gnu: python-lsp-server: Update to 1.11.0 Jonathan Pieper via Guix-patches via
2024-04-16 12:44     [bug#70416] [PATCH 0/9] Remove uneeded python-pylint package in native-inputs Nicolas Graves via Guix-patches via
2024-04-16 12:59 65% ` [bug#70416] [PATCH 1/9] gnu: python-fastjsonschema: Remove python-pylint native-input Nicolas Graves via Guix-patches via
2024-04-16 12:59 65%   ` [bug#70416] [PATCH 2/9] gnu: python-trio: " Nicolas Graves via Guix-patches via
2024-04-16 12:59 65%   ` [bug#70416] [PATCH 9/9] gnu: python-mediapy: " Nicolas Graves via Guix-patches via
2024-04-17  5:36     [bug#70431] [PATCH 0/2] Correct some Python dependencies Nicolas Graves via Guix-patches via
2024-04-17  5:40 65% ` [bug#70431] [PATCH 1/2] gnu: contourpy: Correct dependencies Nicolas Graves via Guix-patches via
2024-04-17  5:40 65%   ` [bug#70431] [PATCH 2/2] gnu: python-seaborn: " Nicolas Graves via Guix-patches via
2024-04-20  8:41 61% [bug#70483] [PATCH 1/1] gnu: Add python-robotframework-requests Markku Korkeala
2024-04-23  8:54 60% ` [bug#70483] [PATCH v2 " Markku Korkeala
2024-04-20 23:15     [bug#70488] [PATCH 00/47] Astronomy 2024/02 updates Sharlatan Hellseher
2024-04-20 23:21 63% ` [bug#70489] [PATCH 05/47] gnu: python-pytest-socket: Update to 0.7.0 Sharlatan Hellseher
2024-04-20 23:21 65% ` [bug#70489] [PATCH 06/47] gnu: parfive: Update to 2.1.0 Sharlatan Hellseher
2024-04-20 23:21 65% ` [bug#70489] [PATCH 07/47] gnu: python-exif-read: Update to 3.0.0 Sharlatan Hellseher
2024-04-20 23:21 64% ` [bug#70489] [PATCH 09/47] gnu: Add python-supersmoother Sharlatan Hellseher
2024-04-20 23:22 61% ` [bug#70489] [PATCH 30/47] gnu: Add python-assay Sharlatan Hellseher
2024-04-22 10:14 65% [bug#70513] [PATCH] gnu: i3-autotiling: Update to 1.9.1 Wilko Meyer
2024-04-23  8:18 83% [bug#70528] [PATCH] gnu: jube: Update to version 2.6.1 Romain GARBAGE
2024-04-29 20:40     [bug#70656] [PATCH python-team 1/4] gnu: python-gitpython: Use git-minimal/pinned Christopher Baines
2024-04-29 20:40 65% ` [bug#70656] [PATCH python-team 3/4] gnu: python-pbr: " Christopher Baines
2024-04-29 20:40 65% ` [bug#70656] [PATCH python-team 4/4] gnu: python-versioneer: " Christopher Baines
2024-04-30 13:41     [bug#70672] ["PATCH core-updates" 0/1] Fix python package idle output Jean-Baptiste Note
2024-04-30 13:44 65% ` [bug#70672] ["PATCH core-updates" 1/1] gnu: python: Fix python's idle installation Jean-Baptiste Note

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).