unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gnu: add python-django
  2016-04-12 20:32 [PATCH 0/2] Python Django Framework Hartmut Goebel
@ 2016-04-12 20:32 ` Hartmut Goebel
  2016-04-15 21:52   ` Ludovic Courtès
  0 siblings, 1 reply; 14+ messages in thread
From: Hartmut Goebel @ 2016-04-12 20:32 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/django.scm: New file.
* gnu-system.am: Add it.
---
 gnu-system.am           |  1 +
 gnu/packages/django.scm | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100644 gnu/packages/django.scm

diff --git a/gnu-system.am b/gnu-system.am
index 8822d0b..09acb64 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -90,6 +90,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/dico.scm				\
   gnu/packages/dictionaries.scm			\
   gnu/packages/disk.scm				\
+  gnu/packages/django.scm			\
   gnu/packages/djvu.scm				\
   gnu/packages/dns.scm				\
   gnu/packages/docbook.scm			\
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
new file mode 100644
index 0000000..c22830e
--- /dev/null
+++ b/gnu/packages/django.scm
@@ -0,0 +1,60 @@
+;;; 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 python)
+)
+
+
+(define-public python-django
+(package
+  (name "python-django")
+  (version "1.9.5")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (pypi-uri "Django" version))
+      (sha256
+        (base32
+          "19kaw9flk9jjz1n7q378waybxnkrrhkq240lby4zaaas62nnfip5"))))
+  (build-system python-build-system)
+  (inputs
+    `(("python-setuptools" ,python-setuptools)))
+  (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)))
+
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django
  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
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2016-04-15 21:52 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> * gnu/packages/django.scm: New file.
> * gnu-system.am: Add it.

Neat!

I fixed a couple of minor issues (formatting, etc.) leading to this
patch:


[-- Attachment #2: 0001-gnu-Add-python-django.patch --]
[-- Type: text/x-patch, Size: 3468 bytes --]

From 0d4ad143f542ffa125923edfcddfff2ca120c7aa Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Tue, 12 Apr 2016 22:32:29 +0200
Subject: [PATCH] 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-system.am: Add it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu-system.am           |  1 +
 gnu/packages/django.scm | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 gnu/packages/django.scm

diff --git a/gnu-system.am b/gnu-system.am
index 0165519..be07a9f 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -91,6 +91,7 @@ GNU_SYSTEM_MODULES =				\
   gnu/packages/dico.scm				\
   gnu/packages/dictionaries.scm			\
   gnu/packages/disk.scm				\
+  gnu/packages/django.scm			\
   gnu/packages/djvu.scm				\
   gnu/packages/dns.scm				\
   gnu/packages/docbook.scm			\
diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
new file mode 100644
index 0000000..890ae37
--- /dev/null
+++ b/gnu/packages/django.scm
@@ -0,0 +1,54 @@
+;;; 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 python))
+
+(define-public python-django
+  (package
+    (name "python-django")
+    (version "1.9.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "Django" version))
+              (sha256
+               (base32
+                "19kaw9flk9jjz1n7q378waybxnkrrhkq240lby4zaaas62nnfip5"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python-setuptools" ,python-setuptools)))
+    (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)))
-- 
2.7.3


[-- Attachment #3: Type: text/plain, Size: 560 bytes --]


However, the test suite is evidently not run:

--8<---------------cut here---------------start------------->8---
starting phase `check'
running "python setup.py" with command "test" and parameters ()
running test
phase `check' succeeded after 1.0 seconds
--8<---------------cut here---------------end--------------->8---

Could you check what it takes to run it?

Also, based on our discussion on IRC, could you add a “python2-django”
package, using ‘package-with-python2’ (see examples in python.scm)?

Thanks in advance!

Ludo’.

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django
  2016-04-15 21:52   ` Ludovic Courtès
@ 2016-04-16  9:13     ` Hartmut Goebel
  0 siblings, 0 replies; 14+ messages in thread
From: Hartmut Goebel @ 2016-04-16  9:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Am 15.04.2016 um 23:52 schrieb Ludovic Courtès:
> Could you check what it takes to run it?

I'll take care of it. Fixing this will take some time, since djangos
test-suite requires 7 python packages which are not yet in guix.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 0/2] Django framework
@ 2016-08-22 11:31 Hartmut Goebel
  2016-08-22 11:31 ` [PATCH 1/2] gnu: add python-django Hartmut Goebel
  2016-08-22 11:31 ` [PATCH 2/2] gnu: add python-django-simple-math-captcha Hartmut Goebel
  0 siblings, 2 replies; 14+ messages in thread
From: Hartmut Goebel @ 2016-08-22 11:31 UTC (permalink / raw)
  To: guix-devel

Hi,

these patches add Django, a Python web framework.

I've put this into a file by it's own, since PyPI has a lot of django-related
packages. (We also have a file for rails, which is a ruby framework.)

Hartmut Goebel (1):
  gnu: add python-django-simple-math-captcha
  gnu: add python-django.

 gnu/local.mk                                       |   1 +
 gnu/packages/django.scm                            | 138 +++++++++++++++++++++
 .../patches/python-django-fix-testcase.patch       |  42 +++++++
 3 files changed, 181 insertions(+)
 create mode 100644 gnu/packages/django.scm
 create mode 100644 gnu/packages/patches/python-django-fix-testcase.patch

-- 
2.7.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/2] gnu: add python-django.
  2016-08-22 11:31 [PATCH 0/2] Django framework Hartmut Goebel
@ 2016-08-22 11:31 ` Hartmut Goebel
  2016-09-08 17:11   ` Efraim Flashner
  2016-09-12 13:30   ` Ludovic Courtès
  2016-08-22 11:31 ` [PATCH 2/2] gnu: add python-django-simple-math-captcha Hartmut Goebel
  1 sibling, 2 replies; 14+ messages in thread
From: Hartmut Goebel @ 2016-08-22 11:31 UTC (permalink / raw)
  To: guix-devel

* 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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/2] gnu: add python-django-simple-math-captcha
  2016-08-22 11:31 [PATCH 0/2] Django framework Hartmut Goebel
  2016-08-22 11:31 ` [PATCH 1/2] gnu: add python-django Hartmut Goebel
@ 2016-08-22 11:31 ` Hartmut Goebel
  2016-09-12 13:31   ` Ludovic Courtès
  1 sibling, 1 reply; 14+ messages in thread
From: Hartmut Goebel @ 2016-08-22 11:31 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/django.scm: (python-django-simple-math-captcha,
  python2-django-simple-math-captcha) New variables.
---
 gnu/packages/django.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index ec3f25f..7e910da 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -108,3 +108,31 @@ DRY principle.")
          ("python2-mock" ,python2-mock)
          ; when adding memcached mind: for Python 2 memcached <= 1.53 is required
          ,@(package-native-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)
+    (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)
+    (properties `((python2-variant . ,(delay python2-django-simple-math-captcha))))))
+
+(define-public python2-django-simple-math-captcha
+  (package-with-python2 (strip-python2-variant python-django-simple-math-captcha)))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django.
  2016-08-22 11:31 ` [PATCH 1/2] gnu: add python-django Hartmut Goebel
@ 2016-09-08 17:11   ` Efraim Flashner
  2016-09-12 13:30   ` Ludovic Courtès
  1 sibling, 0 replies; 14+ messages in thread
From: Efraim Flashner @ 2016-09-08 17:11 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 9044 bytes --]

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 <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
> 

I can't get this patch to apply

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django.
  2016-08-22 11:31 ` [PATCH 1/2] gnu: add python-django Hartmut Goebel
  2016-09-08 17:11   ` Efraim Flashner
@ 2016-09-12 13:30   ` Ludovic Courtès
  2016-09-12 13:58     ` Hartmut Goebel
  1 sibling, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2016-09-12 13:30 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hi Hartmut,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> * gnu/packages/django.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
> * gnu/packages/patches/django-fix-testcase.patch: New file.

I finally reviewed this patch and pushed it as
d18197af7844151e38322605b11e0c75b18b55bf with small changes: adjust the
list of ‘native-inputs’, use ‘propagated-inputs’ for all the run-time
dependencies, use two semicolons for line comments (as opposed to margin
comments), and add the patch to gnu/local.mk.

Let me know if anything broke!

I’m really sorry that this patch sit there for 3 weeks, which is why I
didn’t dare ask you for these changes.  ;-)

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/2] gnu: add python-django-simple-math-captcha
  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
  0 siblings, 0 replies; 14+ messages in thread
