2016-08-22 13:31:36 +02:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
|
|
|
|
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
2016-09-11 20:30:55 +02:00
|
|
|
|
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
|
2016-08-22 13:31:36 +02:00
|
|
|
|
;;;
|
|
|
|
|
;;; This file is part of GNU Guix.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
|
;;; your option) any later version.
|
|
|
|
|
;;;
|
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
|
;;;
|
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
(define-module (gnu packages django)
|
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module (guix download)
|
|
|
|
|
#:use-module (guix build-system python)
|
|
|
|
|
#:use-module (gnu packages)
|
|
|
|
|
#:use-module (gnu packages base)
|
|
|
|
|
#:use-module (gnu packages python))
|
|
|
|
|
|
|
|
|
|
(define-public python-django
|
|
|
|
|
(package
|
|
|
|
|
(name "python-django")
|
2017-04-04 18:00:12 +02:00
|
|
|
|
(version "1.10.7")
|
2016-08-22 13:31:36 +02:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (pypi-uri "Django" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2017-04-04 18:00:12 +02:00
|
|
|
|
"1f5hnn2dzfr5szk4yc47bs4kk2nmrayjcvgpqi2s4l13pjfpfgar"))))
|
2016-08-22 13:31:36 +02:00
|
|
|
|
(build-system python-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
'(#:phases
|
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
|
(add-before 'check 'set-tzdir
|
|
|
|
|
(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 _
|
|
|
|
|
(setenv "PYTHONPATH"
|
|
|
|
|
(string-append ".:" (getenv "PYTHONPATH")))
|
|
|
|
|
(zero? (system* "python" "tests/runtests.py")))))))
|
|
|
|
|
;; TODO: Install extras/django_bash_completion.
|
2016-09-15 22:07:29 +02:00
|
|
|
|
(native-inputs
|
|
|
|
|
`(("tzdata", tzdata)
|
|
|
|
|
;; bcrypt and argon2-cffi are extra requirements not yet in guix
|
2016-08-22 13:31:36 +02:00
|
|
|
|
;;("python-argon2-cffi" ,python-argon2-cffi) ; >= 16.1.0
|
|
|
|
|
;;("python-bcrypt" ,python-bcrypt) ; not py-bcrypt!
|
2016-09-15 22:07:29 +02:00
|
|
|
|
;; Remaining packages are test requirements taken from
|
|
|
|
|
;; tests/requirements/py3.txt
|
2016-08-22 13:31:36 +02:00
|
|
|
|
("python-docutils" ,python-docutils)
|
|
|
|
|
;; optional for tests: ("python-geoip2" ,python-geoip2)
|
|
|
|
|
("python-jinja2" ,python-jinja2) ; >= 2.7
|
|
|
|
|
;; optional for tests: ("python-memcached" ,python-memcached)
|
|
|
|
|
("python-numpy" ,python-numpy)
|
|
|
|
|
("python-pillow" ,python-pillow)
|
|
|
|
|
("python-pyyaml" ,python-pyyaml)
|
|
|
|
|
("python-pytz" ,python-pytz)
|
|
|
|
|
;; optional for tests: ("python-selenium" ,python-selenium)
|
|
|
|
|
("python-sqlparse" ,python-sqlparse)
|
|
|
|
|
("python-tblib" ,python-tblib)))
|
|
|
|
|
(home-page "http://www.djangoproject.com/")
|
|
|
|
|
(synopsis "High-level Python Web framework")
|
|
|
|
|
(description
|
|
|
|
|
"Django is a high-level Python Web framework that encourages rapid
|
|
|
|
|
development and clean, pragmatic design. It provides many tools for building
|
|
|
|
|
any Web site. Django focuses on automating as much as possible and adhering
|
|
|
|
|
to the @dfn{don't repeat yourself} (DRY) principle.")
|
|
|
|
|
(license license:bsd-3)
|
2017-04-04 18:30:52 +02:00
|
|
|
|
(properties `((python2-variant . ,(delay python2-django))
|
|
|
|
|
(cpe-name . "django")))))
|
2016-08-22 13:31:36 +02:00
|
|
|
|
|
|
|
|
|
(define-public python2-django
|
|
|
|
|
(let ((base (package-with-python2 (strip-python2-variant python-django))))
|
|
|
|
|
(package
|
|
|
|
|
(inherit base)
|
2016-09-15 22:07:29 +02:00
|
|
|
|
(native-inputs
|
|
|
|
|
`(;; Test requirements for Python 2 taken from
|
|
|
|
|
;; tests/requirements/py3.txt: enum34 and mock.
|
2016-08-22 13:31:36 +02:00
|
|
|
|
("python2-enum34" ,python2-enum34)
|
|
|
|
|
("python2-mock" ,python2-mock)
|
|
|
|
|
;; When adding memcached mind: for Python 2 memcached <= 1.53 is
|
|
|
|
|
;; required.
|
2016-09-22 21:04:05 +02:00
|
|
|
|
,@(package-native-inputs base))))))
|
2016-08-22 13:31:37 +02:00
|
|
|
|
|
|
|
|
|
(define-public python-django-simple-math-captcha
|
|
|
|
|
(package
|
|
|
|
|
(name "python-django-simple-math-captcha")
|
|
|
|
|
(version "1.0.7")
|
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (pypi-uri "django-simple-math-captcha" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"0906hms6y6znjhpd0g4wmzv9vcla4brkdpsm4zha9zdj8g5vq2hd"))))
|
|
|
|
|
(build-system python-build-system)
|
2016-12-14 12:40:13 +01:00
|
|
|
|
(arguments
|
|
|
|
|
;; FIXME: Upstream uses a 'runtests.py' script that is not
|
|
|
|
|
;; present in the pypi tarball.
|
|
|
|
|
'(#:tests? #f))
|
2016-08-22 13:31:37 +02:00
|
|
|
|
(propagated-inputs
|
|
|
|
|
`(("python-django" ,python-django)))
|
|
|
|
|
(home-page "https://github.com/alsoicode/django-simple-math-captcha")
|
|
|
|
|
(synopsis "Easy-to-use math field/widget captcha for Django forms")
|
|
|
|
|
(description
|
|
|
|
|
"A multi-value-field that presents a human answerable question,
|
|
|
|
|
with no settings.py configuration necessary, but instead can be configured
|
|
|
|
|
with arguments to the field constructor.")
|
|
|
|
|
(license license:asl2.0)))
|
|
|
|
|
|
|
|
|
|
(define-public python2-django-simple-math-captcha
|
|
|
|
|
(package-with-python2 python-django-simple-math-captcha))
|
2016-09-11 20:30:55 +02:00
|
|
|
|
|
|
|
|
|
(define-public python-pytest-django
|
|
|
|
|
(package
|
|
|
|
|
(name "python-pytest-django")
|
|
|
|
|
(version "2.9.1")
|
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (pypi-uri "pytest-django" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"1mmc7zsz3dlhs6sx4sppkj1vgshabi362r1a8b8wpj1qfximpqcb"))))
|
|
|
|
|
(build-system python-build-system)
|
|
|
|
|
(arguments
|
2016-12-15 18:19:34 +01:00
|
|
|
|
`(#:tests? #f ; FIXME: How to run tests?
|
|
|
|
|
#:phases
|
2016-09-11 20:30:55 +02:00
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
|
(add-after 'unpack 'patch-setuppy
|
|
|
|
|
(lambda _
|
|
|
|
|
(substitute* "setup.py"
|
|
|
|
|
(("setuptools_scm==1.8.0") "setuptools_scm"))
|
|
|
|
|
#t)))))
|
|
|
|
|
(native-inputs
|
2016-10-27 21:27:31 +02:00
|
|
|
|
`(("python-django" ,python-django)
|
|
|
|
|
("python-setuptools-scm" ,python-setuptools-scm)))
|
gnu: Fix python inputs, part 1: all inputs become propagated-inputs.
This patch contains the changes where all [inputs] are changed to
[propagated-inputs]
* gnu/packages/python.scm (python-passlib, python-paramiko, python-ccm,
python-babel, python-keyring python-pandas, python-tzlocal,
python-parse-type, python-nose2, python-pytest, python-pytest-mock,
python-pytest-xdist, python-scripttest, python-testtools, python-pytest-cov,
python-testscenarios, python-pbr-0.11, python-oauthlib, python-jinja2,
python-sphinx, python-tzlocal, python-bugz, python2-pytest-mock, behave,
pelican, sqlalchemy-utils, python-pygridtools, python-urwidtrees,
python-tornado, python2-tornado, python-debian, python-execnet,
python-pytest-cache, pytest-localserver, python-clint, python-rply,
python-hy, python-rauth, python-rsa, python-celery, python-vobject, s3cmd,
python-prompt-toolkit, ptpython, python-requests-oauthlib, python-stem,
python-binaryornot, python2-binaryornot, python-nltk, python-pymongo,
python-schematics, python-url, python2-url, python-freezegun,
python-glances, python-graphql-core, python-graphql-relay, python-graphene,
python-nautilus, python-s3transfer): All [inputs] become
[propagated-inputs].
* gnu/packages/bioinformatics.scm (python-biopython): Likewise.
* gnu/packages/django.scm (pytest-django): Likewise.
* gnu/packages/mail.scm (python-mailmanclient): Likewise.
* gnu/packages/password-utils.scm (python-bcrypt): Likewise.
* gnu/packages/propbuf.scm (python-protobuf): Likewise.
* gnu/packages/rdf.scm (python-rdflib): Likewise.
SQACH all become propagated
2016-10-13 13:33:43 +02:00
|
|
|
|
(propagated-inputs
|
2016-10-23 22:22:34 +02:00
|
|
|
|
`(("python-pytest" ,python-pytest)))
|
2016-09-11 20:30:55 +02:00
|
|
|
|
(home-page "http://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.")
|
|
|
|
|
(license license:bsd-3)))
|
|
|
|
|
|
|
|
|
|
(define-public python2-pytest-django
|
gnu: Remove python-setuptools and python2-setuptools from inputs (part 4a)
This patch contains the changes for all modules beside python.scm where
setuptools are used in an inherited package and removing this input also
removes the need for inheriting the package. This is the case if adding
setuptools in the inherited package was the only change.
Change this to not inherit and remove the new needless call to
"strip-python2-variant (if applicable).
* gnu/packages/bioinformatics.scm (python-biopython, python2-biopython,
python-twobitreader, python2-twobitreader,
python-plastid, python2-plastid,
python2-pybigwig,
python2-screed,
sra-tools): No longer "inherit" Python 2 packages
inheriting from a Python 3 package if the sole reason for inheriting was
adding python-setuptools respective python2-setuptools to [inputs],
[native-inputs] or [propagated-inputs]. Remove now needless [properties]
"python2-variant" where applicable.
* gnu/packages/django.scm (python-pytest-django, python2-pytest-django,
python-django-filter, python2-django-filter): Likewise.
* gnu/packages/gnupg.scm (python2-pygpgme): Likewise.
* gnu/packages/mail.scm (python-mailmanclient, python2-mailmanclient):
Likewise.
* gnu/packages/mpd.scm (python-msp, python2-mpd2): Likewise.
* gnu/packages/music.scm (python-pylast, python2-pylast): Likewise.
* gnu/packages/openstack.scm (python-requests-mock, python2-requests-mock,
python2-git-review): Likewise.
* gnu/packages/password-utils.scm (python2-bcrypt): Likewise.
* gnu/packages/protobuf.scm (python-protobuf, python2-protobuf): Likewise.
* gnu/packages/statistics.scm (python-patsy, python2-patsy): Likewise.
* gnu/packages/web.scm (python2-feedparser): Likewise.
2016-09-28 13:57:21 +02:00
|
|
|
|
(package-with-python2 python-pytest-django))
|
2016-09-11 20:31:44 +02:00
|
|
|
|
|
|
|
|
|
(define-public python-django-filter
|
|
|
|
|
(package
|
|
|
|
|
(name "python-django-filter")
|
|
|
|
|
(version "0.14.0")
|
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (pypi-uri "django-filter" version))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
|
|
|
|
"0f78hmk8c903zwfzlsiw7ivgag81ymmb5hi73rzxbhnlg2v0l3fx"))))
|
|
|
|
|
(build-system python-build-system)
|
2016-12-14 12:43:36 +01:00
|
|
|
|
(arguments
|
|
|
|
|
'(#:phases
|
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
|
(replace 'check
|
|
|
|
|
(lambda _
|
|
|
|
|
(zero? (system* "python" "runtests.py")))))))
|
2016-10-27 21:18:30 +02:00
|
|
|
|
(native-inputs
|
|
|
|
|
`(("python-django" ,python-django)
|
|
|
|
|
("python-mock" ,python-mock)))
|
2016-09-11 20:31:44 +02:00
|
|
|
|
(home-page "https://django-filter.readthedocs.io/en/latest/")
|
|
|
|
|
(synopsis "Reusable Django application to filter querysets dynamically")
|
|
|
|
|
(description
|
|
|
|
|
"Django-filter is a generic, reusable application to alleviate writing
|
|
|
|
|
some of the more mundane bits of view code. Specifically, it allows users to
|
|
|
|
|
filter down a queryset based on a model’s fields, displaying the form to let
|
|
|
|
|
them do this.")
|
|
|
|
|
(license license:bsd-3)))
|
|
|
|
|
|
|
|
|
|
(define-public python2-django-filter
|
gnu: Remove python-setuptools and python2-setuptools from inputs (part 4a)
This patch contains the changes for all modules beside python.scm where
setuptools are used in an inherited package and removing this input also
removes the need for inheriting the package. This is the case if adding
setuptools in the inherited package was the only change.
Change this to not inherit and remove the new needless call to
"strip-python2-variant (if applicable).
* gnu/packages/bioinformatics.scm (python-biopython, python2-biopython,
python-twobitreader, python2-twobitreader,
python-plastid, python2-plastid,
python2-pybigwig,
python2-screed,
sra-tools): No longer "inherit" Python 2 packages
inheriting from a Python 3 package if the sole reason for inheriting was
adding python-setuptools respective python2-setuptools to [inputs],
[native-inputs] or [propagated-inputs]. Remove now needless [properties]
"python2-variant" where applicable.
* gnu/packages/django.scm (python-pytest-django, python2-pytest-django,
python-django-filter, python2-django-filter): Likewise.
* gnu/packages/gnupg.scm (python2-pygpgme): Likewise.
* gnu/packages/mail.scm (python-mailmanclient, python2-mailmanclient):
Likewise.
* gnu/packages/mpd.scm (python-msp, python2-mpd2): Likewise.
* gnu/packages/music.scm (python-pylast, python2-pylast): Likewise.
* gnu/packages/openstack.scm (python-requests-mock, python2-requests-mock,
python2-git-review): Likewise.
* gnu/packages/password-utils.scm (python2-bcrypt): Likewise.
* gnu/packages/protobuf.scm (python-protobuf, python2-protobuf): Likewise.
* gnu/packages/statistics.scm (python-patsy, python2-patsy): Likewise.
* gnu/packages/web.scm (python2-feedparser): Likewise.
2016-09-28 13:57:21 +02:00
|
|
|
|
(package-with-python2 python-django-filter))
|