From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: guix-devel@gnu.org
Subject: [PATCH 1/2] gnu: add python-django.
Date: Mon, 22 Aug 2016 13:31:36 +0200 [thread overview]
Message-ID: <1471865497-7324-2-git-send-email-h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <1471865497-7324-1-git-send-email-h.goebel@crazy-compilers.com>
* gnu/packages/django.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/patches/django-fix-testcase.patch: New file.
---
gnu/local.mk | 1 +
gnu/packages/django.scm | 110 +++++++++++++++++++++
.../patches/python-django-fix-testcase.patch | 42 ++++++++
3 files changed, 153 insertions(+)
create mode 100644 gnu/packages/django.scm
create mode 100644 gnu/packages/patches/python-django-fix-testcase.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index b8c5378..df8d235 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -95,6 +95,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/dictionaries.scm \
%D%/packages/dillo.scm \
%D%/packages/disk.scm \
+ %D%/packages/django.scm \
%D%/packages/djvu.scm \
%D%/packages/dns.scm \
%D%/packages/docbook.scm \
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
new file mode 100644
index 0000000..ec3f25f
--- /dev/null
+++ b/gnu/packages/django.scm
@@ -0,0 +1,110 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;;
+;;; 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) ; for search-patches
+ #: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"))
+ ; fix test-case failures due to translation updates
+ ; - was fixed shortly after release
+ (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)
+ (setenv "TZDIR"
+ (string-append (assoc-ref inputs "tzdata")
+ "/share/zoneinfo"))
+ #t))
+ (replace
+ 'check
+ (lambda* _
+ (let* ((old-path (getenv "PYTHONPATH")))
+ (setenv "PYTHONPATH"
+ (string-append "." (if old-path
+ (string-append ":" old-path))))
+ (zero? (system* "python" "tests/runtests.py"))))))))
+ ;; todo: install extras/django_bash_completion
+ (inputs
+ ; Django uses pkg_resources (which is part of setuptools) to
+ ; locate templates at run-time.
+ `(("python-setuptools" ,python-setuptools)))
+ (native-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!
+ ; The test-suite tests some timezone dependant functions,
+ ; thus tzdata needs to be installed.
+ ("tzdata", tzdata)
+ ; these are 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.
+
+Developed and used over the past two years by a fast-moving online-news
+operation, Django was designed from scratch to handle two challenges: the
+intensive deadlines of a newsroom and the stringent requirements of
+experienced Web developers. It has convenient niceties for developing
+content-management systems, but it's an excellent tool for building any Web
+site.
+
+Django focuses on automating as much as possible and adhering to the
+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)
+ (native-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-native-inputs base))))))
diff --git a/gnu/packages/patches/python-django-fix-testcase.patch b/gnu/packages/patches/python-django-fix-testcase.patch
new file mode 100644
index 0000000..4c1f980
--- /dev/null
+++ b/gnu/packages/patches/python-django-fix-testcase.patch
@@ -0,0 +1,42 @@
+From 24123c31362b5f3783d84d133c160e9fe16805fe Mon Sep 17 00:00:00 2001
+From: Tim Graham <timograham@gmail.com>
+Date: Mon, 1 Aug 2016 15:40:46 -0400
+Subject: [PATCH] Fixed admin_utils test failures due to translation updates.
+
+https://github.com/django/django/commit/24123c31362b5f3783d84d133c160e9fe16805fe
+
+---
+ tests/admin_utils/test_logentry.py | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/tests/admin_utils/test_logentry.py b/tests/admin_utils/test_logentry.py
+index 7798373..8259bf0 100644
+--- a/tests/admin_utils/test_logentry.py
++++ b/tests/admin_utils/test_logentry.py
+@@ -59,7 +59,7 @@ class LogEntryTests(TestCase):
+ logentry = LogEntry.objects.filter(content_type__model__iexact='article').latest('id')
+ self.assertEqual(logentry.get_change_message(), 'Changed title and hist.')
+ with translation.override('fr'):
+- self.assertEqual(logentry.get_change_message(), 'Modification de title et hist.')
++ self.assertEqual(logentry.get_change_message(), 'Title et hist modifié(s).')
+
+ add_url = reverse('admin:admin_utils_article_add')
+ post_data['title'] = 'New'
+@@ -117,11 +117,12 @@ class LogEntryTests(TestCase):
+ 'Changed domain. Added article "Article object". '
+ 'Changed title for article "Article object". Deleted article "Article object".'
+ )
++
+ with translation.override('fr'):
+ self.assertEqual(
+ logentry.get_change_message(),
+- 'Modification de domain. Article « Article object » ajouté. '
+- 'Modification de title pour l\'objet article « Article object ». Article « Article object » supprimé.'
++ "Domain modifié(s). Article « Article object » ajouté. "
++ "Title modifié(s) pour l'objet article « Article object ». Article « Article object » supprimé."
+ )
+
+ def test_logentry_get_edited_object(self):
+--
+2.7.4
+
--
2.7.4
next prev parent reply other threads:[~2016-08-22 11:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-22 11:31 [PATCH 0/2] Django framework Hartmut Goebel
2016-08-22 11:31 ` Hartmut Goebel [this message]
2016-09-08 17:11 ` [PATCH 1/2] gnu: add python-django Efraim Flashner
2016-09-12 13:30 ` Ludovic Courtès
2016-09-12 13:58 ` Hartmut Goebel
2016-09-12 21:07 ` Ludovic Courtès
2016-09-15 20:20 ` Hartmut Goebel
2016-09-19 14:42 ` Ludovic Courtès
2016-09-19 14:58 ` Hartmut Goebel
2016-08-22 11:31 ` [PATCH 2/2] gnu: add python-django-simple-math-captcha Hartmut Goebel
2016-09-12 13:31 ` Ludovic Courtès
-- strict thread matches above, loose matches on Subject: below --
2016-04-12 20:32 [PATCH 0/2] Python Django Framework Hartmut Goebel
2016-04-12 20:32 ` [PATCH 1/2] gnu: add python-django Hartmut Goebel
2016-04-15 21:52 ` Ludovic Courtès
2016-04-16 9:13 ` Hartmut Goebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471865497-7324-2-git-send-email-h.goebel@crazy-compilers.com \
--to=h.goebel@crazy-compilers.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).