From: Ludovic Courtès @ 2016-09-12 13:31 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> * gnu/packages/django.scm: (python-django-simple-math-captcha,
>   python2-django-simple-math-captcha) New variables.

Pushed with cosmetic changes as
b53fc2940fefc3829695f239f731ee6f03e538a2.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django.
  2016-09-12 13:30   ` Ludovic Courtès
@ 2016-09-12 13:58     ` Hartmut Goebel
  2016-09-12 21:07       ` Ludovic Courtès
  0 siblings, 1 reply; 14+ messages in thread
From: Hartmut Goebel @ 2016-09-12 13:58 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

Hi Ludo,

> I finally reviewed this patch and pushed it as
> d18197af7844151e38322605b11e0c75b18b55bf with small changes: adjust the
> list of ‘native-inputs’, use ‘propagated-inputs’ for all the run-time
> dependencies, use two semicolons for line comments (as opposed to margin
> comments), and add the patch to gnu/local.mk.

Thanks :-)

Unfortunately most of the inputs are now mixed now - but maybe I'm wrong
here, since I still did not get when to use propagated-inputs and normal
inputs for Python packages. [*]

 1.

    setuptools is a run-time dependence, so it needs to be a
    propagated-input (I assume). This is why there is a comment "Django
    uses 'pkg_resources' (part of setuptools) to locate templates at
    run-time.

 2.

    All packages below the line "Taken from tests/requirements/py3.txt."
    are required for tests only. So I assume they are normal inputs.

 3. Same for python2-django: enum34 and mock are used for testing only.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |


[-- Attachment #2: Type: text/html, Size: 1896 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django.
  2016-09-12 13:58     ` Hartmut Goebel
