gnu: python-django: Update to 3.1.1.
* 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.
This commit is contained in:
parent
b2eafc7d8d
commit
ac3103e8f3
3 changed files with 50 additions and 21 deletions
|
@ -6,6 +6,7 @@
|
||||||
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
|
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
|
||||||
;;; Copyright © 2018 Vijayalakshmi Vedantham <vijimay12@gmail.com>
|
;;; Copyright © 2018 Vijayalakshmi Vedantham <vijimay12@gmail.com>
|
||||||
;;; Copyright © 2019 Sam <smbaines8@gmail.com>
|
;;; Copyright © 2019 Sam <smbaines8@gmail.com>
|
||||||
|
;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -45,43 +46,55 @@
|
||||||
(define-public python-django
|
(define-public python-django
|
||||||
(package
|
(package
|
||||||
(name "python-django")
|
(name "python-django")
|
||||||
(version "1.11.29")
|
(version "3.1.1")
|
||||||
(source (origin
|
(source (origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (pypi-uri "Django" version))
|
(uri (pypi-uri "Django" version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"171jsi54fbnxzi2n3l4hkdmmwfnfrwacs180rw59l0bqcvxsw022"))))
|
"0bzwy58hrxbsh7szak1yfh7qvvfnpdpi8ay1x7d3pvbkm1f15j2r"))))
|
||||||
(build-system python-build-system)
|
(build-system python-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
'(#:modules ((srfi srfi-1)
|
'(#:phases
|
||||||
(guix build python-build-system)
|
|
||||||
(guix build utils))
|
|
||||||
#:phases
|
|
||||||
(modify-phases %standard-phases
|
(modify-phases %standard-phases
|
||||||
(add-before 'check 'set-tzdir
|
(add-before 'check 'pre-check
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
;; The test-suite tests timezone-dependent functions, thus tzdata
|
;; The test-suite tests timezone-dependent functions, thus tzdata
|
||||||
;; needs to be available.
|
;; needs to be available.
|
||||||
(setenv "TZDIR"
|
(setenv "TZDIR"
|
||||||
(string-append (assoc-ref inputs "tzdata")
|
(string-append (assoc-ref inputs "tzdata")
|
||||||
"/share/zoneinfo"))
|
"/share/zoneinfo"))
|
||||||
#t))
|
|
||||||
(replace 'check
|
;; Disable test for incorrect timezone: it only raises the
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
;; expected error when /usr/share/zoneinfo exists, even though
|
||||||
(setenv "PYTHONPATH"
|
;; the machinery gracefully falls back to TZDIR. According to
|
||||||
(string-append ".:" (getenv "PYTHONPATH")))
|
;; 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"
|
(substitute* "tests/admin_scripts/tests.py"
|
||||||
(("python_path = \\[")
|
(("python_path = \\[")
|
||||||
(string-append "python_path = ['"
|
(string-append "python_path = ['"
|
||||||
(find (lambda (entry)
|
(string-join
|
||||||
(string-prefix?
|
(string-split (getenv "PYTHONPATH") #\:)
|
||||||
(assoc-ref inputs "python-pytz")
|
"','")
|
||||||
entry))
|
|
||||||
(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.
|
;; TODO: Install extras/django_bash_completion.
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("tzdata" ,tzdata-for-tests)
|
`(("tzdata" ,tzdata-for-tests)
|
||||||
|
@ -99,6 +112,7 @@
|
||||||
("python-tblib" ,python-tblib)))
|
("python-tblib" ,python-tblib)))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
`(("python-argon2-cffi" ,python-argon2-cffi)
|
`(("python-argon2-cffi" ,python-argon2-cffi)
|
||||||
|
("python-asgiref" ,python-asgiref)
|
||||||
("python-bcrypt" ,python-bcrypt)
|
("python-bcrypt" ,python-bcrypt)
|
||||||
("python-pytz" ,python-pytz)))
|
("python-pytz" ,python-pytz)))
|
||||||
(home-page "https://www.djangoproject.com/")
|
(home-page "https://www.djangoproject.com/")
|
||||||
|
@ -125,6 +139,21 @@ to the @dfn{don't repeat yourself} (DRY) principle.")
|
||||||
;; required.
|
;; required.
|
||||||
,@(package-native-inputs base))))))
|
,@(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
|
(define-public python-django-extensions
|
||||||
(package
|
(package
|
||||||
(name "python-django-extensions")
|
(name "python-django-extensions")
|
||||||
|
|
|
@ -3118,7 +3118,7 @@ which sends emails to HyperKitty, the official Mailman3 web archiver.")
|
||||||
"--settings=hyperkitty.tests.settings_test"))))))
|
"--settings=hyperkitty.tests.settings_test"))))))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
`(("python-dateutil" ,python-dateutil)
|
`(("python-dateutil" ,python-dateutil)
|
||||||
("python-django" ,python-django)
|
("python-django" ,python-django-2.2)
|
||||||
("python-django-compressor" ,python-django-compressor)
|
("python-django-compressor" ,python-django-compressor)
|
||||||
("python-django-extensions" ,python-django-extensions)
|
("python-django-extensions" ,python-django-extensions)
|
||||||
("python-django-gravatar2" ,python-django-gravatar2)
|
("python-django-gravatar2" ,python-django-gravatar2)
|
||||||
|
|
|
@ -467,7 +467,7 @@ if __name__ == \"__main__\":
|
||||||
(inputs
|
(inputs
|
||||||
`(("python-wrapper" ,python-wrapper)))
|
`(("python-wrapper" ,python-wrapper)))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
`(("python-django" ,python-django)
|
`(("python-django" ,python-django-2.2)
|
||||||
;; TODO: Make this configurable
|
;; TODO: Make this configurable
|
||||||
("python-psycopg2" ,python-psycopg2)
|
("python-psycopg2" ,python-psycopg2)
|
||||||
("python-mysqlclient" ,python-mysqlclient)
|
("python-mysqlclient" ,python-mysqlclient)
|
||||||
|
|
Reference in a new issue