From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: [PATCH 1/2] gnu: add python-django. Date: Thu, 8 Sep 2016 20:11:09 +0300 Message-ID: <20160908171109.GH12493@macbook42.flashner.co.il> References: <1471865497-7324-1-git-send-email-h.goebel@crazy-compilers.com> <1471865497-7324-2-git-send-email-h.goebel@crazy-compilers.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zq44+AAfm4giZpo5" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi2rD-000135-Cb for guix-devel@gnu.org; Thu, 08 Sep 2016 13:11:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bi2r8-0000XI-5b for guix-devel@gnu.org; Thu, 08 Sep 2016 13:11:22 -0400 Received: from flashner.co.il ([178.62.234.194]:43012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bi2r7-0000WY-Qb for guix-devel@gnu.org; Thu, 08 Sep 2016 13:11:18 -0400 Content-Disposition: inline In-Reply-To: <1471865497-7324-2-git-send-email-h.goebel@crazy-compilers.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Hartmut Goebel Cc: guix-devel@gnu.org --zq44+AAfm4giZpo5 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 22, 2016 at 01:31:36PM +0200, Hartmut Goebel wrote: > * 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 >=20 > 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 =3D \ > %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 =C2=A9 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) ; 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) ; >=3D 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) ; >=3D 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 <=3D 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 > +Date: Mon, 1 Aug 2016 15:40:46 -0400 > +Subject: [PATCH] Fixed admin_utils test failures due to translation upda= tes. > + > +https://github.com/django/django/commit/24123c31362b5f3783d84d133c160e9f= e16805fe > + > +--- > + 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 =3D LogEntry.objects.filter(content_type__model__iexac= t=3D'article').latest('id') > + self.assertEqual(logentry.get_change_message(), 'Changed title = and hist.') > + with translation.override('fr'): > +- self.assertEqual(logentry.get_change_message(), 'Modificati= on de title et hist.') > ++ self.assertEqual(logentry.get_change_message(), 'Title et h= ist modifi=C3=A9(s).') > +=20 > + add_url =3D reverse('admin:admin_utils_article_add') > + post_data['title'] =3D 'New' > +@@ -117,11 +117,12 @@ class LogEntryTests(TestCase): > + 'Changed domain. Added article "Article object". ' > + 'Changed title for article "Article object". Deleted articl= e "Article object".' > + ) > ++ > + with translation.override('fr'): > + self.assertEqual( > + logentry.get_change_message(), > +- 'Modification de domain. Article =C2=AB=C2=A0Article ob= ject=C2=A0=C2=BB ajout=C3=A9. ' > +- 'Modification de title pour l\'objet article =C2=AB=C2= =A0Article object=C2=A0=C2=BB. Article =C2=AB=C2=A0Article object=C2=A0=C2= =BB supprim=C3=A9.' > ++ "Domain modifi=C3=A9(s). Article =C2=AB=C2=A0Article ob= ject=C2=A0=C2=BB ajout=C3=A9. " > ++ "Title modifi=C3=A9(s) pour l'objet article =C2=AB=C2= =A0Article object=C2=A0=C2=BB. Article =C2=AB=C2=A0Article object=C2=A0=C2= =BB supprim=C3=A9." > + ) > +=20 > + def test_logentry_get_edited_object(self): > +--=20 > +2.7.4 > + > --=20 > 2.7.4 >=20 I can't get this patch to apply --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --zq44+AAfm4giZpo5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCgAGBQJX0ZupAAoJEPTB05F+rO6T52MP/3+NR/VIN3SVv3VJkPczT9xa jXpZFIYZVZ7yK8rIiw4ngzQWfMMH/MCUid22AxwCqizDNEP56XUzCZliXuPszSD/ Q0Qh8p3zbApSxgVfeswJ7WUYyWmScueyR46Wpay5KZq/fK3de1Y5fQx/TA4NiFjq zqXXjYYVaiWsUvgQ05yH4RMZICmlGr8fXmw4o/dCflSdQGXqkENX1sHvuZKT8sYL Izotg7qffH4z5J9RSgO0KkRtius9EZUXiFEIppl7VT0mb8KWw4Dns4RvSM+rdnXU QrzjeJBVWog/e1N8ehMPhySwKvMAy7+JH8vWxogNk1j4rGENjyDeL0Z4Qb8fxcJq m6MCb3gt1pW+L6JsXOFEgh+7yi9XMrwMuQmwMI/2fcFMpc7VVcLs7H3bwsVzuUhm JQd5a4Q1SYhItgMydiXW6YCxRxcrPWtEvkyWNCj3DRprvmtsQuDB94OLQuOy7wRN maRd+7Q9v6dKyDIRHqAa7Ggqk4Cuelq1AO62rVOP0PLLOQx7dzMfFBB/r5nkFXaA 1eCZVTsqJpB2J//kHdphBbItYrTkSR7WHg1jgNB7NWel1XCbCasOyYW9TjedafQm c+eTg7OKuS8nRhCDjkioS/OAFKXIvNpJQaGCw3FomcnyFHMdwiqXEoOgdIMQp20L PU00YmP4dY273U8om1Rg =JeNg -----END PGP SIGNATURE----- --zq44+AAfm4giZpo5--