@ 2016-09-12 21:07       ` Ludovic Courtès
  2016-09-15 20:20         ` Hartmut Goebel
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2016-09-12 21:07 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hi,

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

>> I finally reviewed this patch and pushed it as
>> d18197af7844151e38322605b11e0c75b18b55bf with small changes: adjust the
>> list of ‘native-inputs’, use ‘propagated-inputs’ for all the run-time
>> dependencies, use two semicolons for line comments (as opposed to margin
>> comments), and add the patch to gnu/local.mk.
>
> Thanks :-)
>
> Unfortunately most of the inputs are now mixed now - but maybe I'm wrong
> here, since I still did not get when to use propagated-inputs and normal
> inputs for Python packages. [*]

Sorry for messing up!

>  1.
>
>     setuptools is a run-time dependence, so it needs to be a
>     propagated-input (I assume). This is why there is a comment "Django
>     uses 'pkg_resources' (part of setuptools) to locate templates at
>     run-time.

Ooh, OK, I misinterpreted that.

>  2.
>
>     All packages below the line "Taken from tests/requirements/py3.txt."
>     are required for tests only. So I assume they are normal inputs.

That would mean that Django has no run-time dependency other than
setuptools?  I would think pillow, pyyaml, sqlparse, etc. are run-time
dependencies no?

I tested current master with:

  guix environment -C --ad-hoc python-django python -- python2

and then:

  import django

That should detect if we forgot to propagate some of the dependencies,
but of course it does not detect if we propagate too many dependencies.

>  3. Same for python2-django: enum34 and mock are used for testing only.

OK.

Do you want to send a patch to fix this?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django.
  2016-09-12 21:07       ` Ludovic Courtès
@ 2016-09-15 20:20         ` Hartmut Goebel
  2016-09-19 14:42           ` Ludovic Courtès
  0 siblings, 1 reply; 14+ messages in thread
From: Hartmut Goebel @ 2016-09-15 20:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

Hello Ludo,
> Do you want to send a patch to fix this?
enclosed please find the patch. Please double check to ensure I did not
re-mix-it-up :-) In case of any doubt, please ask.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-python-django-python2-django-Fix-propagated-and-.patch --]
[-- Type: text/x-patch; name="0001-gnu-python-django-python2-django-Fix-propagated-and-.patch", Size: 2603 bytes --]

From d945e207eeb6b6bf61019a18bdaf3397883f5cb3 Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Thu, 15 Sep 2016 22:07:29 +0200
Subject: [PATCH] gnu: python-django, python2-django: Fix propagated- and
 native-inputs.

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.
---
 gnu/packages/django.scm | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm
index b9232e2..b2589cc 100644
--- a/gnu/packages/django.scm
+++ b/gnu/packages/django.scm
@@ -54,16 +54,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
@@ -89,8 +90,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
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django.
  2016-09-15 20:20         ` Hartmut Goebel
@ 2016-09-19 14:42           ` Ludovic Courtès
  2016-09-19 14:58             ` Hartmut Goebel
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2016-09-19 14:42 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> From d945e207eeb6b6bf61019a18bdaf3397883f5cb3 Mon Sep 17 00:00:00 2001
> From: Hartmut Goebel <h.goebel@crazy-compilers.com>
> Date: Thu, 15 Sep 2016 22:07:29 +0200
> Subject: [PATCH] gnu: python-django, python2-django: Fix propagated- and
>  native-inputs.
>
> 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.

Applied.  Thanks and apologies again for the mess!

Ludo’.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/2] gnu: add python-django.
  2016-09-19 14:42           ` Ludovic Courtès
@ 2016-09-19 14:58             ` Hartmut Goebel
  0 siblings, 0 replies; 14+ messages in thread
From: Hartmut Goebel @ 2016-09-19 14:58 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Am 19.09.2016 um 16:42 schrieb Ludovic Courtès:
> Thanks and apologies again for the mess!
>
Never mind. This can happen.

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-09-19 15:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-22 11:31 [PATCH 0/2] Django framework Hartmut Goebel
2016-08-22 11:31 ` [PATCH 1/2] gnu: add python-django Hartmut Goebel
2016-09-08 17:11   ` 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

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).