Subject: [PATCH] gnu: python-importlib-metadata: Update to 4.11.1.
From: [email-masked]
To: Guix Patches <[email-masked]>
Date: Mon, 21 Feb 2022 05:59:23 +0100 (CET)
List-Id: <debbugs-submit.debbugs.gnu.org>

Tested update with the following command:

guix refresh -l python-importlib-metadata | tr ' ' '\n' | grep '@' | xargs ./pre-inst-env guix build --keep-going --check

Most dependents build fine, there are some more to be fixed.

```
guix build: error: build of `/gnu/store/23zz3gkbcp7rhngx5kqqkifgllnnn87d-orange-3.31.1.drv', `/gnu/store/8g57fz279rsfbp7ygyfdkkigxz6alsd9-python-dolfin-adjoint-2019.1.0.drv', `/gnu/store/hpp2hysd3rjwy9kzbfrip1mjsp7cw42x-jrnl-1.9.7.drv', `/gnu/store/im8523db69cn0zn8d6357fljvnj9h51v-python-pytest-virtualenv-1.7.0.drv', `/gnu/store/jb7dhh6qyl1ywfl560g2fdincqln0j0m-python-behave-web-api-1.0.6.drv', `/gnu/store/k0yar63qm2h4kv8qbl0dbp04c6lvm8kz-python-pysnptools-0.4.11.drv', `/gnu/store/nr9isakhk3bxkl6p5v65gvqahy4n5fmy-dosage-2.17.drv', `/gnu/store/pf79l2hn6brzwl0b1q0bynlh42501s3v-electrum-4.1.5.drv', `/gnu/store/pvnxfjfr9fg0ap8lwia60vs53rgdclrh-gr-satellites-4.2.0.drv', `/gnu/store/qg7mfxcn2ayyq4v4lc1bkxddayfj54bp-gnss-sdr-0.0.15.drv', `/gnu/store/qgc7prgchmwn9hyy36hsn12cyraixvcf-electron-cash-4.2.6.drv', `/gnu/store/sc72sngxh0fbklbn66hly6k6r7zy6fcl-gqrx-2.15.8.drv', `/gnu/store/ympmpv7ci9xav22jaisq9kwrp1qq8w00-onionshare-2.4.drv' failed
```
From 346546faf492951b2b1226615d5cdd738f8dab83 Mon Sep 17 00:00:00 2001
From: kiasoc5 <[email-masked]>
Date: Sun, 20 Feb 2022 15:56:18 -0500
Subject: [PATCH] gnu: python-importlib-metadata: Update to 4.11.1.

* gnu/packages/python-xyz.scm (python-importlib-metadata): Update to 4.11.1.
---
 gnu/packages/python-xyz.scm | 47 +++++++++++++++++++++++++++----------
 1 file changed, 35 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 516fa4057f..f6bbbb408e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -8212,19 +8212,42 @@ (define-public python2-importlib-resources-bootstrap
 (define-public python-importlib-metadata
   (package
     (name "python-importlib-metadata")
-    (version "1.5.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (pypi-uri "importlib_metadata" version))
-       (sha256
-        (base32
-         "00ikdj4gjhankdljnz7g5ggak4k9lql2926x0x117ir9j2lv7x86"))))
+    (version "4.11.1")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "importlib_metadata" version))
+              (sha256
+               (base32
+                "0b05r23934nj0yqd4nm6f1hk34wzhvagidw1imp7ycd083j4wpqp"))))
     (build-system python-build-system)
-    (propagated-inputs
-     (list python-zipp))
-    (native-inputs
-     (list python-setuptools-scm python-pyfakefs python-packaging))
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'set-source-file-times-to-1980 ; make unzip work
+                 (lambda _
+                   (setenv "SOURCE_DATE_EPOCH" "315532800")))
+               (add-before 'check 'fix-tests ; this file uses a python module no distro has packaged
+                 (lambda _
+                   (delete-file "exercises.py")))
+               (replace 'build
+                 (lambda _
+                   (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))
+               (replace 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let ((out (assoc-ref outputs "out"))
+                         (whl (car (find-files "dist" "\\.whl$"))))
+                     (invoke "pip" "--no-cache-dir" "--no-input" "install" "--no-deps" "--prefix"
+                          out whl))))
+               (replace 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (when tests?
+                     (invoke "pytest" "-v")))))))
+    (propagated-inputs (list python-zipp))
+    (native-inputs (list python-setuptools-scm
+                         python-pyfakefs
+                         python-packaging
+                         python-pytest
+                         python-pypa-build))
     (home-page "https://importlib-metadata.readthedocs.io/")
     (synopsis "Read metadata from Python packages")
     (description
-- 
2.35.1