diff options
Diffstat (limited to 'gnu/packages/django.scm')
-rw-r--r-- | gnu/packages/django.scm | 246 |
1 files changed, 111 insertions, 135 deletions
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index d36950dc90..73c5244655 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2018 Vijayalakshmi Vedantham <vijimay12@gmail.com> ;;; Copyright © 2019 Sam <smbaines8@gmail.com> ;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org> +;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -64,8 +65,7 @@ ;; The test-suite tests timezone-dependent functions, thus tzdata ;; needs to be available. (setenv "TZDIR" - (string-append (assoc-ref inputs "tzdata") - "/share/zoneinfo")) + (search-input-directory inputs "share/zoneinfo")) ;; Disable test for incorrect timezone: it only raises the ;; expected error when /usr/share/zoneinfo exists, even though @@ -75,24 +75,13 @@ (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 = ['" - (string-join - (string-split (getenv "PYTHONPATH") #\:) - "','") - "', "))) - - #t)) + all))))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? (with-directory-excursion "tests" - (setenv "PYTHONPATH" - (string-append "..:" (getenv "PYTHONPATH"))) + ;; Tests expect PYTHONPATH to contain the root directory. + (setenv "PYTHONPATH" "..") (invoke "python" "runtests.py" ;; By default tests run in parallel, which may cause ;; various race conditions. Run sequentially for @@ -177,10 +166,10 @@ to the @dfn{don't repeat yourself} (DRY) principle.") `(("python-six" ,python-six) ("python-vobject" ,python-vobject) ("python-werkzeug" ,python-werkzeug) - ("python-dateutil" ,python-dateutil))) + ("python-dateutil" ,python-dateutil) + ("python-django" ,python-django))) (native-inputs - `(("python-django" ,python-django) - ("python-mock" ,python-mock) + `(("python-mock" ,python-mock) ("python-factory-boy" ,python-factory-boy) ("python-tox" ,python-tox) ("python-pytest" ,python-pytest) @@ -215,7 +204,7 @@ commands, additional database fields and admin extensions.") (add-installed-pythonpath inputs outputs) (setenv "PYTHONPATH" (string-append ".:" - (getenv "PYTHONPATH"))) + (getenv "GUIX_PYTHONPATH"))) (invoke "invoke" "test"))))))) (native-inputs `(("python-coverage" ,python-coverage) @@ -261,10 +250,10 @@ that are useful for particular countries or cultures.") (lambda _ (invoke "python" "runtests.py")))))) (native-inputs - `(("python-django" ,python-django) - ("python-mock" ,python-mock))) + `(("python-mock" ,python-mock))) (propagated-inputs - `(("python-six" ,python-six))) + `(("python-django" ,python-django) + ("python-six" ,python-six))) (synopsis "Easy-to-use math field/widget captcha for Django forms") (description "A multi-value-field that presents a human answerable question, @@ -286,6 +275,8 @@ with arguments to the field constructor.") (build-system python-build-system) ;; FIXME: How to make the test templates available to Django? (arguments '(#:tests? #f)) + (propagated-inputs + `(("python-django" ,python-django))) (home-page "https://github.com/divio/django-classy-tags") (synopsis "Class based template tags for Django") (description @@ -314,10 +305,10 @@ when coding custom template tags.") (lambda _ (invoke "python3" "-m" "django" "test" "--settings=tests.settings")))))) (propagated-inputs - `(("python-isort" ,python-isort))) - (native-inputs `(("python-django" ,python-django) - ("python-pytest" ,python-pytest) + ("python-isort" ,python-isort))) + (native-inputs + `(("python-pytest" ,python-pytest) ("python-mock" ,python-mock))) (home-page "https://github.com/jazzband/django-taggit") @@ -339,10 +330,9 @@ when coding custom template tags.") (base32 "14gzp5cv24z0qhxb7f7k7v9jgzpaj4n8yhjq83ynpx8183fs1rz4")))) (build-system python-build-system) - (native-inputs - `(("python-django" ,python-django))) (propagated-inputs - `(("python-pillow" ,python-pillow))) + `(("python-django" ,python-django) + ("python-pillow" ,python-pillow))) (home-page "https://github.com/SmileyChris/easy-thumbnails") (synopsis "Easy thumbnails for Django") (description @@ -372,31 +362,26 @@ size and quality.") (replace 'check (lambda* (#:key tests? inputs outputs #:allow-other-keys) (if tests? - (begin - (add-installed-pythonpath inputs outputs) - (setenv "PYTHONPATH" - (string-append ".:" ;for pytest_django_test - (getenv "PYTHONPATH"))) - (setenv "PYTEST_DJANGO_TEST_RUNNER" "pytest") - (setenv "DJANGO_SETTINGS_MODULE" - "pytest_django_test.settings_sqlite_file") - (invoke "pytest" "-vv" "-k" - ;; FIXME: these tests fail to locate Django templates ... - (string-append "not test_django_not_loaded_without_settings" - " and not test_settings" - ;; ... and this does not discover - ;; 'pytest_django_test'. - " and not test_urls_cache_is_cleared"))) - (format #t "test suite not run~%")) - #t))))) + (begin + (setenv "PYTEST_DJANGO_TEST_RUNNER" "pytest") + (setenv "DJANGO_SETTINGS_MODULE" + "pytest_django_test.settings_sqlite_file") + (invoke "python" "-m" "pytest" "-vv" "-k" + ;; FIXME: these tests fail to locate Django templates ... + (string-append "not test_django_not_loaded_without_settings" + " and not test_settings" + ;; ... and this does not discover + ;; 'pytest_django_test'. + " and not test_urls_cache_is_cleared"))) + (format #t "test suite not run~%"))))))) (native-inputs `(("python-django" ,python-django) ("python-setuptools-scm" ,python-setuptools-scm) ;; For tests. ("python-pytest-xdist" ,python-pytest-xdist-next))) (propagated-inputs - `(("python-pytest" ,python-pytest-6))) - (home-page "https://pytest-django.readthedocs.io/") + `(("python-pytest" ,python-pytest))) + (home-page "https://pytest-django.readthedocs.org/") (synopsis "Django plugin for py.test") (description "Pytest-django is a plugin for py.test that provides a set of useful tools for testing Django applications and projects.") @@ -405,14 +390,14 @@ useful tools for testing Django applications and projects.") (define-public python-django-haystack (package (name "python-django-haystack") - (version "2.8.1") + (version "3.1.1") (source (origin (method url-fetch) (uri (pypi-uri "django-haystack" version)) (sha256 (base32 - "1302fqsrx8w474xk5cmnmg3hjqfprlxnjg9qlg86arsr4v4vqm4b")))) + "10kaa5641cakpra2x3jqgys085gdkjcyns26plfyrmfpjmmpa1bd")))) (build-system python-build-system) (arguments '(#:phases @@ -420,19 +405,20 @@ useful tools for testing Django applications and projects.") (add-after 'unpack 'loosen-verion-restrictions (lambda _ (substitute* "setup.py" - (("geopy.*") "geopy',\n")) - #t)) + (("geopy.*") "geopy\",\n")))) (add-before 'check 'set-gdal-lib-path (lambda* (#:key inputs #:allow-other-keys) (setenv "GDAL_LIBRARY_PATH" (string-append (assoc-ref inputs "gdal") - "/lib")) - #t))) + "/lib")))) + ;; Importing this module requires setting up a Django project. + (delete 'sanity-check)) #:tests? #f)) ; OSError: libgdal.so.27: cannot open shared object file + (propagated-inputs + `(("python-django" ,python-django))) (native-inputs `(("gdal" ,gdal) ("python-coverage" ,python-coverage) - ("python-django" ,python-django) ("python-dateutil" ,python-dateutil) ("python-geopy" ,python-geopy) ("python-mock" ,python-mock) @@ -505,8 +491,9 @@ them do this.") ("python-requests" ,python-requests) ("python-requests-oauthlib" ,python-requests-oauthlib))) (native-inputs - `(("python-django" ,python-django) - ("python-mock" ,python-mock))) + `(("python-mock" ,python-mock))) + (inputs + `(("python-django" ,python-django))) (home-page "https://github.com/pennersr/django-allauth") (synopsis "Set of Django applications addressing authentication") (description @@ -531,10 +518,10 @@ account authentication.") "1m1j2sx7q0blma0miswj3c8hrfi5q4y5cq2b816v8gagy89xgc57")))) (build-system python-build-system) (propagated-inputs - `(("python-sqlparse" ,python-sqlparse))) + `(("python-sqlparse" ,python-sqlparse) + ("python-django" ,python-django))) (native-inputs - `(("python-django" ,python-django) - ("python-django-jinja" ,python-django-jinja) + `(("python-django-jinja" ,python-django-jinja) ("python-html5lib" ,python-html5lib))) (arguments '(#:phases @@ -564,7 +551,8 @@ request and response as a toolbar on the rendered page.") (build-system python-build-system) (arguments '(#:tests? #f)) ;XXX: 'make check' does "echo TODO" (propagated-inputs - `(("python-django-debug-toolbar" ,python-django-debug-toolbar) + `(("python-django" ,python-django) + ("python-django-debug-toolbar" ,python-django-debug-toolbar) ("python-jsonplus" ,python-jsonplus) ("python-six" ,python-six) ("python-sqlalchemy" ,python-sqlalchemy))) @@ -611,10 +599,10 @@ templatetags and a full test suite.") "0fc6i77faxxv1gjlp06lv3kw64b5bhdiypaygfxh5djddgk83fwa")))) (build-system python-build-system) (native-inputs - `(("python-django" ,python-django) - ("python-nose" ,python-nose))) + `(("python-nose" ,python-nose))) (propagated-inputs - `(("python-webassets" ,python-webassets))) + `(("python-django" ,python-django) + ("python-webassets" ,python-webassets))) (home-page "https://github.com/miracle2k/django-assets") (synopsis "Asset management for Django") (description @@ -626,7 +614,7 @@ merging, minifying and compiling CSS and Javascript files.") (define-public python-django-jinja (package (name "python-django-jinja") - (version "2.6.0") + (version "2.9.1") (source (origin (method git-fetch) @@ -636,10 +624,11 @@ merging, minifying and compiling CSS and Javascript files.") (file-name (git-file-name name version)) (sha256 (base32 - "06ldbkfkm6sc0p9sqpjph06gxrqpj78ih3dc2yik2fcba2y5mak1")))) + "0p9pkn6jjzagpnvcrl9c2vjqamkms7ymvyhhmaqqqhrlv89qnzp7")))) (build-system python-build-system) (propagated-inputs - `(("python-jinja2" ,python-jinja2) + `(("python-django" ,python-django) + ("python-jinja2" ,python-jinja2) ("python-pytz" ,python-pytz) ("python-django-pipeline" ,python-django-pipeline))) (arguments @@ -708,7 +697,7 @@ conn_max_age argument to easily enable Django’s connection pool.") (lambda _ (invoke "python" "-m" "django" "test" "-v2" "--settings=tests.settings")))))) - (native-inputs + (propagated-inputs ;; XXX: Picklefield has not been updated in 10+ years and fails tests ;; with Django 3.2. `(("python-django@2.2" ,python-django-2.2))) @@ -730,6 +719,8 @@ conn_max_age argument to easily enable Django’s connection pool.") (arguments ;; XXX: Tests require a Postgres database. `(#:tests? #f)) + (propagated-inputs + `(("python-django" ,python-django))) (home-page "https://github.com/aykut/django-bulk-update") (synopsis "Simple bulk update over Django ORM or with helper function") (description @@ -740,27 +731,25 @@ project aims to bulk update given objects using one query over Django ORM.") (define-public python-django-contact-form (package (name "python-django-contact-form") - (version "1.8.1") + (version "1.9") (source (origin (method url-fetch) (uri (pypi-uri "django-contact-form" version)) (sha256 (base32 - "1zv7bcjfrg32gcsq3bclkld79l6mcy2wcvlj81h7q2ppv1wm8vqs")))) + "1my9hkrylckp5vfqg9b0kncrdlxjnwxll56sdciqn4v19i4wbq1y")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" - (string-append "./build/lib:" - (getenv "PYTHONPATH"))) (invoke "coverage" "run" "--source" "contact_form" "runtests.py")))))) (native-inputs - `(("python-coverage" ,python-coverage) - ("python-django" ,python-django))) + `(("python-coverage" ,python-coverage))) + (propagated-inputs + `(("python-django" ,python-django))) (home-page "https://github.com/ubernostrum/django-contact-form") (synopsis "Contact form for Django") (description @@ -779,10 +768,9 @@ for Django sites.") (base32 "0ccdiv784a5vnpfal36km4dyg12340rwhpr0riyy0k89wfnjn8yi")))) (build-system python-build-system) - (native-inputs - `(("python-django" ,python-django))) (propagated-inputs - `(("python-six" ,python-six))) + `(("python-django" ,python-django) + ("python-six" ,python-six))) (home-page "https://github.com/django/django-contrib-comments") (synopsis "Comments framework") (description @@ -814,18 +802,13 @@ entries, photos, book chapters, or anything else.") (which "env"))))) (replace 'check (lambda*(#:key tests? #:allow-other-keys) - (or - (not tests?) - (begin - (setenv "PYTHONPATH" - (string-append (getcwd) ":" - (getenv "PYTHONPATH"))) - (setenv "DJANGO_SETTINGS_MODULE" "tests.settings") - (invoke "django-admin" "test" "tests")))))))) - (native-inputs - `(("python-django" ,python-django))) + (when tests? + (setenv "DJANGO_SETTINGS_MODULE" "tests.settings") + (invoke "django-admin" "test" "tests" + "--pythonpath=."))))))) (propagated-inputs `(("python-css-html-js-minify" ,python-css-html-js-minify) + ("python-django" ,python-django) ("python-slimit" ,python-slimit) ("python-jsmin" ,python-jsmin))) (home-page @@ -857,14 +840,14 @@ support, and optional data-URI image and font embedding.") (with-directory-excursion "tests" (invoke "python" "runtests.py"))))))) (native-inputs - `(("python-django" ,python-django) - ("python-fakeredis" ,python-fakeredis) + `(("python-fakeredis" ,python-fakeredis) ("python-hiredis" ,python-hiredis) ("python-mock" ,python-mock) ("python-msgpack" ,python-msgpack) ("redis" ,redis))) (propagated-inputs - `(("python-redis" ,python-redis))) + `(("python-django" ,python-django) + ("python-redis" ,python-redis))) (home-page "https://github.com/niwibe/django-redis") (synopsis "Full featured redis cache backend for Django") (description @@ -892,13 +875,13 @@ support, and optional data-URI image and font embedding.") "--settings=django_rq.tests.settings" "--pythonpath=.")))))) (native-inputs - `(("python-django" ,python-django) - ("python-django-redis" ,python-django-redis) + `(("python-django-redis" ,python-django-redis) ("python-mock" ,python-mock) ("python-rq-scheduler" ,python-rq-scheduler) ("redis" ,redis))) (propagated-inputs - `(("python-rq" ,python-rq))) + `(("python-django" ,python-django) + ("python-rq" ,python-rq))) (home-page "https://github.com/ui/django-rq") (synopsis "Django integration with RQ") (description @@ -920,11 +903,10 @@ settings.py and easily use them in your project.") (build-system python-build-system) ;; FIXME: Tests require disque, Redis, MongoDB, Docker. (arguments '(#:tests? #f)) - (native-inputs - `(("python-django" ,python-django))) (propagated-inputs `(("python-arrow" ,python-arrow) ("python-blessed" ,python-blessed) + ("python-django" ,python-django) ("python-django-picklefield" ,python-django-picklefield))) (home-page "https://django-q.readthedocs.io/") (synopsis "Multiprocessing distributed task queue for Django") @@ -948,11 +930,10 @@ using Python multiprocessing.") `(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" (string-append "./test_project:" - "./build/lib:.:" - (getenv "PYTHONPATH"))) - (invoke "django-admin.py" "test" "--settings=settings")))))) - (native-inputs + (invoke "django-admin" + "test" "--settings=test_project.settings" + "--pythonpath=.")))))) + (propagated-inputs `(("python-django" ,python-django))) (home-page "https://github.com/jazzband/django-sortedm2m") (synopsis "Drop-in replacement for django's own ManyToManyField") @@ -977,11 +958,9 @@ the order of added relations.") '(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" (string-append ".:" - (getenv "PYTHONPATH"))) (setenv "DJANGO_SETTINGS_MODULE" "tests.test_settings") - (invoke "django-admin.py" "test" "-v2")))))) - (native-inputs + (invoke "django-admin" "test" "--pythonpath=.")))))) + (propagated-inputs `(("python-django" ,python-django))) (home-page "https://github.com/django-compressor/django-appconf") (synopsis "Handle configuration defaults of packaged Django apps") @@ -1012,17 +991,15 @@ name is purely coincidental.") '(#:phases (modify-phases %standard-phases (replace 'check (lambda _ - (setenv "PYTHONPATH" - (string-append "./tests/test_project:./build/lib:" - (getenv "PYTHONPATH"))) + (setenv "PYTHONPATH" "./tests/test_project") (setenv "DJANGO_SETTINGS_MODULE" "project.settings") (invoke "pytest" "-vv")))))) (native-inputs - `(("python-django" ,python-django) - ("python-pytest" ,python-pytest) + `(("python-pytest" ,python-pytest) ("python-pytest-django" ,python-pytest-django))) (propagated-inputs - `(("django-appconf" ,python-django-appconf))) + `(("python-django" ,python-django) + ("django-appconf" ,python-django-appconf))) (synopsis "Generate JavaScript catalog to static files") (description "A Django app that provides helper for generating JavaScript catalog to @@ -1087,9 +1064,10 @@ Django projects, which allows association of a number of tags with any (invoke "python" "runtests.py" "--nolint") (format #t "test suite not run~%"))))))) (native-inputs - `(("python-django" ,python-django) - ("python-pytest" ,python-pytest) + `(("python-pytest" ,python-pytest) ("python-pytest-django" ,python-pytest-django))) + (propagated-inputs + `(("python-django" ,python-django))) (home-page "https://www.django-rest-framework.org") (synopsis "Toolkit for building Web APIs with Django") (description @@ -1110,10 +1088,9 @@ provides features like a Web-browsable API and authentication policies.") "0vrkli625b5s1wldri3dyrfvqbxg7zxy2pg0rpjixw3b1ndz0ag8")))) (build-system python-build-system) (arguments '(#:tests? #f)) ; Tests not included with release. - (native-inputs - `(("python-django" ,python-django))) (propagated-inputs - `(("python-django-classy-tags" ,python-django-classy-tags) + `(("python-django" ,python-django) + ("python-django-classy-tags" ,python-django-classy-tags) ("python-six" ,python-six))) (home-page "https://github.com/divio/django-sekizai") (synopsis "Template blocks for Django projects") @@ -1142,7 +1119,7 @@ a single block.") (arguments '(;; No included tests #:tests? #f)) - (native-inputs + (propagated-inputs `(("python-django" ,python-django))) (home-page "http://github.com/maraujop/django-crispy-forms") @@ -1217,8 +1194,9 @@ template tag.") (lambda _ (invoke "python" "runtests.py")))))) (native-inputs - `(("python-django" ,python-django) - ("python-mock" ,python-mock))) + `(("python-mock" ,python-mock))) + (propagated-inputs + `(("python-django" ,python-django))) (synopsis "Django test helpers to manage file storage side effects") (description "This project provides tools to help reduce the side effects of using @@ -1250,10 +1228,10 @@ FileFields during tests.") "--settings" "tests.settings"))))))) (native-inputs `(("openldap" ,openldap) - ("python-django" ,python-django) ("python-mock" ,python-mock))) (propagated-inputs - `(("python-ldap" ,python-ldap))) + `(("python-django" ,python-django) + ("python-ldap" ,python-ldap))) (home-page "https://github.com/django-auth-ldap/django-auth-ldap") (synopsis "Django LDAP authentication backend") (description @@ -1271,11 +1249,14 @@ FileFields during tests.") (base32 "06041a8icazzp73kg93c7k1ska12wvkq7fpcad0l0sm1qnxx5yx7")))) (build-system python-build-system) - (arguments '(#:tests? #f)) ;no tests - (native-inputs - `(("python-django" ,python-django))) + (arguments + '(#:tests? #f ;no tests + #:phases (modify-phases %standard-phases + ;; Importing this module requires a Django project. + (delete 'sanity-check)))) (propagated-inputs `(("python-certifi" ,python-certifi) + ("python-django" ,python-django) ("python-elasticsearch" ,python-elasticsearch) ("python-six" ,python-six))) (home-page "https://github.com/cipriantarta/django-logging") @@ -1298,10 +1279,10 @@ to ElasticSearch.") "0jwlbyaxk91fq69g2y0zpfjgmjgh6l0lqm5mhys7m5968lkihvgp")))) (build-system python-build-system) (arguments '(#:tests? #f)) ;XXX: Requires a running PostgreSQL server - (native-inputs - `(("python-django" ,python-django))) (propagated-inputs - `(("python-netaddr" ,python-netaddr) + `(("python-django" ,python-django) + ("python-netaddr" ,python-netaddr) + ("python-psycopg2" ,python-psycopg2) ("python-six" ,python-six))) (home-page "https://github.com/jimfunk/django-postgresql-netfields") (synopsis "PostgreSQL netfields implementation for Django") @@ -1326,29 +1307,24 @@ to ElasticSearch.") (arguments '(#:tests? #f ;FIXME: Django raises "Apps aren't loaded yet"!? #:phases (modify-phases %standard-phases - (add-before 'check 'loosen-requirements + (add-after 'unpack 'loosen-requirements (lambda _ ;; Do not depend on compatibility package for old ;; Python versions. (substitute* "requirements.txt" - (("enum-compat") "")) - #t)) + (("enum-compat") "")))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (if tests? (begin - (setenv "PYTHONPATH" - (string-append "./build/lib:.:" - (getenv "PYTHONPATH"))) (setenv "DJANGO_SETTINGS_MODULE" "test_project.settings") (invoke "pytest" "-vv" "--doctest-modules" "tests/" "url_filter/")) (format #t "test suite not run~%"))))))) - (native-inputs - `(("python-django" ,python-django))) (propagated-inputs `(("python-cached-property" ,python-cached-property) + ("python-django" ,python-django) ("python-six" ,python-six))) (synopsis "Filter data via human-friendly URLs") (description |