From d18197af7844151e38322605b11e0c75b18b55bf Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Mon, 22 Aug 2016 13:31:36 +0200 Subject: gnu: Add python-django. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/django.scm: New file. * gnu/packages/patches/python-django-fix-testcase.patch: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add django.scm. (dist_patch_DATA): Add python-django-fix-testcase.patch. Co-authored-by: Ludovic Courtès --- gnu/packages/django.scm | 98 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 gnu/packages/django.scm (limited to 'gnu/packages/django.scm') diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm new file mode 100644 index 0000000000..6acaae2485 --- /dev/null +++ b/gnu/packages/django.scm @@ -0,0 +1,98 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2016 Hartmut Goebel +;;; +;;; 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 . + +(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") + (version "1.10") + (source (origin + (method url-fetch) + (uri (pypi-uri "Django" version)) + (sha256 + (base32 + "01bh5yra6zyxcpqacahbwfbn0y4ivw07j2jsw3crvmjzivb6if26")) + (patches (search-patches "python-django-fix-testcase.patch")))) + (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. + (native-inputs + ;; Django uses 'pkg_resources' (part of setuptools) to locate templates + ;; at run-time. + `(("python-setuptools" ,python-setuptools) + ("tzdata", tzdata))) + (propagated-inputs + `( ;; bcrypt and argon2-cffi are extra requirements not yet in guix + ;;("python-argon2-cffi" ,python-argon2-cffi) ; >= 16.1.0 + ;;("python-bcrypt" ,python-bcrypt) ; not py-bcrypt! + ;; Taken from tests/requirements/py3.txt. + ("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) + (properties `((python2-variant . ,(delay python2-django)))))) + +(define-public python2-django + (let ((base (package-with-python2 (strip-python2-variant python-django)))) + (package + (inherit base) + (propagated-inputs + `(;; Required for Python 2: enum34 and mock. + ("python2-enum34" ,python2-enum34) + ("python2-mock" ,python2-mock) + ;; When adding memcached mind: for Python 2 memcached <= 1.53 is + ;; required. + ,@(package-inputs base)))))) -- cgit 1.4.1 From b53fc2940fefc3829695f239f731ee6f03e538a2 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Mon, 22 Aug 2016 13:31:37 +0200 Subject: gnu: Add python-django-simple-math-captcha. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/django.scm: (python-django-simple-math-captcha) (python2-django-simple-math-captcha): New variables. Signed-off-by: Ludovic Courtès --- gnu/packages/django.scm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gnu/packages/django.scm') diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index 6acaae2485..b9232e28e8 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -96,3 +96,29 @@ to the @dfn{don't repeat yourself} (DRY) principle.") ;; When adding memcached mind: for Python 2 memcached <= 1.53 is ;; required. ,@(package-inputs base)))))) + +(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) + (propagated-inputs + `(("python-django" ,python-django))) + (native-inputs + `(("python-setuptools" ,python-setuptools))) + (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)) -- cgit 1.4.1 From 23b563dcfdc269b51c4bb671d9ba226c8f70e6a3 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 11 Sep 2016 21:30:55 +0300 Subject: gnu: Add python-pytest-django. * gnu/packages/django.scm (python-pytest-django): New variable. --- gnu/packages/django.scm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'gnu/packages/django.scm') diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index b9232e28e8..bd39314b00 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 Hartmut Goebel +;;; Copyright © 2016 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -122,3 +123,42 @@ with arguments to the field constructor.") (define-public python2-django-simple-math-captcha (package-with-python2 python-django-simple-math-captcha)) + +(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 + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-setuppy + (lambda _ + (substitute* "setup.py" + (("setuptools_scm==1.8.0") "setuptools_scm")) + #t))))) + (native-inputs + `(("python-setuptools-scm" ,python-setuptools-scm))) + (inputs + `(("python-py" ,python-py) + ("python-pytest" ,python-pytest))) + (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.") + (properties `((python2-variant . ,(delay python2-pytest-django)))) + (license license:bsd-3))) + +(define-public python2-pytest-django + (let ((base (package-with-python2 + (strip-python2-variant python-pytest-django)))) + (package (inherit base) + (native-inputs + `(("python2-setuptools" ,python2-setuptools) + ,@(package-native-inputs base)))))) -- cgit 1.4.1 From 894810c7c951d054e4b456f9c03e315cda1bd765 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 11 Sep 2016 21:31:44 +0300 Subject: gnu: Add python-django-filter. * gnu/packages/django.scm (python-django-filter): New variable. --- gnu/packages/django.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'gnu/packages/django.scm') diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index bd39314b00..923c4e2f2b 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -162,3 +162,32 @@ useful tools for testing Django applications and projects.") (native-inputs `(("python2-setuptools" ,python2-setuptools) ,@(package-native-inputs base)))))) + +(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) + (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.") + (properties `((python2-variant . ,(delay python2-django-filter)))) + (license license:bsd-3))) + +(define-public python2-django-filter + (let ((base (package-with-python2 + (strip-python2-variant python-django-filter)))) + (package (inherit base) + (native-inputs + `(("python2-setuptools" ,python2-setuptools) + ,@(package-native-inputs base)))))) -- cgit 1.4.1 From dfdaea32e90fd226aa98028a196fca3d2d371a94 Mon Sep 17 00:00:00 2001 From: Hartmut Goebel Date: Thu, 15 Sep 2016 22:07:29 +0200 Subject: gnu: python-django, python2-django: Fix propagated- and native-inputs. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setuptools is a run-time dependency (sic!), all others are required for testing only. * gnu/packages/django.scm (python-django) [propagated-inputs, native-inputs]: Exchange them. Move tzdata to new native-inputs. Enhance comments. (python2-django) [propagated-inputs] change into native-inputs. Enhance comment. Signed-off-by: Ludovic Courtès --- gnu/packages/django.scm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'gnu/packages/django.scm') diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index 923c4e2f2b..8f0d2add9e 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -55,16 +55,17 @@ (string-append ".:" (getenv "PYTHONPATH"))) (zero? (system* "python" "tests/runtests.py"))))))) ;; TODO: Install extras/django_bash_completion. - (native-inputs + (propagated-inputs ;; Django uses 'pkg_resources' (part of setuptools) to locate templates ;; at run-time. - `(("python-setuptools" ,python-setuptools) - ("tzdata", tzdata))) - (propagated-inputs - `( ;; bcrypt and argon2-cffi are extra requirements not yet in guix + `(("python-setuptools" ,python-setuptools))) + (native-inputs + `(("tzdata", tzdata) + ;; bcrypt and argon2-cffi are extra requirements not yet in guix ;;("python-argon2-cffi" ,python-argon2-cffi) ; >= 16.1.0 ;;("python-bcrypt" ,python-bcrypt) ; not py-bcrypt! - ;; Taken from tests/requirements/py3.txt. + ;; Remaining packages are test requirements taken from + ;; tests/requirements/py3.txt ("python-docutils" ,python-docutils) ;; optional for tests: ("python-geoip2" ,python-geoip2) ("python-jinja2" ,python-jinja2) ; >= 2.7 @@ -90,8 +91,9 @@ to the @dfn{don't repeat yourself} (DRY) principle.") (let ((base (package-with-python2 (strip-python2-variant python-django)))) (package (inherit base) - (propagated-inputs - `(;; Required for Python 2: enum34 and mock. + (native-inputs + `(;; Test requirements for Python 2 taken from + ;; tests/requirements/py3.txt: enum34 and mock. ("python2-enum34" ,python2-enum34) ("python2-mock" ,python2-mock) ;; When adding memcached mind: for Python 2 memcached <= 1.53 is -- cgit 1.4.1 From cda5e76f51bc8070ca031eff043821bcd7ca2be9 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 22 Sep 2016 22:04:05 +0300 Subject: gnu: python2-django: Fix typo in native-inputs. * gnu/packages/django.scm (python2-django)[native-inputs]: Inherit from python-django's native-inputs, not its inputs. --- gnu/packages/django.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/django.scm') diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index 8f0d2add9e..8d4a7e4753 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -98,7 +98,7 @@ to the @dfn{don't repeat yourself} (DRY) principle.") ("python2-mock" ,python2-mock) ;; When adding memcached mind: for Python 2 memcached <= 1.53 is ;; required. - ,@(package-inputs base)))))) + ,@(package-native-inputs base)))))) (define-public python-django-simple-math-captcha (package -- cgit 1.4.1