;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 Vijayalakshmi Vedantham <vijimay12@gmail.com>
;;; Copyright © 2019 Sam <smbaines8@gmail.com>
-;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
+;;; Copyright © 2022 Pradana Aumars <paumars@courrier.dev>
;;;
;;; This file is part of GNU Guix.
;;;
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
+ #:use-module (guix gexp)
#:use-module (guix build-system python)
+ #:use-module (guix deprecation)
#:use-module (gnu packages)
#:use-module (gnu packages base)
+ #:use-module (gnu packages compression)
#:use-module (gnu packages databases)
#:use-module (gnu packages check)
#:use-module (gnu packages finance)
#:use-module (gnu packages geo)
#:use-module (gnu packages openldap)
#:use-module (gnu packages python)
- #:use-module (gnu packages python-compression)
+ #:use-module (gnu packages python-build)
+ #:use-module (gnu packages python-check)
#:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-web)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages time)
#:use-module (gnu packages xml))
-(define-public python-django
+(define-public python-django-4.0
(package
(name "python-django")
- (version "3.2.6")
+ (version "4.0.7")
(source (origin
(method url-fetch)
(uri (pypi-uri "Django" version))
(sha256
(base32
- "08p0gf1n548fjba76wspcj1jb3li6lr7xi87w2xq7hylr528azzj"))))
+ "0qblhh7s7fcznqr79919yp2d7wiz3ixv39navmifb677dg9mlvcw"))))
(build-system python-build-system)
(arguments
'(#:phases
;; 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
(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
(delete 'wrap))))
;; TODO: Install extras/django_bash_completion.
(native-inputs
- `(("tzdata" ,tzdata-for-tests)
- ;; Remaining packages are test requirements taken from
- ;; tests/requirements/py3.txt
- ("python-docutils" ,python-docutils)
- ;; optional for tests: ("python-geoip2" ,python-geoip2)
- ;; optional for tests: ("python-memcached" ,python-memcached)
- ("python-numpy" ,python-numpy)
- ("python-pillow" ,python-pillow)
- ("python-pyyaml" ,python-pyyaml)
- ;; optional for tests: ("python-selenium" ,python-selenium)
- ("python-tblib" ,python-tblib)))
+ (list tzdata-for-tests
+ ;; Remaining packages are test requirements taken from
+ ;; tests/requirements/py3.txt
+ python-docutils
+ ;; optional for tests: ("python-geoip2" ,python-geoip2)
+ ;; optional for tests: ("python-memcached" ,python-memcached)
+ python-numpy
+ python-pillow
+ python-pyyaml
+ ;; optional for tests: ("python-selenium" ,python-selenium)
+ python-tblib))
(propagated-inputs
- `(("python-asgiref" ,python-asgiref)
- ("python-pytz" ,python-pytz)
- ("python-sqlparse" ,python-sqlparse)
-
- ;; Optional dependencies.
- ("python-argon2-cffi" ,python-argon2-cffi)
- ("python-bcrypt" ,python-bcrypt)
-
- ;; This input is not strictly required, but in practice many Django
- ;; libraries need it for test suites and similar.
- ("python-jinja2" ,python-jinja2)))
+ (list python-asgiref
+ python-sqlparse
+ ;; Optional dependencies.
+ python-argon2-cffi
+ python-bcrypt
+ ;; This input is not strictly required, but in practice many Django
+ ;; libraries need it for test suites and similar.
+ python-jinja2))
+ (native-search-paths
+ ;; Set TZDIR when 'tzdata' is available so that timezone functionality
+ ;; works (mostly) out of the box in containerized environments.
+ ;; Note: This search path actually belongs to 'glibc'.
+ (list (search-path-specification
+ (variable "TZDIR")
+ (files '("share/zoneinfo")))))
(home-page "https://www.djangoproject.com/")
(synopsis "High-level Python Web framework")
(description
(license license:bsd-3)
(properties `((cpe-name . "django")))))
+(define-public python-django-3.2
+ (package
+ (inherit python-django-4.0)
+ (version "3.2.15")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "Django" version))
+ (sha256
+ (base32
+ "0asqhsw73555wjnvd7769b89q9w96q2k95mcr634mw92m2qk86gp"))))
+ (native-search-paths '()) ;no need for TZDIR
+ (propagated-inputs
+ (modify-inputs (package-propagated-inputs python-django-4.0)
+ ;; Django 4.0 deprecated pytz in favor of Pythons built-in zoneinfo.
+ (append python-pytz)))))
+
+;; archivebox requires django>=3.1.3,<3.2
+(define-public python-django-3.1.14
+ (package
+ (inherit python-django-3.2)
+ (version "3.1.14")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "Django" version))
+ (sha256
+ (base32
+ "0ix3v2wlnplv78zxjrlw8z3hiap2d5mxvk0ny2fc65526shsb93j"))))
+ (propagated-inputs
+ (modify-inputs (package-propagated-inputs python-django-3.2)
+ ;; Django 4.0 deprecated pytz in favor of Pythons built-in zoneinfo.
+ (append python-pytz)))))
+
(define-public python-django-2.2
(package
- (inherit python-django)
- (version "2.2.24")
+ (inherit python-django-3.2)
+ (version "2.2.28")
(source (origin
(method url-fetch)
(uri (pypi-uri "Django" version))
(sha256
(base32
- "1dvx3x85lggm91x7mpvaf9nmpxyz7r97pbpnmr2k1qfy0c7gyf9k"))))
+ "04vl7aivsshzsnn547lm4jdinr67afhdspc40f0c06xzmxbvc002"))))
(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)))))
+ (modify-inputs (package-native-inputs python-django-3.2)
+ (prepend ;; 2.2 requires Selenium for the test suite.
+ python-selenium)))))
+
+;; Use 3.2 LTS as the default until packages gain support for 4.x.
+(define-public python-django python-django-3.2)
(define-public python-django-extensions
(package
(arguments
'(#:tests? #f)) ;XXX: requires a Postgres or MySQL database
(propagated-inputs
- `(("python-six" ,python-six)
- ("python-vobject" ,python-vobject)
- ("python-werkzeug" ,python-werkzeug)
- ("python-dateutil" ,python-dateutil)))
+ (list python-six python-vobject python-werkzeug python-dateutil
+ python-django))
(native-inputs
- `(("python-django" ,python-django)
- ("python-mock" ,python-mock)
- ("python-factory-boy" ,python-factory-boy)
- ("python-tox" ,python-tox)
- ("python-pytest" ,python-pytest)
- ("python-pytest-cov" ,python-pytest-cov)
- ("python-pytest-django" ,python-pytest-django)
- ("python-shortuuid" , python-shortuuid)))
+ (list python-mock
+ python-factory-boy
+ python-tox
+ python-pytest
+ python-pytest-cov
+ python-pytest-django
+ python-shortuuid))
(home-page
"https://github.com/django-extensions/django-extensions")
(synopsis "Custom management extensions for Django")
(add-installed-pythonpath inputs outputs)
(setenv "PYTHONPATH"
(string-append ".:"
- (getenv "PYTHONPATH")))
+ (getenv "GUIX_PYTHONPATH")))
(invoke "invoke" "test")))))))
(native-inputs
- `(("python-coverage" ,python-coverage)
- ("python-invoke" ,python-invoke)
- ("python-pytest-django" ,python-pytest-django)
- ("which" ,which)))
+ (list python-coverage python-invoke python-pytest-django which))
(propagated-inputs
- `(("python-django" ,python-django)
- ("python-stdnum" ,python-stdnum)))
+ (list python-django python-stdnum))
(home-page "https://django-localflavor.readthedocs.io/en/latest/")
(synopsis "Country-specific Django helpers")
(description "Django-LocalFlavor is a collection of assorted pieces of code
(lambda _
(invoke "python" "runtests.py"))))))
(native-inputs
- `(("python-django" ,python-django)
- ("python-mock" ,python-mock)))
+ (list python-mock))
(propagated-inputs
- `(("python-six" ,python-six)))
+ (list python-django python-six))
(synopsis "Easy-to-use math field/widget captcha for Django forms")
(description
"A multi-value-field that presents a human answerable question,
(build-system python-build-system)
;; FIXME: How to make the test templates available to Django?
(arguments '(#:tests? #f))
+ (propagated-inputs
+ (list python-django))
(home-page "https://github.com/divio/django-classy-tags")
(synopsis "Class based template tags for Django")
(description
(lambda _
(invoke "python3" "-m" "django" "test" "--settings=tests.settings"))))))
(propagated-inputs
- `(("python-isort" ,python-isort)))
+ (list python-django python-isort))
(native-inputs
- `(("python-django" ,python-django)
- ("python-pytest" ,python-pytest)
- ("python-mock" ,python-mock)))
+ (list python-pytest python-mock))
(home-page
"https://github.com/jazzband/django-taggit")
(synopsis
(base32
"14gzp5cv24z0qhxb7f7k7v9jgzpaj4n8yhjq83ynpx8183fs1rz4"))))
(build-system python-build-system)
- (native-inputs
- `(("python-django" ,python-django)))
(propagated-inputs
- `(("python-pillow" ,python-pillow)))
+ (list python-django python-pillow))
(home-page "https://github.com/SmileyChris/easy-thumbnails")
(synopsis "Easy thumbnails for Django")
(description
(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)))
+ (list python-django python-setuptools-scm
+ ;; For tests.
+ python-pytest-xdist-next))
(propagated-inputs
- `(("python-pytest" ,python-pytest-6)))
- (home-page "https://pytest-django.readthedocs.io/")
+ (list 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.")
(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
(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
+ (list 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)
- ("python-nose" ,python-nose)
- ("python-requests" ,python-requests)
- ("python-setuptools-scm" ,python-setuptools-scm)
- ("python-pysolr" ,python-pysolr)
- ("python-whoosh" ,python-whoosh)))
+ (list gdal
+ python-coverage
+ python-dateutil
+ python-geopy
+ python-mock
+ python-nose
+ python-requests
+ python-setuptools-scm
+ python-pysolr
+ python-whoosh))
(home-page "http://haystacksearch.org/")
(synopsis "Pluggable search for Django")
(description "Haystack provides modular search for Django. It features a
(lambda _
(invoke "python" "runtests.py"))))))
(native-inputs
- `(("python-django" ,python-django)
- ("python-djangorestframework" ,python-djangorestframework)
- ("python-django-crispy-forms" ,python-django-crispy-forms)
- ("python-mock" ,python-mock)))
+ (list python-django python-django-rest-framework
+ python-django-crispy-forms python-mock))
(home-page "https://django-filter.readthedocs.io/en/latest/")
(synopsis "Reusable Django application to filter querysets dynamically")
(description
(invoke "django-admin" "test" "allauth.tests"
"--pythonpath=."))))))
(propagated-inputs
- `(("python-openid" ,python-openid)
- ("python-requests" ,python-requests)
- ("python-requests-oauthlib" ,python-requests-oauthlib)))
+ (list python-openid python-requests python-requests-oauthlib))
(native-inputs
- `(("python-django" ,python-django)
- ("python-mock" ,python-mock)))
+ (list python-mock))
+ (inputs
+ (list python-django))
(home-page "https://github.com/pennersr/django-allauth")
(synopsis "Set of Django applications addressing authentication")
(description
"1m1j2sx7q0blma0miswj3c8hrfi5q4y5cq2b816v8gagy89xgc57"))))
(build-system python-build-system)
(propagated-inputs
- `(("python-sqlparse" ,python-sqlparse)))
+ (list python-sqlparse python-django))
(native-inputs
- `(("python-django" ,python-django)
- ("python-django-jinja" ,python-django-jinja)
- ("python-html5lib" ,python-html5lib)))
+ (list python-django-jinja python-html5lib))
(arguments
'(#:phases
(modify-phases %standard-phases
(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-jsonplus" ,python-jsonplus)
- ("python-six" ,python-six)
- ("python-sqlalchemy" ,python-sqlalchemy)))
+ (list python-django python-django-debug-toolbar python-jsonplus
+ python-six python-sqlalchemy))
(synopsis "Django Debug Toolbar panel for SQLAlchemy")
(description
"This package completely mimics the default Django Debug Toolbar SQL
'(;; TODO: The django project for the tests is missing from the release.
#:tests? #f))
(inputs
- `(("python-django" ,python-django)))
+ (list python-django))
(home-page "https://github.com/twaddington/django-gravatar")
(synopsis "Gravatar support for Django, improved version")
(description
"0fc6i77faxxv1gjlp06lv3kw64b5bhdiypaygfxh5djddgk83fwa"))))
(build-system python-build-system)
(native-inputs
- `(("python-django" ,python-django)
- ("python-nose" ,python-nose)))
+ (list python-nose))
(propagated-inputs
- `(("python-webassets" ,python-webassets)))
+ (list python-django python-webassets))
(home-page "https://github.com/miracle2k/django-assets")
(synopsis "Asset management for Django")
(description
(define-public python-django-jinja
(package
(name "python-django-jinja")
- (version "2.6.0")
+ (version "2.9.1")
(source
(origin
(method git-fetch)
(file-name (git-file-name name version))
(sha256
(base32
- "06ldbkfkm6sc0p9sqpjph06gxrqpj78ih3dc2yik2fcba2y5mak1"))))
+ "0p9pkn6jjzagpnvcrl9c2vjqamkms7ymvyhhmaqqqhrlv89qnzp7"))))
(build-system python-build-system)
(propagated-inputs
- `(("python-jinja2" ,python-jinja2)
- ("python-pytz" ,python-pytz)
- ("python-django-pipeline" ,python-django-pipeline)))
+ (list python-django python-jinja2 python-pytz python-django-pipeline))
(arguments
'(;; TODO Tests currently fail due to issues with the configuration for
;; django-pipeline
example, explicit calls to callables from templates and better performance.")
(license license:bsd-3)))
-;; JSONField is now built-in to Django, obsoleting this package.
-(define-public python-django-jsonfield
- (deprecated-package "python-django-jsonfield" python-django))
-
(define-public python-dj-database-url
(package
(name "python-dj-database-url")
(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)))
(arguments
;; XXX: Tests require a Postgres database.
`(#:tests? #f))
+ (propagated-inputs
+ (list python-django))
(home-page "https://github.com/aykut/django-bulk-update")
(synopsis "Simple bulk update over Django ORM or with helper function")
(description
(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)))
+ (list python-coverage))
+ (propagated-inputs
+ (list python-django))
(home-page "https://github.com/ubernostrum/django-contact-form")
(synopsis "Contact form for Django")
(description
(base32
"0ccdiv784a5vnpfal36km4dyg12340rwhpr0riyy0k89wfnjn8yi"))))
(build-system python-build-system)
- (native-inputs
- `(("python-django" ,python-django)))
(propagated-inputs
- `(("python-six" ,python-six)))
+ (list python-django python-six))
(home-page "https://github.com/django/django-contrib-comments")
(synopsis "Comments framework")
(description
(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-slimit" ,python-slimit)
- ("python-jsmin" ,python-jsmin)))
+ (list python-css-html-js-minify python-django python-slimit
+ python-jsmin))
(home-page
"https://github.com/jazzband/django-pipeline")
(synopsis "Asset packaging library for Django")
(with-directory-excursion "tests"
(invoke "python" "runtests.py")))))))
(native-inputs
- `(("python-django" ,python-django)
- ("python-fakeredis" ,python-fakeredis)
- ("python-hiredis" ,python-hiredis)
- ("python-mock" ,python-mock)
- ("python-msgpack" ,python-msgpack)
- ("redis" ,redis)))
+ (list python-fakeredis python-hiredis python-mock python-msgpack
+ redis))
(propagated-inputs
- `(("python-redis" ,python-redis)))
+ (list python-django python-redis))
(home-page "https://github.com/niwibe/django-redis")
(synopsis "Full featured redis cache backend for Django")
(description
"--settings=django_rq.tests.settings"
"--pythonpath=."))))))
(native-inputs
- `(("python-django" ,python-django)
- ("python-django-redis" ,python-django-redis)
- ("python-mock" ,python-mock)
- ("python-rq-scheduler" ,python-rq-scheduler)
- ("redis" ,redis)))
+ (list python-django-redis python-mock python-rq-scheduler redis))
(propagated-inputs
- `(("python-rq" ,python-rq)))
+ (list python-django python-rq))
(home-page "https://github.com/ui/django-rq")
(synopsis "Django integration with RQ")
(description
(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-picklefield" ,python-django-picklefield)))
+ (list python-arrow python-blessed python-django
+ python-django-picklefield))
(home-page "https://django-q.readthedocs.io/")
(synopsis "Multiprocessing distributed task queue for Django")
(description
`(#: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
- `(("python-django" ,python-django)))
+ (invoke "django-admin"
+ "test" "--settings=test_project.settings"
+ "--pythonpath=."))))))
+ (propagated-inputs
+ (list python-django))
(home-page "https://github.com/jazzband/django-sortedm2m")
(synopsis "Drop-in replacement for django's own ManyToManyField")
(description
'(#: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
- `(("python-django" ,python-django)))
+ (invoke "django-admin" "test" "--pythonpath=."))))))
+ (propagated-inputs
+ (list python-django))
(home-page "https://github.com/django-compressor/django-appconf")
(synopsis "Handle configuration defaults of packaged Django apps")
(description
'(#: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-django" ,python-pytest-django)))
+ (list python-pytest 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
(setenv "DJANGO_SETTINGS_MODULE" "tagging.tests.settings")
(invoke "django-admin" "test" "--pythonpath=."))))))
(inputs
- `(("python-django" ,python-django)))
+ (list python-django))
(home-page "https://github.com/Fantomas42/django-tagging")
(synopsis "Generic tagging application for Django")
(description "This package provides a generic tagging application for
@code{Model} instance and makes retrieval of tags simple.")
(license license:bsd-3)))
-(define-public python-djangorestframework
+(define-public python-django-rest-framework
(package
- (name "python-djangorestframework")
- (version "3.12.4")
+ (name "python-django-rest-framework")
+ (version "3.13.1")
(source
(origin
(method git-fetch)
(file-name (git-file-name name version))
(sha256
(base32
- "16n17dw35wqv47m8k8fixn0yywrvd6v4r573yr4nx6lbbiyi2cqn"))))
+ "11wfb156yin6mlgcdzfmi267jsq1cld131mxgd13aqsrj06zlray"))))
(build-system python-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- ;; Add a fix from the master branch for compatibility with Django
- ;; 3.2: https://github.com/encode/django-rest-framework/pull/7911
- ;; Remove for versions > 3.12.4.
- (substitute* "tests/test_fields.py"
- (("class MockTimezone:")
- "class MockTimezone(pytz.BaseTzInfo):"))
+ (lambda* (#:key tests? inputs #:allow-other-keys)
(if tests?
- (invoke "python" "runtests.py" "--nolint")
+ (invoke "python" "runtests.py")
(format #t "test suite not run~%")))))))
(native-inputs
- `(("python-django" ,python-django)
- ("python-pytest" ,python-pytest)
- ("python-pytest-django" ,python-pytest-django)))
+ (list python-pytest python-pytest-django tzdata-for-tests))
+ (propagated-inputs
+ (list python-django python-pytz))
(home-page "https://www.django-rest-framework.org")
(synopsis "Toolkit for building Web APIs with Django")
(description
provides features like a Web-browsable API and authentication policies.")
(license license:bsd-2)))
+(define-public python-djangorestframework
+ (deprecated-package "python-djangorestframework" python-django-rest-framework))
+
(define-public python-django-sekizai
(package
(name "python-django-sekizai")
"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-six" ,python-six)))
+ (list python-django python-django-classy-tags python-six))
(home-page "https://github.com/divio/django-sekizai")
(synopsis "Template blocks for Django projects")
(description "Sekizai means blocks in Japanese, and that is what this app
(arguments
'(;; No included tests
#:tests? #f))
- (native-inputs
- `(("python-django" ,python-django)))
+ (propagated-inputs
+ (list python-django))
(home-page
"http://github.com/maraujop/django-crispy-forms")
(synopsis "Tool to control Django forms without custom templates")
;; https://github.com/django-compressor/django-compressor/issues/998
#:tests? #f))
(propagated-inputs
- `(("python-django-appconf" ,python-django-appconf)
- ("python-rcssmin" ,python-rcssmin)
- ("python-rjsmin" ,python-rjsmin)))
+ (list python-django-appconf python-rcssmin python-rjsmin))
(native-inputs
- `(("python-beautifulsoup4" ,python-beautifulsoup4)
- ("python-brotli" ,python-brotli)
- ("python-csscompressor" ,python-csscompressor)
- ("python-django-sekizai" ,python-django-sekizai)
- ("python-mock" ,python-mock)))
+ (list python-beautifulsoup4 python-brotli python-csscompressor
+ python-django-sekizai python-mock))
(home-page "https://django-compressor.readthedocs.io/en/latest/")
(synopsis
"Compress linked and inline JavaScript or CSS into single cached files")
(lambda _
(invoke "python" "runtests.py"))))))
(native-inputs
- `(("python-django" ,python-django)
- ("python-mock" ,python-mock)))
+ (list python-mock))
+ (propagated-inputs
+ (list 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
(define-public python-django-auth-ldap
(package
(name "python-django-auth-ldap")
- (version "2.4.0")
+ (version "4.1.0")
(source (origin
(method url-fetch)
(uri (pypi-uri "django-auth-ldap" version))
(sha256
(base32
- "0xk6cxiqz5j3q79bd54x64f26alrlc8p7k9wkp2c768w2k1vzz30"))))
+ "0jd9jms9qpa92fk5n7gqcxjk3zs6ay79r73ann7cw1vqn79lkxvp"))))
(build-system python-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
- (replace 'check
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((openldap (assoc-ref inputs "openldap")))
- ;; The tests need 'slapd' which is installed to the
- ;; libexec directory of OpenLDAP.
- (setenv "SLAPD" (string-append openldap "/libexec/slapd"))
- (setenv "SCHEMA"
- (string-append openldap "/etc/openldap/schema"))
- (invoke "python" "-m" "django" "test"
- "--settings" "tests.settings")))))))
+ (list #:phases
+ #~(modify-phases %standard-phases
+ (replace 'build
+ (lambda _
+ ;; Set file modification times to the early 80's because
+ ;; the Zip format does not support earlier timestamps.
+ (setenv "SOURCE_DATE_EPOCH"
+ (number->string (* 10 366 24 60 60)))
+ (invoke "python" "-m" "build" "--wheel"
+ "--no-isolation" ".")))
+ (replace 'check
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "SLAPD" (search-input-file inputs "/libexec/slapd"))
+ (setenv "SCHEMA"
+ (search-input-directory inputs "etc/openldap/schema"))
+ (invoke "python" "-m" "django" "test"
+ "--settings" "tests.settings")))
+ (replace 'install
+ (lambda _
+ (let ((whl (car (find-files "dist" "\\.whl$"))))
+ (invoke "pip" "--no-cache-dir" "--no-input"
+ "install" "--no-deps" "--prefix" #$output whl)))))))
(native-inputs
- `(("openldap" ,openldap)
- ("python-django" ,python-django)
- ("python-mock" ,python-mock)))
+ (list openldap-2.6 python-wheel python-setuptools-scm python-toml
+
+ ;; These can be removed after <https://bugs.gnu.org/46848>.
+ python-pypa-build python-pip))
(propagated-inputs
- `(("python-ldap" ,python-ldap)))
+ (list python-django python-ldap))
(home-page "https://github.com/django-auth-ldap/django-auth-ldap")
(synopsis "Django LDAP authentication backend")
(description
(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-elasticsearch" ,python-elasticsearch)
- ("python-six" ,python-six)))
+ (list python-certifi python-django python-elasticsearch python-six))
(home-page "https://github.com/cipriantarta/django-logging")
(synopsis "Log requests/responses in various formats")
(description
(define-public python-django-netfields
(package
(name "python-django-netfields")
- (version "1.2.2")
+ (version "1.3.0")
(source (origin
(method url-fetch)
(uri (pypi-uri "django-netfields" version))
(sha256
(base32
- "1c47azr5am0q8g45x0fbn0cay7vyrack6n7k6siliw1j2p0gzi7s"))))
+ "122d0db1f420cwzrd7hynfbnnpqkjj2ridym5mrnj0l736nin5rr"))))
(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-six" ,python-six)))
+ (list python-django python-netaddr python-psycopg2 python-six))
(home-page "https://github.com/jimfunk/django-postgresql-netfields")
(synopsis "PostgreSQL netfields implementation for Django")
(description
(file-name (git-file-name name version))
(sha256
(base32
- "0r4zhqhs8y6cnplwyvcb0zpijizw1ifnszs38n4w8138657f9026"))))
+ "0r4zhqhs8y6cnplwyvcb0zpijizw1ifnszs38n4w8138657f9026"))
+ (modules '((guix build utils)))
+ (snippet
+ ;; Patch for Django 4.0 compatibility, taken from upstream pull
+ ;; request: https://github.com/miki725/django-url-filter/pull/103
+ '(substitute* "url_filter/validators.py"
+ ((" ungettext_lazy")
+ " ngettext_lazy")))))
(build-system python-build-system)
(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-six" ,python-six)))
+ (list python-cached-property python-django python-six))
(synopsis "Filter data via human-friendly URLs")
(description
"The main goal of Django URL Filter is to provide an easy URL interface
and also specify the lookup type for each filter (very much like
Django's filtering system in ORM).")
(license license:expat)))
+
+(define-public python-django-svg-image-form-field
+ (package
+ (name "python-django-svg-image-form-field")
+ (version "1.0.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/artrey/django-svg-image-form-field")
+ (commit (string-append version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "131m545khn8l20j4x2bvlvz36dlbnhj9pc98i2dw72s3bw8pgws0"))))
+ (build-system python-build-system)
+ (propagated-inputs
+ (list python-defusedxml python-django python-pillow))
+ (home-page "https://github.com/artrey/django-svg-image-form-field")
+ (synopsis "Form field to validate SVG and other images")
+ (description "This form field allows users to provide SVG images for
+models that use Django's standard @code{ImageField}, in addition to the
+image files already supported by it.")
+ (license license:expat)))
+
+(define-public python-django-cleanup
+ (package
+ (name "python-django-cleanup")
+ (version "6.0.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/un1t/django-cleanup")
+ (commit (string-append version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0c1nghn1bnlq0a4d3sy3s363ksqsnxksixbimdy3cc6a0vk4sjps"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-tests-settings
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; django-cleanup optionally integrates with
+ ;; sorl-thumbnail, which is not available in Guix yet, so
+ ;; this patch comments it out to avoid import failures in
+ ;; test settings.
+ (substitute* "django_cleanup/testapp/settings.py"
+ (("'sorl\\.thumbnail',") "# 'sorl.thumbnail',"))))
+ (replace 'check
+ (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (when tests?
+ (add-installed-pythonpath inputs outputs)
+ ;; Add CWD to PYTHONPATH so that the tests can find the
+ ;; testapp package in the source.
+ (setenv "PYTHONPATH" (getcwd))
+ (invoke "pytest")))))))
+ (native-inputs
+ (list ;; python-django-sorl-thumbnail ; TODO: Add to Guix.
+ python-easy-thumbnails
+ python-pillow
+ python-pytest
+ python-pytest-cov
+ python-pytest-django
+ python-pytest-xdist))
+ (propagated-inputs
+ (list python-django))
+ (home-page "https://github.com/un1t/django-cleanup")
+ (synopsis "Automatically deletes unused media files")
+ (description "This application automatically deletes user-uploaded
+files when a model is modified or deleted. It works for FileField,
+ImageField and their subclasses. Files set as default values for any
+FileField are not deleted.")
+ (license license:expat)))