From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OL0NDHbbXF+4RwAA0tVLHw (envelope-from ) for ; Sat, 12 Sep 2020 14:30:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id C5ZgBnbbXF/gQgAAB5/wlQ (envelope-from ) for ; Sat, 12 Sep 2020 14:30:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C676594053D for ; Sat, 12 Sep 2020 14:30:11 +0000 (UTC) Received: from localhost ([::1]:46608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kH6Xa-0002rG-LF for larch@yhetil.org; Sat, 12 Sep 2020 10:30:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kH6XU-0002oq-0T for guix-patches@gnu.org; Sat, 12 Sep 2020 10:30:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37076) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kH6XT-00054f-MZ for guix-patches@gnu.org; Sat, 12 Sep 2020 10:30:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kH6XT-0003t5-I8 for guix-patches@gnu.org; Sat, 12 Sep 2020 10:30:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43354] [PATCH 02/55] gnu: python-django: Update to 3.1.1. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 12 Sep 2020 14:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43354 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43354@debbugs.gnu.org Received: via spool by 43354-submit@debbugs.gnu.org id=B43354.159992097114717 (code B ref 43354); Sat, 12 Sep 2020 14:30:03 +0000 Received: (at 43354) by debbugs.gnu.org; 12 Sep 2020 14:29:31 +0000 Received: from localhost ([127.0.0.1]:48586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kH6Wt-0003p2-DO for submit@debbugs.gnu.org; Sat, 12 Sep 2020 10:29:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kH6Wq-0003oU-Va for 43354@debbugs.gnu.org; Sat, 12 Sep 2020 10:29:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36237) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kH6Wk-00050O-OK for 43354@debbugs.gnu.org; Sat, 12 Sep 2020 10:29:18 -0400 Received: from ti0006q161-3115.bb.online.no ([88.95.106.80]:51740 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kH6Wi-0001Gs-MC for 43354@debbugs.gnu.org; Sat, 12 Sep 2020 10:29:17 -0400 From: Marius Bakke Date: Sat, 12 Sep 2020 16:28:18 +0200 Message-Id: <20200912142911.6231-2-marius@gnu.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200912142911.6231-1-marius@gnu.org> References: <20200912142911.6231-1-marius@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: CZ3vnwEJoMYA * gnu/packages/django.scm (python-django): Update to 3.1.1. [arguments]: Remove #:modules. Rename set-tzdir phase to pre-check, and disable one test. Adjust PYTHONPATH patching to preserve all entries. Ensure the test suite runs sequentially. [propagated-inputs]: Add PYTHON-ASGIREF. (python-django-2.2): New public variable. * gnu/packages/mail.scm (python-hyperkitty)[propagated-inptus]: Change from PYTHON-DJANGO to PYTHON-DJANGO-2.2. * gnu/packages/patchutils.scm (patchwork)[propagated-inputs]: Likewise. --- gnu/packages/django.scm | 67 ++++++++++++++++++++++++++----------- gnu/packages/mail.scm | 2 +- gnu/packages/patchutils.scm | 2 +- 3 files changed, 50 insertions(+), 21 deletions(-) diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index 2370de62f5..662bc110dd 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2017 Ricardo Wurmus ;;; Copyright © 2018 Vijayalakshmi Vedantham ;;; Copyright © 2019 Sam +;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,43 +46,55 @@ (define-public python-django (package (name "python-django") - (version "1.11.29") + (version "3.1.1") (source (origin (method url-fetch) (uri (pypi-uri "Django" version)) (sha256 (base32 - "171jsi54fbnxzi2n3l4hkdmmwfnfrwacs180rw59l0bqcvxsw022")))) + "0bzwy58hrxbsh7szak1yfh7qvvfnpdpi8ay1x7d3pvbkm1f15j2r")))) (build-system python-build-system) (arguments - '(#:modules ((srfi srfi-1) - (guix build python-build-system) - (guix build utils)) - #:phases + '(#:phases (modify-phases %standard-phases - (add-before 'check 'set-tzdir + (add-before 'check 'pre-check (lambda* (#:key inputs #:allow-other-keys) ;; The test-suite tests timezone-dependent functions, thus tzdata ;; needs to be available. (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")) - #t)) - (replace 'check - (lambda* (#:key inputs #:allow-other-keys) - (setenv "PYTHONPATH" - (string-append ".:" (getenv "PYTHONPATH"))) + + ;; Disable test for incorrect timezone: it only raises the + ;; expected error when /usr/share/zoneinfo exists, even though + ;; the machinery gracefully falls back to TZDIR. According to + ;; django/conf/__init__.py, lack of /usr/share/zoneinfo is + ;; harmless, so just ignore this test. + (substitute* "tests/settings_tests/tests.py" + ((".*def test_incorrect_timezone.*" all) + (string-append " @unittest.skipIf(True, 'Disabled by Guix')\n" + all))) + + ;; Preserve the PYTHONPATH created by Guix when running the tests. (substitute* "tests/admin_scripts/tests.py" (("python_path = \\[") (string-append "python_path = ['" - (find (lambda (entry) - (string-prefix? - (assoc-ref inputs "python-pytz") - entry)) - (string-split (getenv "PYTHONPATH") - #\:)) + (string-join + (string-split (getenv "PYTHONPATH") #\:) + "','") "', "))) - (invoke "python" "tests/runtests.py")))))) + + #t)) + (replace 'check + (lambda _ + (with-directory-excursion "tests" + (setenv "PYTHONPATH" + (string-append "..:" (getenv "PYTHONPATH"))) + (invoke "python" "runtests.py" + ;; By default tests run in parallel, which may cause + ;; various race conditions. Run sequentially for + ;; consistent results. + "--parallel=1"))))))) ;; TODO: Install extras/django_bash_completion. (native-inputs `(("tzdata" ,tzdata-for-tests) @@ -99,6 +112,7 @@ ("python-tblib" ,python-tblib))) (propagated-inputs `(("python-argon2-cffi" ,python-argon2-cffi) + ("python-asgiref" ,python-asgiref) ("python-bcrypt" ,python-bcrypt) ("python-pytz" ,python-pytz))) (home-page "https://www.djangoproject.com/") @@ -125,6 +139,21 @@ to the @dfn{don't repeat yourself} (DRY) principle.") ;; required. ,@(package-native-inputs base)))))) +(define-public python-django-2.2 + (package + (inherit python-django) + (version "2.2.16") + (source (origin + (method url-fetch) + (uri (pypi-uri "Django" version)) + (sha256 + (base32 + "1535g2r322cl4x52fb0dmzlbg23539j2wx6027j54p22xvjlbkv2")))) + (native-inputs + `(;; XXX: In 2.2 and 3.0, selenium is required for the test suite. + ("python-selenium" ,python-selenium) + ,@(package-native-inputs python-django))))) + (define-public python-django-extensions (package (name "python-django-extensions") diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index 4a9c6fc90f..15b9b1dd4e 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -3045,7 +3045,7 @@ which sends emails to HyperKitty, the official Mailman3 web archiver.") "--settings=hyperkitty.tests.settings_test")))))) (propagated-inputs `(("python-dateutil" ,python-dateutil) - ("python-django" ,python-django) + ("python-django" ,python-django-2.2) ("python-django-compressor" ,python-django-compressor) ("python-django-extensions" ,python-django-extensions) ("python-django-gravatar2" ,python-django-gravatar2) diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm index c26977be1f..335d251e74 100644 --- a/gnu/packages/patchutils.scm +++ b/gnu/packages/patchutils.scm @@ -467,7 +467,7 @@ if __name__ == \"__main__\": (inputs `(("python-wrapper" ,python-wrapper))) (propagated-inputs - `(("python-django" ,python-django) + `(("python-django" ,python-django-2.2) ;; TODO: Make this configurable ("python-psycopg2" ,python-psycopg2) ("python-mysqlclient" ,python-mysqlclient) -- 2.28.0