From 0ae29db11d0c4a92d12b6cc604c868882336aced Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 6 Jun 2023 13:04:14 +0200 Subject: [PATCH] gnu: python-anaconda-client: Fix build with Python 3.10. * gnu/packages/package-management.scm (python-anaconda-client)[build-system]: Use pyproject-bulid-system. [arguments]: Move contents of 'remove-network-tests phase to #:test-flags; drop trailing #T from 'set-HOME phase; add phase 'python3.10-compatibility; disable test_conda_root and test_conda_root_outside_root_environment. --- gnu/packages/package-management.scm | 53 +++++++++++++++++------------ 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index a856ff2726..9532fd7187 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013-2023 Ludovic Courtès -;;; Copyright © 2015, 2017, 2020, 2021, 2022 Ricardo Wurmus +;;; Copyright © 2015, 2017, 2020, 2021, 2022, 2023 Ricardo Wurmus ;;; Copyright © 2017 Muriithi Frederick Muriuki ;;; Copyright © 2017, 2018 Oleg Pykhalov ;;; Copyright © 2017 Roel Janssen @@ -120,6 +120,7 @@ (define-module (gnu packages package-management) #:use-module (guix build-system gnu) #:use-module (guix build-system guile) #:use-module (guix build-system meson) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system ruby) #:use-module (guix build-system trivial) @@ -917,7 +918,34 @@ (define-public python-anaconda-client (sha256 (base32 "1vyk0g0gci4z9psisb8h50zi3j1nwfdg1jw3j76cxv0brln0v3fw")))) - (build-system python-build-system) + (build-system pyproject-build-system) + (arguments + (list + #:test-flags + ;; These tests require a network connection + '(append (map (lambda (file) + (string-append "--ignore=binstar_client/" file)) + (list "tests/test_upload.py" + "tests/test_authorizations.py" + "tests/test_login.py" + "tests/test_whoami.py" + "utils/notebook/tests/test_data_uri.py" + "utils/notebook/tests/test_base.py" + "utils/notebook/tests/test_downloader.py" + "inspect_package/tests/test_conda.py")) + ;; get_conda_root returns None + (list "-k" + "not test_conda_root \ +and not test_conda_root_outside_root_environment")) + #:phases + '(modify-phases %standard-phases + (add-after 'unpack 'python3.10-compatibility + (lambda _ + (substitute* "binstar_client/utils/config.py" + (("collections.Mapping") "collections.abc.Mapping")))) + ;; This is needed for some tests. + (add-before 'check 'set-HOME + (lambda _ (setenv "HOME" "/tmp")))))) (propagated-inputs (list python-clyent python-nbformat python-pyyaml python-requests)) (native-inputs @@ -926,27 +954,8 @@ (define-public python-anaconda-client python-freezegun python-mock python-pillow + python-pytest python-pytz)) - (arguments - `(#:phases - (modify-phases %standard-phases - ;; This is needed for some tests. - (add-before 'check 'set-up-home - (lambda* _ (setenv "HOME" "/tmp") #t)) - (add-before 'check 'remove-network-tests - (lambda* _ - ;; Remove tests requiring a network connection - (let ((network-tests '("tests/test_upload.py" - "tests/test_authorizations.py" - "tests/test_login.py" - "tests/test_whoami.py" - "utils/notebook/tests/test_data_uri.py" - "utils/notebook/tests/test_base.py" - "utils/notebook/tests/test_downloader.py" - "inspect_package/tests/test_conda.py"))) - (with-directory-excursion "binstar_client" - (for-each delete-file network-tests))) - #t))))) (home-page "https://github.com/Anaconda-Platform/anaconda-client") (synopsis "Anaconda Cloud command line client library") (description