guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] gnu: add python-django.


From: Efraim Flashner
Subject: Re: [PATCH 1/2] gnu: add python-django.
Date: Thu, 8 Sep 2016 20:11:09 +0300
User-agent: Mutt/1.7.0 (2016-08-17)

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
> 
> 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 <address@hidden>
> +;;;
> +;;; 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 <address@hidden>
> +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
> 

I can't get this patch to apply

-- 
Efraim Flashner   <address@hidden>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]