unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26401: [PATCH] python-tryton (with no modules)
@ 2017-04-08 12:17 Catonano
  2017-05-08 14:33 ` Arun Isaac
  0 siblings, 1 reply; 16+ messages in thread
From: Catonano @ 2017-04-08 12:17 UTC (permalink / raw)
  To: 26401


[-- Attachment #1.1: Type: text/plain, Size: 486 bytes --]

Tryton has modules and without any module packaged, it will do nothing

But at least you can launch it and test it, you can use it for packkaging
the missing modules.

Also a service would be useful. But in order to write a service, the server
packkage has to be in already.

This is supposedly the basis for GNUealth, a notable GNU project

Gnuealth is a collection of Tryton modules and some specific Tryton
configurations. I just have to check if the versions are compatible

Thanks

[-- Attachment #1.2: Type: text/html, Size: 630 bytes --]

[-- Attachment #2: series.patch --]
[-- Type: text/x-patch, Size: 30789 bytes --]

From e42a727312a454aeb19e07cfec6cbb03fe18e183 Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Tue, 28 Mar 2017 12:25:06 +0200
Subject: [PATCH 1/5] gnu: Add python-sql python2-sql.

* gnu/packages/python.scm (python-sql python2-sql): New variables.
---
 gnu/packages/python.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0746af24a..19ba3ad95 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -13965,3 +13965,25 @@ recognize TestCases.")
        (sha256
         (base32
          "17jlkdpqw22z1nyml5ybslilqkzmnk0dxxjml8bfghav1l5hbwd2"))))))
+
+(define-public python-sql
+  (package
+    (name "python-sql")
+    (version "0.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri
+             "python-sql"
+             version))
+       (sha256
+        (base32
+         "0xik939sxqfqqbpgcsnfjnws692bjip32khgwhq1ycphfy7df3h2"))))
+    (build-system python-build-system)
+    (home-page "https://python-sql.tryton.org/")
+    (synopsis "Library to write SQL queries")
+    (description "Idiomatic python function calls get transformed in well formed SQL queries.")
+    (license license:bsd-3)))
+
+(define-public python2-sql
+  (package-with-python2 python-sql))
-- 
2.12.0


From d85c1996371bbdb28f28db9cc5fe06d83e1eafd6 Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Wed, 5 Apr 2017 15:29:56 +0200
Subject: [PATCH 2/5]  gnu: Add python-genshi, python2-genshi

 * gnu/packages/python.scm (python-genshi python2-genshi): New variables.
 * gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patct: New file.
 * gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch: New file.
 * gnu/packages/patches/python-genshi-isstring-helper.patch: New file.
 * gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch: New file.
 * gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch: New file.
 * gnu/packages/patches/python-genshi-buildable-on-python27-too.patch: New file.
 * gnu/local.mk (dist_patch_DATA): Add them.
---
 gnu/local.mk                                       |   6 +
 ...-for-Python-3.4-AST-support-for-NameConst.patch | 151 +++++++++++++++++++++
 ...-speedups-C-extension-on-CPython-3.3-sinc.patch |  32 +++++
 .../python-genshi-buildable-on-python27-too.patch  |  25 ++++
 ...ython-genshi-fixing-the-tests-on-python35.patch | 112 +++++++++++++++
 .../patches/python-genshi-isstring-helper.patch    |  37 +++++
 ...tripping-of-unsafe-script-tags-Python-3.4.patch |  51 +++++++
 gnu/packages/python.scm                            |  75 ++++++++++
 8 files changed, 489 insertions(+)
 create mode 100644 gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
 create mode 100644 gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
 create mode 100644 gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
 create mode 100644 gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
 create mode 100644 gnu/packages/patches/python-genshi-isstring-helper.patch
 create mode 100644 gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 93bafa282..b1a18ce25 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -873,6 +873,12 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-file-double-encoding-bug.patch	\
   %D%/packages/patches/python-fix-tests.patch			\
   %D%/packages/patches/python-parse-too-many-fields.patch	\
+  %D%/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch	\
+  %D%/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch	\
+  %D%/packages/patches/python-genshi-isstring-helper.patch	\
+  %D%/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch	\
+  %D%/packages/patches/python-genshi-fixing-the-tests-on-python35.patch	\
+  %D%/packages/patches/python-genshi-buildable-on-python27-too.patch	\
   %D%/packages/patches/python2-rdflib-drop-sparqlwrapper.patch	\
   %D%/packages/patches/python-statsmodels-fix-tests.patch	\
   %D%/packages/patches/python-configobj-setuptools.patch	\
diff --git a/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch b/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
new file mode 100644
index 000000000..4e40c1daa
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
@@ -0,0 +1,151 @@
+From 86b98a11559da7d1b21dc9b4c6b10511b9095bc4 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:46:15 +0000
+Subject: [PATCH 05/16] Add support for Python 3.4 AST (support for
+ NameConstants and changes to existing to arguments node attributes).
+
+---
+ genshi/template/astutil.py | 31 ++++++++++++++++++++++++++++---
+ genshi/template/eval.py    | 34 +++++++++++++++++++---------------
+ 2 files changed, 47 insertions(+), 18 deletions(-)
+
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index a4c21c8..a3946b4 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -21,7 +21,7 @@ else:
+     def parse(source, mode):
+         return compile(source, '', mode, _ast.PyCF_ONLY_AST)
+ 
+-from genshi.compat import IS_PYTHON2
++from genshi.compat import IS_PYTHON2, isstring
+ 
+ __docformat__ = 'restructuredtext en'
+ 
+@@ -103,8 +103,13 @@ class ASTCodeGenerator(object):
+         self._new_line()
+         return self.visit(node.body)
+ 
++    # Python < 3.4
+     # arguments = (expr* args, identifier? vararg,
+     #              identifier? kwarg, expr* defaults)
++    #
++    # Python >= 3.4
++    # arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,
++    #              arg? kwarg, expr* defaults)
+     def visit_arguments(self, node):
+         first = True
+         no_default_count = len(node.args) - len(node.defaults)
+@@ -122,13 +127,21 @@ class ASTCodeGenerator(object):
+                 self._write(', ')
+             else:
+                 first = False
+-            self._write('*' + node.vararg)
++            self._write('*')
++            if isstring(node.vararg):
++                self._write(node.vararg)
++            else:
++                self.visit(node.vararg)
+         if getattr(node, 'kwarg', None):
+             if not first:
+                 self._write(', ')
+             else:
+                 first = False
+-            self._write('**' + node.kwarg)
++            self._write('**')
++            if isstring(node.kwarg):
++                self._write(node.kwarg)
++            else:
++                self.visit(node.kwarg)
+ 
+     if not IS_PYTHON2:
+         # In Python 3 arguments get a special node
+@@ -724,6 +737,17 @@ class ASTCodeGenerator(object):
+     def visit_Name(self, node):
+         self._write(node.id)
+ 
++    # NameConstant(singleton value)
++    def visit_NameConstant(self, node):
++        if node.value is None:
++            self._write('None')
++        elif node.value is True:
++            self._write('True')
++        elif node.value is False:
++            self._write('False')
++        else:
++            raise Exception("Unknown NameConstant %r" % (node.value,))
++
+     # List(expr* elts, expr_context ctx)
+     def visit_List(self, node):
+         self._write('[')
+@@ -829,6 +853,7 @@ class ASTTransformer(object):
+     visit_Attribute = _clone
+     visit_Subscript = _clone
+     visit_Name = _clone
++    visit_NameConstant = _clone
+     visit_List = _clone
+     visit_Tuple = _clone
+ 
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index 89aec49..de4bc86 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -24,7 +24,8 @@ from genshi.template.astutil import ASTTransformer, ASTCodeGenerator, \
+ from genshi.template.base import TemplateRuntimeError
+ from genshi.util import flatten
+ 
+-from genshi.compat import get_code_params, build_code_chunk, IS_PYTHON2
++from genshi.compat import get_code_params, build_code_chunk, isstring, \
++                          IS_PYTHON2
+ 
+ __all__ = ['Code', 'Expression', 'Suite', 'LenientLookup', 'StrictLookup',
+            'Undefined', 'UndefinedError']
+@@ -495,28 +496,31 @@ class TemplateASTTransformer(ASTTransformer):
+     def __init__(self):
+         self.locals = [CONSTANTS]
+ 
++    def _process(self, names, node):
++        if not IS_PYTHON2 and isinstance(node, _ast.arg):
++            names.add(node.arg)
++        elif isstring(node):
++            names.add(node)
++        elif isinstance(node, _ast.Name):
++            names.add(node.id)
++        elif isinstance(node, _ast.alias):
++            names.add(node.asname or node.name)
++        elif isinstance(node, _ast.Tuple):
++            for elt in node.elts:
++                self._process(names, elt)
++
+     def _extract_names(self, node):
+         names = set()
+-        def _process(node):
+-            if not IS_PYTHON2 and isinstance(node, _ast.arg):
+-                names.add(node.arg)
+-            if isinstance(node, _ast.Name):
+-                names.add(node.id)
+-            elif isinstance(node, _ast.alias):
+-                names.add(node.asname or node.name)
+-            elif isinstance(node, _ast.Tuple):
+-                for elt in node.elts:
+-                    _process(elt)
+         if hasattr(node, 'args'):
+             for arg in node.args:
+-                _process(arg)
++                self._process(names, arg)
+             if hasattr(node, 'vararg'):
+-                names.add(node.vararg)
++                self._process(names, node.vararg)
+             if hasattr(node, 'kwarg'):
+-                names.add(node.kwarg)
++                self._process(names, node.kwarg)
+         elif hasattr(node, 'names'):
+             for elt in node.names:
+-                _process(elt)
++                self._process(names, elt)
+         return names
+ 
+     def visit_Str(self, node):
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch b/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
new file mode 100644
index 000000000..c25c3bd7a
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
@@ -0,0 +1,32 @@
+From cef2c8df44166195e1705638f9f17033a4943bb7 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:32:21 +0000
+Subject: [PATCH 02/15] Disable the speedups C extension on CPython >= 3.3
+ since Genshi doesn't support the new Unicode C API yet.
+
+---
+ setup.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 123a2cb..a3d748c 100755
+--- a/setup.py
++++ b/setup.py
+@@ -65,9 +65,13 @@ available.""")
+ 
+ 
+ if Feature:
++    # Optional C extension module for speeding up Genshi:
++    # Not activated by default on:
++    # - PyPy (where it harms performance)
++    # - CPython >= 3.3 (the new Unicode C API is not supported yet)
+     speedups = Feature(
+         "optional C speed-enhancements",
+-        standard = not is_pypy,
++        standard = not is_pypy and sys.version_info < (3, 3),
+         ext_modules = [
+             Extension('genshi._speedups', ['genshi/_speedups.c']),
+         ],
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch b/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
new file mode 100644
index 000000000..13289fbe8
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
@@ -0,0 +1,25 @@
+From 32bfaa7cc1c736fd62fcbb6414de9498dc20ed07 Mon Sep 17 00:00:00 2001
+From: humanitiesNerd <catonano@gmail.com>
+Date: Wed, 5 Apr 2017 15:13:06 +0200
+Subject: [PATCH 2/2] buildable on python27 too
+
+---
+ genshi/template/directives.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/genshi/template/directives.py b/genshi/template/directives.py
+index 6fd0f28..1f70ef6 100644
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,7 +266,7 @@ class DefDirective(Directive):
+         if isinstance(ast, _ast.Call):
+             self.name = ast.func.id
+             for arg in ast.args:
+-                if isinstance(arg, _ast.Starred):
++                if hasattr(_ast, 'Starred') and isinstance(arg, _ast.Starred):
+                     # Python 3.5+
+                     self.star_args = arg.value.id
+                 else:
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch b/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
new file mode 100644
index 000000000..f1905e7cf
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
@@ -0,0 +1,112 @@
+From ce796ad4bae5c47011876778674ad036357febdf Mon Sep 17 00:00:00 2001
+From: humanitiesNerd <catonano@gmail.com>
+Date: Wed, 5 Apr 2017 15:10:06 +0200
+Subject: [PATCH 1/2] fixing the tests on python35
+
+---
+ genshi/filters/i18n.py        |  6 ++++--
+ genshi/template/astutil.py    | 14 +++++++++++---
+ genshi/template/directives.py | 20 ++++++++++++++------
+ genshi/template/eval.py       |  5 +++++
+ 4 files changed, 34 insertions(+), 11 deletions(-)
+
+diff --git a/genshi/filters/i18n.py b/genshi/filters/i18n.py
+index 526fda4..5387fcf 100644
+--- a/genshi/filters/i18n.py
++++ b/genshi/filters/i18n.py
+@@ -1194,8 +1194,10 @@ def extract_from_code(code, gettext_functions):
+                 elif arg:
+                     strings.append(None)
+             [_add(arg) for arg in node.args]
+-            _add(node.starargs)
+-            _add(node.kwargs)
++            if hasattr(node, 'starargs'):
++                _add(node.starargs)
++            if hasattr(node, 'kwargs'):
++                _add(node.kwargs)
+             if len(strings) == 1:
+                 strings = strings[0]
+             else:
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index f4e1edd..e561846 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -151,6 +151,10 @@ class ASTCodeGenerator(object):
+         def visit_arg(self, node):
+             self._write(node.arg)
+ 
++    def visit_Starred(self, node):
++        self._write('*')
++        self.visit(node.value)
++
+     # FunctionDef(identifier name, arguments args,
+     #                           stmt* body, expr* decorator_list)
+     def visit_FunctionDef(self, node):
+@@ -664,9 +668,13 @@ class ASTCodeGenerator(object):
+             if not first:
+                 self._write(', ')
+             first = False
+-            # keyword = (identifier arg, expr value)
+-            self._write(keyword.arg)
+-            self._write('=')
++            if not keyword.arg:
++                # Python 3.5+ star-star args
++                self._write('**')
++            else:
++                # keyword = (identifier arg, expr value)
++                self._write(keyword.arg)
++                self._write('=')
+             self.visit(keyword.value)
+         if getattr(node, 'starargs', None):
+             if not first:
+diff --git a/genshi/template/directives.py b/genshi/template/directives.py
+index 7301c2d..6fd0f28 100644
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,13 +266,21 @@ class DefDirective(Directive):
+         if isinstance(ast, _ast.Call):
+             self.name = ast.func.id
+             for arg in ast.args:
+-                # only names
+-                self.args.append(arg.id)
++                if isinstance(arg, _ast.Starred):
++                    # Python 3.5+
++                    self.star_args = arg.value.id
++                else:
++                    # only names
++                    self.args.append(arg.id)
+             for kwd in ast.keywords:
+-                self.args.append(kwd.arg)
+-                exp = Expression(kwd.value, template.filepath,
+-                                 lineno, lookup=template.lookup)
+-                self.defaults[kwd.arg] = exp
++                if kwd.arg is None:
++                    # Python 3.5+
++                    self.dstar_args = kwd.value.id
++                else:
++                    self.args.append(kwd.arg)
++                    exp = Expression(kwd.value, template.filepath,
++                                     lineno, lookup=template.lookup)
++                    self.defaults[kwd.arg] = exp
+             if getattr(ast, 'starargs', None):
+                 self.star_args = ast.starargs.id
+             if getattr(ast, 'kwargs', None):
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index d378419..81644a7 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -600,6 +600,11 @@ class TemplateASTTransformer(ASTTransformer):
+         finally:
+             self.locals.pop()
+ 
++    # Only used in Python 3.5+
++    def visit_Starred(self, node):
++        node.value = self.visit(node.value)
++        return node
++
+     def visit_Name(self, node):
+         # If the name refers to a local inside a lambda, list comprehension, or
+         # generator expression, leave it alone
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-isstring-helper.patch b/gnu/packages/patches/python-genshi-isstring-helper.patch
new file mode 100644
index 000000000..4f6c19bba
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-isstring-helper.patch
@@ -0,0 +1,37 @@
+From cc5e07284f44cdd9beec178c69070a53f55d1323 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:43:20 +0000
+Subject: [PATCH 03/15] Add isstring helper.
+
+---
+ genshi/compat.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/genshi/compat.py b/genshi/compat.py
+index 9787325..6574e39 100644
+--- a/genshi/compat.py
++++ b/genshi/compat.py
+@@ -35,6 +35,15 @@ else:
+                 'Python 2 compatibility function. Not usable in Python 3.')
+ 
+ 
++# We need to test if an object is an instance of a string type in places
++
++if IS_PYTHON2:
++    def isstring(obj):
++        return isinstance(obj, basestring)
++else:
++    def isstring(obj):
++        return isinstance(obj, str)
++
+ # We need to differentiate between StringIO and BytesIO in places
+ 
+ if IS_PYTHON2:
+@@ -112,4 +121,3 @@ except NameError:
+             if not x:
+                 return False
+         return True
+-
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch b/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch
new file mode 100644
index 000000000..29951a614
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch
@@ -0,0 +1,51 @@
+From 0769be04c3891ae5c724c6779ba13d1d0f53b4ae Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:25:17 +0000
+Subject: [PATCH 01/15] Also allow stripping of unsafe script tags (Python 3.4
+ parses the second example as a tag whose name is script&xyz).
+
+---
+ genshi/filters/tests/test_html.py | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/genshi/filters/tests/test_html.py b/genshi/filters/tests/test_html.py
+index 0c6cfe1..45ec0da 100644
+--- a/genshi/filters/tests/test_html.py
++++ b/genshi/filters/tests/test_html.py
+@@ -368,12 +368,16 @@ def StyleSanitizer():
+ 
+ class HTMLSanitizerTestCase(unittest.TestCase):
+ 
+-    def assert_parse_error_or_equal(self, expected, exploit):
++    def assert_parse_error_or_equal(self, expected, exploit,
++                                    allow_strip=False):
+         try:
+             html = HTML(exploit)
+         except ParseError:
+             return
+-        self.assertEquals(expected, (html | HTMLSanitizer()).render())
++        sanitized_html = (html | HTMLSanitizer()).render()
++        if not sanitized_html and allow_strip:
++            return
++        self.assertEquals(expected, sanitized_html)
+ 
+     def test_sanitize_unchanged(self):
+         html = HTML(u'<a href="#">fo<br />o</a>')
+@@ -416,10 +420,12 @@ class HTMLSanitizerTestCase(unittest.TestCase):
+         html = HTML(u'<SCRIPT SRC="http://example.com/"></SCRIPT>')
+         self.assertEquals('', (html | HTMLSanitizer()).render())
+         src = u'<SCR\0IPT>alert("foo")</SCR\0IPT>'
+-        self.assert_parse_error_or_equal('&lt;SCR\x00IPT&gt;alert("foo")', src)
++        self.assert_parse_error_or_equal('&lt;SCR\x00IPT&gt;alert("foo")', src,
++                                         allow_strip=True)
+         src = u'<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>'
+         self.assert_parse_error_or_equal('&lt;SCRIPT&amp;XYZ; '
+-                                         'SRC="http://example.com/"&gt;', src)
++                                         'SRC="http://example.com/"&gt;', src,
++                                         allow_strip=True)
+ 
+     def test_sanitize_remove_onclick_attr(self):
+         html = HTML(u'<div onclick=\'alert("foo")\' />')
+-- 
+2.12.0
+
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 19ba3ad95..c05a5bd70 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -13987,3 +13987,78 @@ recognize TestCases.")
 
 (define-public python2-sql
   (package-with-python2 python-sql))
+
+(define-public python-genshi
+  (package
+    (name "python-genshi")
+    (version "0.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://ftp.edgewall.org/pub/genshi/Genshi-"
+             version
+             ".tar.gz"))
+       (patches
+        (search-patches
+         ;; The first 4 patches are in the master branch upstream.
+         ;; see this as a reference https://genshi.edgewall.org/ticket/582
+         ;; The last 2 are NOT in any branch.
+         ;; They were sent as attachments to a ticket opened at
+         ;; https://genshi.edgewall.org/ticket/602#no1
+         "python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch"
+         "python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch"
+         "python-genshi-isstring-helper.patch"
+         "python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch"
+         "python-genshi-fixing-the-tests-on-python35.patch"
+         "python-genshi-buildable-on-python27-too.patch"))
+       (sha256
+        (base32
+         "0lkkbp6fbwzv0zda5iqc21rr7rdldkwh3hfabfjl9i4bwq14858x"))))
+    (build-system python-build-system)
+    (home-page "https://genshi.edgewall.org/")
+    (synopsis "Toolkit for generation of output for the web")
+    (description "Genshi is a Python library that provides
+an integrated set of components for parsing, generating, and processing HTML, XML
+or other textual content for output generation on the web")
+    (license license:bsd-3)))
+
+;; the linter here claims that patch file names
+;; should start with the package name.
+;; In this case the patches are inherited from
+;; python-genshi without the "2"
+(define-public python2-genshi
+  (package-with-python2 python-genshi))
+
+
+;; this package depends on python-genshi that
+;; can be buit only with python-2
+;; so providing a python33 version of this
+;; is difficult
+(define-public python2-relatorio
+  (package
+    (name "python-relatorio")
+    (version "0.6.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "relatorio" version))
+       (sha256
+        (base32
+         "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
+    (propagated-inputs
+     `(("lxml" ,python2-lxml)
+       ("genshi" ,python2-genshi)))
+    (arguments
+     `(#:python ,python-2))
+    ;; because relatorio depends on python-genshi
+    ;; that can be built with python-2 only
+    (build-system python-build-system)
+    (home-page "https://relatorio.tryton.org/")
+    (synopsis "Templating library able to output odt and pdf files")
+    (description
+     "Relatorio is a templating library which
+provides a way to easily output several kinds of files
+(odt, ods, png, svg, …).  Support for more filetypes can be
+easily added by creating plugins for them.")
+    (license license:lgpl3)))
-- 
2.12.0


From 6d9dff4cbbe37f172de929e44e82b384e0408f16 Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Wed, 5 Apr 2017 16:06:06 +0200
Subject: [PATCH 3/5]  gnu Add: python-relatorio python2-relatorio

* gnu/packages/python (python-relatorio python2-relatorio): New variables.
---
 gnu/packages/python.scm | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index c05a5bd70..6117dc109 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14030,12 +14030,7 @@ or other textual content for output generation on the web")
 (define-public python2-genshi
   (package-with-python2 python-genshi))
 
-
-;; this package depends on python-genshi that
-;; can be buit only with python-2
-;; so providing a python33 version of this
-;; is difficult
-(define-public python2-relatorio
+(define-public python-relatorio
   (package
     (name "python-relatorio")
     (version "0.6.4")
@@ -14047,12 +14042,8 @@ or other textual content for output generation on the web")
         (base32
          "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
     (propagated-inputs
-     `(("lxml" ,python2-lxml)
-       ("genshi" ,python2-genshi)))
-    (arguments
-     `(#:python ,python-2))
-    ;; because relatorio depends on python-genshi
-    ;; that can be built with python-2 only
+     `(("lxml" ,python-lxml)
+       ("genshi" ,python-genshi)))
     (build-system python-build-system)
     (home-page "https://relatorio.tryton.org/")
     (synopsis "Templating library able to output odt and pdf files")
@@ -14062,3 +14053,6 @@ provides a way to easily output several kinds of files
 (odt, ods, png, svg, …).  Support for more filetypes can be
 easily added by creating plugins for them.")
     (license license:lgpl3)))
+
+(define-public python2-relatorio
+  (package-with-python2 python-relatorio))
-- 
2.12.0


From f3b90215d488741361c69f3a73730f5e5e18915f Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Thu, 6 Apr 2017 09:37:59 +0200
Subject: [PATCH 4/5] gnu: Add python-trytond python2-trytond.

* gnu/packages/python.scm (python-trytond, python2-trytond): New variables.
---
 gnu/packages/python.scm | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 6117dc109..761341aa4 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14056,3 +14056,53 @@ easily added by creating plugins for them.")
 
 (define-public python2-relatorio
   (package-with-python2 python-relatorio))
+
+(define-public python-trytond
+  (package
+    (name "python-trytond")
+    (version "4.2.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri
+             "trytond"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "1w9bc0qck9k1vzk1xvry3vb70mibaxipp229naym2fnwi282jlh5"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'preparations
+                     (lambda* _
+                       ;; this is used in the tests
+                       (setenv "DB_NAME" ":memory:"))))))
+    (propagated-inputs
+     `(("polib" ,python-polib)
+       ("dateutil" ,python-dateutil)
+       ("werkzeug" ,python-werkzeug)
+       ("wrapt" ,python-wrapt)
+       ("python-sql" ,python-sql)
+       ("genshi" ,python-genshi)
+       ("relatorio" ,python-relatorio)
+       ("lxml" ,python-lxml)
+       ;; there's no pyton-mysql in Guix right now
+       ;; so psycopg (postgresql) only for now
+       ("psycopg" ,python-psycopg2)))
+    (native-inputs
+     ;; this is used in the tests
+     `(("mock" ,python-mock)))
+    (home-page "http://www.tryton.org/")
+    (synopsis "Server component of Tryton")
+    (description
+   "The server of the Tryton application platform.
+A three-tiers high-level general purpose application platform
+written in Python and use Postgresql as main database engine.
+It is the core base of an Open Source ERP.
+It provides modularity, scalability and security.")
+  (license license:lgpl3)))
+
+(define-public python2-trytond
+  (package-with-python2 python-trytond))
-- 
2.12.0


From b5fc10e71f87ea3392aa9ea5b16a52c780c9e0cb Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Thu, 6 Apr 2017 22:17:11 +0200
Subject: [PATCH 5/5] gnu: Add python2-tryton

* gnu/packages/python.scm (python2-tryton): New variable.
---
 gnu/packages/python.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 761341aa4..20f1859c7 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14106,3 +14106,34 @@ It provides modularity, scalability and security.")
 
 (define-public python2-trytond
   (package-with-python2 python-trytond))
+
+;; this depends on pygtk that is available or python@2 only
+(define-public python2-tryton
+  (package
+    (name "python2-tryton")
+    (version "4.2.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri
+             "tryton"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "13a8cc3z3h9bpr2dwd7rqn8drp5ng8dava2zy7azcgwgjvkx4jzk"))))
+    (arguments
+     `(#:python ,python-2))
+    (propagated-inputs
+     `(("chardet" ,python2-chardet)
+       ("dateutil" ,python2-dateutil)
+       ("pygtk" ,python2-pygtk)))
+    (build-system python-build-system)
+    (home-page "http://www.tryton.org/")
+    (synopsis "Client component of Tryton")
+    (description "The client of the Tryton application platform.
+A three-tiers high-level general purpose application platform
+written in Python and use Postgresql as main database engine.
+It is the core base of an Open Source ERP.
+It provides modularity, scalability and security.")
+    (license license:gpl3)))
-- 
2.12.0


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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-04-08 12:17 bug#26401: [PATCH] python-tryton (with no modules) Catonano
@ 2017-05-08 14:33 ` Arun Isaac
  2017-05-15  6:39   ` Catonano
  2017-05-15 19:17   ` Catonano
  0 siblings, 2 replies; 16+ messages in thread
From: Arun Isaac @ 2017-05-08 14:33 UTC (permalink / raw)
  To: 26401


Thanks for the patch set!

I haven't properly tested the package yet. The following are just my
initial reactions and questions. This patch review will take a few
iterations. Do bear with me.

> Tryton has modules and without any module packaged, it will do nothing
>
> But at least you can launch it and test it, you can use it for packkaging
> the missing modules.
>
> Also a service would be useful. But in order to write a service, the server
> packkage has to be in already.

Agreed.

> This is supposedly the basis for GNUealth, a notable GNU project

GNU Health usually lags behind the latest Tryon, and currently runs on
Tryton 3.8. We will have to create a package for Tryton 3.8 as
well. This can just inherit from the latest tryton package, and modify
only the `version' and `source' fields. Could you do this?

> From e42a727312a454aeb19e07cfec6cbb03fe18e183 Mon Sep 17 00:00:00 2001
> From: humanitiesNerd <catonano@gmail.com>
> Date: Tue, 28 Mar 2017 12:25:06 +0200
> Subject: [PATCH 1/5] gnu: Add python-sql python2-sql.

It is enough to mention only python-sql here.

> * gnu/packages/python.scm (python-sql python2-sql): New variables.

Please put a comma between python-sql and python2-sql.

> +(define-public python-sql
> +  (package
> +    (name "python-sql")
> +    (version "0.8")

The latest version of python-sql is 0.9.

> +       (uri (pypi-uri
> +             "python-sql"
> +             version))

Could you put these on the same line?

> +(define-public python-genshi
> +  (package
> +    (name "python-genshi")
> +    (version "0.7")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append
> +             "https://ftp.edgewall.org/pub/genshi/Genshi-"
> +             version
> +             ".tar.gz"))

Please put version ".tar.gz" on the same line.

> +       (patches
> +        (search-patches
> +         ;; The first 4 patches are in the master branch upstream.
> +         ;; see this as a reference https://genshi.edgewall.org/ticket/582
> +         ;; The last 2 are NOT in any branch.
> +         ;; They were sent as attachments to a ticket opened at
> +         ;; https://genshi.edgewall.org/ticket/602#no1
> +         "python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch"
> +         "python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch"
> +         "python-genshi-isstring-helper.patch"
> +         "python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch"
> +         "python-genshi-fixing-the-tests-on-python35.patch"
> +         "python-genshi-buildable-on-python27-too.patch"))

Why do we need these patches? Is the release tarball not sufficient?

> +    (propagated-inputs
> +     `(("lxml" ,python2-lxml)
> +       ("genshi" ,python2-genshi)))

Please put the full names of these inputs -- I mean "python-lxml"
instead of "lxml", "python-genshi" instead of "genshi", and so on.

> +(define-public python-trytond
> +  (package
> +    (name "python-trytond")

As far as I understand, trytond is an application, not a python
library. Only python libraries should have the "python-" prefix. So,
this package would just be called "trytond".

> +    (version "4.2.3")

The latest version of tryton is 4.4.

> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (pypi-uri
> +             "trytond"
> +             version
> +             ".tar.gz"))

We should use the tarballs available on the tryton website.
https://downloads.tryton.org/4.4/

> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-before 'check 'preparations
> +                     (lambda* _
> +                       ;; this is used in the tests
> +                       (setenv "DB_NAME" ":memory:"))))))

Though this is shorter, I think it would be clearer to replace the
`check' phase altogether.

> +    (propagated-inputs
> +     `(("polib" ,python-polib)
> +       ("dateutil" ,python-dateutil)
> +       ("werkzeug" ,python-werkzeug)
> +       ("wrapt" ,python-wrapt)
> +       ("python-sql" ,python-sql)
> +       ("genshi" ,python-genshi)
> +       ("relatorio" ,python-relatorio)
> +       ("lxml" ,python-lxml)
> +       ;; there's no pyton-mysql in Guix right now
> +       ;; so psycopg (postgresql) only for now
> +       ("psycopg" ,python-psycopg2)))

If trytond is only an application, these can just be `inputs', not
`propagated-inputs'. For applications, the python build system wraps the
executables with the correct PYTHONPATH environment variable.

> +  (license license:lgpl3)))

Tryton is GPL3.

> +(define-public python2-trytond
> +  (package-with-python2 python-trytond))

No need for python2-trytond if trytond is just an application.

> +;; this depends on pygtk that is available or python@2 only
> +(define-public python2-tryton
> +  (package
> +    (name "python2-tryton")
> +    (version "4.2.4")

Latest version if 4.4

> +       (uri (pypi-uri
> +             "tryton"
> +             version
> +             ".tar.gz"))

We should use the tarballs available on the tryton website.
https://downloads.tryton.org/4.4/

> +    (propagated-inputs
> +     `(("chardet" ,python2-chardet)
> +       ("dateutil" ,python2-dateutil)
> +       ("pygtk" ,python2-pygtk)))

For an application, these can just be `inputs'.

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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-05-08 14:33 ` Arun Isaac
@ 2017-05-15  6:39   ` Catonano
  2017-05-15 13:19     ` Arun Isaac
  2017-05-15 19:17   ` Catonano
  1 sibling, 1 reply; 16+ messages in thread
From: Catonano @ 2017-05-15  6:39 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 26401

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

2017-05-08 16:33 GMT+02:00 Arun Isaac <arunisaac@systemreboot.net>:

>
> Thanks for the patch set!
>

Thank you or reviiewing it !

Just a note: in the future please add me as a recipient o the message,
don't send iit only to the debbugs ticket.

In fact I was missing your reply and I saw it today just by chance !
I missed it for 8 days !
I'm sorry !


> I haven't properly tested the package yet. The following are just my
> initial reactions and questions. This patch review will take a few
> iterations. Do bear with me.
>

I will bear with you !
Just give me some time to go thorugh your observations !
I'll be back to you in a while !

Thanks again !

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

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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-05-15  6:39   ` Catonano
@ 2017-05-15 13:19     ` Arun Isaac
  0 siblings, 0 replies; 16+ messages in thread
From: Arun Isaac @ 2017-05-15 13:19 UTC (permalink / raw)
  To: Catonano; +Cc: 26401


> Just a note: in the future please add me as a recipient o the message,
> don't send iit only to the debbugs ticket.
>
> In fact I was missing your reply and I saw it today just by chance !
> I missed it for 8 days !
> I'm sorry !

Sure, will do!

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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-05-08 14:33 ` Arun Isaac
  2017-05-15  6:39   ` Catonano
@ 2017-05-15 19:17   ` Catonano
  2017-05-16 17:12     ` Arun Isaac
       [not found]     ` <c3fa946d.AEMAKXA0lrIAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZGzM6@mailjet.com>
  1 sibling, 2 replies; 16+ messages in thread
From: Catonano @ 2017-05-15 19:17 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 26401


[-- Attachment #1.1: Type: text/plain, Size: 7550 bytes --]

2017-05-08 16:33 GMT+02:00 Arun Isaac <arunisaac@systemreboot.net>:

>
> Thanks for the patch set!
>
> I haven't properly tested the package yet. The following are just my
> initial reactions and questions. This patch review will take a few
> iterations. Do bear with me.
>

:-)


>
> > Tryton has modules and without any module packaged, it will do nothing
> >
> > But at least you can launch it and test it, you can use it for packkaging
> > the missing modules.
> >
> > Also a service would be useful. But in order to write a service, the
> server
> > packkage has to be in already.
>
> Agreed.
>
> > This is supposedly the basis for GNUealth, a notable GNU project
>
> GNU Health usually lags behind the latest Tryon, and currently runs on
> Tryton 3.8. We will have to create a package for Tryton 3.8 as
> well. This can just inherit from the latest tryton package, and modify
> only the `version' and `source' fields. Could you do this?
>

Yes, I think I could do it.

Bt if you don't mind I'd liie to delay this.

When and if we'll have the current Tryton thhen we'll see.


>
> > From e42a727312a454aeb19e07cfec6cbb03fe18e183 Mon Sep 17 00:00:00 2001
> > From: humanitiesNerd <catonano@gmail.com>
> > Date: Tue, 28 Mar 2017 12:25:06 +0200
> > Subject: [PATCH 1/5] gnu: Add python-sql python2-sql.
>
> It is enough to mention only python-sql here.
>

done


>
> > * gnu/packages/python.scm (python-sql python2-sql): New variables.
>
> Please put a comma between python-sql and python2-sql.
>

done


>
> > +(define-public python-sql
> > +  (package
> > +    (name "python-sql")
> > +    (version "0.8")
>
> The latest version of python-sql is 0.9.
>

updated


>
> > +       (uri (pypi-uri
> > +             "python-sql"
> > +             version))
>
> Could you put these on the same line?
>

done


>
> > +(define-public python-genshi
> > +  (package
> > +    (name "python-genshi")
> > +    (version "0.7")
> > +    (source
> > +     (origin
> > +       (method url-fetch)
> > +       (uri (string-append
> > +             "https://ftp.edgewall.org/pub/genshi/Genshi-"
> > +             version
> > +             ".tar.gz"))
>
> Please put version ".tar.gz" on the same line.
>

done


>
> > +       (patches
> > +        (search-patches
> > +         ;; The first 4 patches are in the master branch upstream.
> > +         ;; see this as a reference https://genshi.edgewall.org/ti
> cket/582
> > +         ;; The last 2 are NOT in any branch.
> > +         ;; They were sent as attachments to a ticket opened at
> > +         ;; https://genshi.edgewall.org/ticket/602#no1
> > +         "python-genshi-stripping-of-unsafe-script-tags-Python-3.4.p
> atch"
> > +         "python-genshi-Disable-the-speedups-C-extension-on-CPython-
> 3.3-sinc.patch"
> > +         "python-genshi-isstring-helper.patch"
> > +         "python-genshi-Add-support-for-Python-3.4-AST-support-for-
> NameConst.patch"
> > +         "python-genshi-fixing-the-tests-on-python35.patch"
> > +         "python-genshi-buildable-on-python27-too.patch"))
>
> Why do we need these patches? Is the release tarball not sufficient?
>

No, the current tarball is not suficient.
Genshi builds with python 3.3 only. With python 3.4 and 3.5 it doesn't
build.

This is mainly due to a change in thhe C API so a part of Genshi tat was
written in C has to be re-written adgering to the new API

The authors claim to need more time to do this.

The Genshi issue tracker reports all this infomration, I linked the
relevant issues in the comments

Admittedly I don't understand what these patches do. They're too entrenched
in the Genshi code base

I shamelessly copied them from the Fedora package definition
See here
http://pkgs.fedoraproject.org/cgit/rpms/python-genshi.git/snapshot/python-genshi-f25.tar.gz

I understand that they made an effort to make their Genshi package
compatible with pythhon 3.4 too and that is not necessary or Guix

But it's too complicated for me to excise the support for python 3.4


>
> > +    (propagated-inputs
> > +     `(("lxml" ,python2-lxml)
> > +       ("genshi" ,python2-genshi)))
>
> Please put the full names of these inputs -- I mean "python-lxml"
> instead of "lxml", "python-genshi" instead of "genshi", and so on.
>

done


>
> > +(define-public python-trytond
> > +  (package
> > +    (name "python-trytond")
>
> As far as I understand, trytond is an application, not a python
> library. Only python libraries should have the "python-" prefix.


Oh, I didn't know this. Thanks


> So,
> this package would just be called "trytond".
>

done


>
> > +    (version "4.2.3")
>
> The latest version of tryton is 4.4.
>

updated


>
> > +    (source
> > +     (origin
> > +       (method url-fetch)
> > +       (uri (pypi-uri
> > +             "trytond"
> > +             version
> > +             ".tar.gz"))
>
> We should use the tarballs available on the tryton website.
> https://downloads.tryton.org/4.4/


done


>
>
> > +    (arguments
> > +     `(#:phases
> > +       (modify-phases %standard-phases
> > +         (add-before 'check 'preparations
> > +                     (lambda* _
> > +                       ;; this is used in the tests
> > +                       (setenv "DB_NAME" ":memory:"))))))
>
> Though this is shorter, I think it would be clearer to replace the
> `check' phase altogether.
>

mmm I'm not sure I can do this.
I don't know much about setuptools, eggs and the such
The check phase of the python build system is quite articulated, I don't
feel like messing with it

Feel free to rearrange this yourself as you see fit.



>
> > +    (propagated-inputs
> > +     `(("polib" ,python-polib)
> > +       ("dateutil" ,python-dateutil)
> > +       ("werkzeug" ,python-werkzeug)
> > +       ("wrapt" ,python-wrapt)
> > +       ("python-sql" ,python-sql)
> > +       ("genshi" ,python-genshi)
> > +       ("relatorio" ,python-relatorio)
> > +       ("lxml" ,python-lxml)
> > +       ;; there's no pyton-mysql in Guix right now
> > +       ;; so psycopg (postgresql) only for now
> > +       ("psycopg" ,python-psycopg2)))
>
> If trytond is only an application, these can just be `inputs', not
> `propagated-inputs'. For applications, the python build system wraps the
> executables with the correct PYTHONPATH environment variable.
>

Right, thanks.
Done



>
> > +  (license license:lgpl3)))
>
> Tryton is GPL3.
>

fixed


>
> > +(define-public python2-trytond
> > +  (package-with-python2 python-trytond))
>
> No need for python2-trytond if trytond is just an application.
>

erased


>
> > +;; this depends on pygtk that is available or python@2 only
> > +(define-public python2-tryton
> > +  (package
> > +    (name "python2-tryton")
> > +    (version "4.2.4")
>
> Latest version if 4.4
>

updated


>
> > +       (uri (pypi-uri
> > +             "tryton"
> > +             version
> > +             ".tar.gz"))
>
> We should use the tarballs available on the tryton website.
> https://downloads.tryton.org/4.4/


done


>
>
> > +    (propagated-inputs
> > +     `(("chardet" ,python2-chardet)
> > +       ("dateutil" ,python2-dateutil)
> > +       ("pygtk" ,python2-pygtk)))
>
> For an application, these can just be `inputs'.
>

done

Ok, so this is the first iteration.
I'm ready or the next one 😎

[-- Attachment #1.2: Type: text/html, Size: 13038 bytes --]

[-- Attachment #2: series.patch --]
[-- Type: text/x-patch, Size: 34540 bytes --]

From ffa984ecdfc0c786b09ebb99b635faffb5378f4a Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Tue, 28 Mar 2017 12:25:06 +0200
Subject: [PATCH 1/5] gnu: Add python-sql.

* gnu/packages/python.scm (python-sql, python2-sql): New variables.
---
 gnu/packages/python.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 57a67de41..f1ef53e1a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14622,3 +14622,25 @@ substitute for redis.")
 
 (define-public python2-fakeredis
   (package-with-python2 python-fakeredis))
+
+(define-public python-sql
+  (package
+    (name "python-sql")
+    (version "0.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri
+             "python-sql"
+             version))
+       (sha256
+        (base32
+         "0xik939sxqfqqbpgcsnfjnws692bjip32khgwhq1ycphfy7df3h2"))))
+    (build-system python-build-system)
+    (home-page "https://python-sql.tryton.org/")
+    (synopsis "Library to write SQL queries")
+    (description "Idiomatic python function calls get transformed in well formed SQL queries.")
+    (license license:bsd-3)))
+
+(define-public python2-sql
+  (package-with-python2 python-sql))
-- 
2.13.0


From 2e95052780cef66ded0119e0ef2046c6b5c5a31b Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Wed, 5 Apr 2017 15:29:56 +0200
Subject: [PATCH 2/5]  gnu: Add python-genshi.

 * gnu/packages/python.scm (python-genshi, python2-genshi): New variables.
 * gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patct: New file.
 * gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch: New file.
 * gnu/packages/patches/python-genshi-isstring-helper.patch: New file.
 * gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch: New file.
 * gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch: New file.
 * gnu/packages/patches/python-genshi-buildable-on-python27-too.patch: New file.
 * gnu/local.mk (dist_patch_DATA): Add them.
---
 gnu/local.mk                                       |   6 +
 ...-for-Python-3.4-AST-support-for-NameConst.patch | 151 +++++++++++++++++++++
 ...-speedups-C-extension-on-CPython-3.3-sinc.patch |  32 +++++
 .../python-genshi-buildable-on-python27-too.patch  |  25 ++++
 ...ython-genshi-fixing-the-tests-on-python35.patch | 112 +++++++++++++++
 .../patches/python-genshi-isstring-helper.patch    |  37 +++++
 ...tripping-of-unsafe-script-tags-Python-3.4.patch |  51 +++++++
 gnu/packages/python.scm                            |  75 ++++++++++
 8 files changed, 489 insertions(+)
 create mode 100644 gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
 create mode 100644 gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
 create mode 100644 gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
 create mode 100644 gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
 create mode 100644 gnu/packages/patches/python-genshi-isstring-helper.patch
 create mode 100644 gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 28a283ab7..7ae12c18c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -922,6 +922,12 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-file-double-encoding-bug.patch	\
   %D%/packages/patches/python-fix-tests.patch			\
   %D%/packages/patches/python-parse-too-many-fields.patch	\
+  %D%/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch	\
+  %D%/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch	\
+  %D%/packages/patches/python-genshi-isstring-helper.patch	\
+  %D%/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch	\
+  %D%/packages/patches/python-genshi-fixing-the-tests-on-python35.patch	\
+  %D%/packages/patches/python-genshi-buildable-on-python27-too.patch	\
   %D%/packages/patches/python2-rdflib-drop-sparqlwrapper.patch	\
   %D%/packages/patches/python-statsmodels-fix-tests.patch	\
   %D%/packages/patches/python-configobj-setuptools.patch	\
diff --git a/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch b/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
new file mode 100644
index 000000000..4e40c1daa
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
@@ -0,0 +1,151 @@
+From 86b98a11559da7d1b21dc9b4c6b10511b9095bc4 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:46:15 +0000
+Subject: [PATCH 05/16] Add support for Python 3.4 AST (support for
+ NameConstants and changes to existing to arguments node attributes).
+
+---
+ genshi/template/astutil.py | 31 ++++++++++++++++++++++++++++---
+ genshi/template/eval.py    | 34 +++++++++++++++++++---------------
+ 2 files changed, 47 insertions(+), 18 deletions(-)
+
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index a4c21c8..a3946b4 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -21,7 +21,7 @@ else:
+     def parse(source, mode):
+         return compile(source, '', mode, _ast.PyCF_ONLY_AST)
+ 
+-from genshi.compat import IS_PYTHON2
++from genshi.compat import IS_PYTHON2, isstring
+ 
+ __docformat__ = 'restructuredtext en'
+ 
+@@ -103,8 +103,13 @@ class ASTCodeGenerator(object):
+         self._new_line()
+         return self.visit(node.body)
+ 
++    # Python < 3.4
+     # arguments = (expr* args, identifier? vararg,
+     #              identifier? kwarg, expr* defaults)
++    #
++    # Python >= 3.4
++    # arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,
++    #              arg? kwarg, expr* defaults)
+     def visit_arguments(self, node):
+         first = True
+         no_default_count = len(node.args) - len(node.defaults)
+@@ -122,13 +127,21 @@ class ASTCodeGenerator(object):
+                 self._write(', ')
+             else:
+                 first = False
+-            self._write('*' + node.vararg)
++            self._write('*')
++            if isstring(node.vararg):
++                self._write(node.vararg)
++            else:
++                self.visit(node.vararg)
+         if getattr(node, 'kwarg', None):
+             if not first:
+                 self._write(', ')
+             else:
+                 first = False
+-            self._write('**' + node.kwarg)
++            self._write('**')
++            if isstring(node.kwarg):
++                self._write(node.kwarg)
++            else:
++                self.visit(node.kwarg)
+ 
+     if not IS_PYTHON2:
+         # In Python 3 arguments get a special node
+@@ -724,6 +737,17 @@ class ASTCodeGenerator(object):
+     def visit_Name(self, node):
+         self._write(node.id)
+ 
++    # NameConstant(singleton value)
++    def visit_NameConstant(self, node):
++        if node.value is None:
++            self._write('None')
++        elif node.value is True:
++            self._write('True')
++        elif node.value is False:
++            self._write('False')
++        else:
++            raise Exception("Unknown NameConstant %r" % (node.value,))
++
+     # List(expr* elts, expr_context ctx)
+     def visit_List(self, node):
+         self._write('[')
+@@ -829,6 +853,7 @@ class ASTTransformer(object):
+     visit_Attribute = _clone
+     visit_Subscript = _clone
+     visit_Name = _clone
++    visit_NameConstant = _clone
+     visit_List = _clone
+     visit_Tuple = _clone
+ 
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index 89aec49..de4bc86 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -24,7 +24,8 @@ from genshi.template.astutil import ASTTransformer, ASTCodeGenerator, \
+ from genshi.template.base import TemplateRuntimeError
+ from genshi.util import flatten
+ 
+-from genshi.compat import get_code_params, build_code_chunk, IS_PYTHON2
++from genshi.compat import get_code_params, build_code_chunk, isstring, \
++                          IS_PYTHON2
+ 
+ __all__ = ['Code', 'Expression', 'Suite', 'LenientLookup', 'StrictLookup',
+            'Undefined', 'UndefinedError']
+@@ -495,28 +496,31 @@ class TemplateASTTransformer(ASTTransformer):
+     def __init__(self):
+         self.locals = [CONSTANTS]
+ 
++    def _process(self, names, node):
++        if not IS_PYTHON2 and isinstance(node, _ast.arg):
++            names.add(node.arg)
++        elif isstring(node):
++            names.add(node)
++        elif isinstance(node, _ast.Name):
++            names.add(node.id)
++        elif isinstance(node, _ast.alias):
++            names.add(node.asname or node.name)
++        elif isinstance(node, _ast.Tuple):
++            for elt in node.elts:
++                self._process(names, elt)
++
+     def _extract_names(self, node):
+         names = set()
+-        def _process(node):
+-            if not IS_PYTHON2 and isinstance(node, _ast.arg):
+-                names.add(node.arg)
+-            if isinstance(node, _ast.Name):
+-                names.add(node.id)
+-            elif isinstance(node, _ast.alias):
+-                names.add(node.asname or node.name)
+-            elif isinstance(node, _ast.Tuple):
+-                for elt in node.elts:
+-                    _process(elt)
+         if hasattr(node, 'args'):
+             for arg in node.args:
+-                _process(arg)
++                self._process(names, arg)
+             if hasattr(node, 'vararg'):
+-                names.add(node.vararg)
++                self._process(names, node.vararg)
+             if hasattr(node, 'kwarg'):
+-                names.add(node.kwarg)
++                self._process(names, node.kwarg)
+         elif hasattr(node, 'names'):
+             for elt in node.names:
+-                _process(elt)
++                self._process(names, elt)
+         return names
+ 
+     def visit_Str(self, node):
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch b/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
new file mode 100644
index 000000000..c25c3bd7a
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
@@ -0,0 +1,32 @@
+From cef2c8df44166195e1705638f9f17033a4943bb7 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:32:21 +0000
+Subject: [PATCH 02/15] Disable the speedups C extension on CPython >= 3.3
+ since Genshi doesn't support the new Unicode C API yet.
+
+---
+ setup.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 123a2cb..a3d748c 100755
+--- a/setup.py
++++ b/setup.py
+@@ -65,9 +65,13 @@ available.""")
+ 
+ 
+ if Feature:
++    # Optional C extension module for speeding up Genshi:
++    # Not activated by default on:
++    # - PyPy (where it harms performance)
++    # - CPython >= 3.3 (the new Unicode C API is not supported yet)
+     speedups = Feature(
+         "optional C speed-enhancements",
+-        standard = not is_pypy,
++        standard = not is_pypy and sys.version_info < (3, 3),
+         ext_modules = [
+             Extension('genshi._speedups', ['genshi/_speedups.c']),
+         ],
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch b/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
new file mode 100644
index 000000000..13289fbe8
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
@@ -0,0 +1,25 @@
+From 32bfaa7cc1c736fd62fcbb6414de9498dc20ed07 Mon Sep 17 00:00:00 2001
+From: humanitiesNerd <catonano@gmail.com>
+Date: Wed, 5 Apr 2017 15:13:06 +0200
+Subject: [PATCH 2/2] buildable on python27 too
+
+---
+ genshi/template/directives.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/genshi/template/directives.py b/genshi/template/directives.py
+index 6fd0f28..1f70ef6 100644
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,7 +266,7 @@ class DefDirective(Directive):
+         if isinstance(ast, _ast.Call):
+             self.name = ast.func.id
+             for arg in ast.args:
+-                if isinstance(arg, _ast.Starred):
++                if hasattr(_ast, 'Starred') and isinstance(arg, _ast.Starred):
+                     # Python 3.5+
+                     self.star_args = arg.value.id
+                 else:
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch b/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
new file mode 100644
index 000000000..f1905e7cf
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
@@ -0,0 +1,112 @@
+From ce796ad4bae5c47011876778674ad036357febdf Mon Sep 17 00:00:00 2001
+From: humanitiesNerd <catonano@gmail.com>
+Date: Wed, 5 Apr 2017 15:10:06 +0200
+Subject: [PATCH 1/2] fixing the tests on python35
+
+---
+ genshi/filters/i18n.py        |  6 ++++--
+ genshi/template/astutil.py    | 14 +++++++++++---
+ genshi/template/directives.py | 20 ++++++++++++++------
+ genshi/template/eval.py       |  5 +++++
+ 4 files changed, 34 insertions(+), 11 deletions(-)
+
+diff --git a/genshi/filters/i18n.py b/genshi/filters/i18n.py
+index 526fda4..5387fcf 100644
+--- a/genshi/filters/i18n.py
++++ b/genshi/filters/i18n.py
+@@ -1194,8 +1194,10 @@ def extract_from_code(code, gettext_functions):
+                 elif arg:
+                     strings.append(None)
+             [_add(arg) for arg in node.args]
+-            _add(node.starargs)
+-            _add(node.kwargs)
++            if hasattr(node, 'starargs'):
++                _add(node.starargs)
++            if hasattr(node, 'kwargs'):
++                _add(node.kwargs)
+             if len(strings) == 1:
+                 strings = strings[0]
+             else:
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index f4e1edd..e561846 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -151,6 +151,10 @@ class ASTCodeGenerator(object):
+         def visit_arg(self, node):
+             self._write(node.arg)
+ 
++    def visit_Starred(self, node):
++        self._write('*')
++        self.visit(node.value)
++
+     # FunctionDef(identifier name, arguments args,
+     #                           stmt* body, expr* decorator_list)
+     def visit_FunctionDef(self, node):
+@@ -664,9 +668,13 @@ class ASTCodeGenerator(object):
+             if not first:
+                 self._write(', ')
+             first = False
+-            # keyword = (identifier arg, expr value)
+-            self._write(keyword.arg)
+-            self._write('=')
++            if not keyword.arg:
++                # Python 3.5+ star-star args
++                self._write('**')
++            else:
++                # keyword = (identifier arg, expr value)
++                self._write(keyword.arg)
++                self._write('=')
+             self.visit(keyword.value)
+         if getattr(node, 'starargs', None):
+             if not first:
+diff --git a/genshi/template/directives.py b/genshi/template/directives.py
+index 7301c2d..6fd0f28 100644
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,13 +266,21 @@ class DefDirective(Directive):
+         if isinstance(ast, _ast.Call):
+             self.name = ast.func.id
+             for arg in ast.args:
+-                # only names
+-                self.args.append(arg.id)
++                if isinstance(arg, _ast.Starred):
++                    # Python 3.5+
++                    self.star_args = arg.value.id
++                else:
++                    # only names
++                    self.args.append(arg.id)
+             for kwd in ast.keywords:
+-                self.args.append(kwd.arg)
+-                exp = Expression(kwd.value, template.filepath,
+-                                 lineno, lookup=template.lookup)
+-                self.defaults[kwd.arg] = exp
++                if kwd.arg is None:
++                    # Python 3.5+
++                    self.dstar_args = kwd.value.id
++                else:
++                    self.args.append(kwd.arg)
++                    exp = Expression(kwd.value, template.filepath,
++                                     lineno, lookup=template.lookup)
++                    self.defaults[kwd.arg] = exp
+             if getattr(ast, 'starargs', None):
+                 self.star_args = ast.starargs.id
+             if getattr(ast, 'kwargs', None):
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index d378419..81644a7 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -600,6 +600,11 @@ class TemplateASTTransformer(ASTTransformer):
+         finally:
+             self.locals.pop()
+ 
++    # Only used in Python 3.5+
++    def visit_Starred(self, node):
++        node.value = self.visit(node.value)
++        return node
++
+     def visit_Name(self, node):
+         # If the name refers to a local inside a lambda, list comprehension, or
+         # generator expression, leave it alone
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-isstring-helper.patch b/gnu/packages/patches/python-genshi-isstring-helper.patch
new file mode 100644
index 000000000..4f6c19bba
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-isstring-helper.patch
@@ -0,0 +1,37 @@
+From cc5e07284f44cdd9beec178c69070a53f55d1323 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:43:20 +0000
+Subject: [PATCH 03/15] Add isstring helper.
+
+---
+ genshi/compat.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/genshi/compat.py b/genshi/compat.py
+index 9787325..6574e39 100644
+--- a/genshi/compat.py
++++ b/genshi/compat.py
+@@ -35,6 +35,15 @@ else:
+                 'Python 2 compatibility function. Not usable in Python 3.')
+ 
+ 
++# We need to test if an object is an instance of a string type in places
++
++if IS_PYTHON2:
++    def isstring(obj):
++        return isinstance(obj, basestring)
++else:
++    def isstring(obj):
++        return isinstance(obj, str)
++
+ # We need to differentiate between StringIO and BytesIO in places
+ 
+ if IS_PYTHON2:
+@@ -112,4 +121,3 @@ except NameError:
+             if not x:
+                 return False
+         return True
+-
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch b/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch
new file mode 100644
index 000000000..29951a614
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch
@@ -0,0 +1,51 @@
+From 0769be04c3891ae5c724c6779ba13d1d0f53b4ae Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:25:17 +0000
+Subject: [PATCH 01/15] Also allow stripping of unsafe script tags (Python 3.4
+ parses the second example as a tag whose name is script&xyz).
+
+---
+ genshi/filters/tests/test_html.py | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/genshi/filters/tests/test_html.py b/genshi/filters/tests/test_html.py
+index 0c6cfe1..45ec0da 100644
+--- a/genshi/filters/tests/test_html.py
++++ b/genshi/filters/tests/test_html.py
+@@ -368,12 +368,16 @@ def StyleSanitizer():
+ 
+ class HTMLSanitizerTestCase(unittest.TestCase):
+ 
+-    def assert_parse_error_or_equal(self, expected, exploit):
++    def assert_parse_error_or_equal(self, expected, exploit,
++                                    allow_strip=False):
+         try:
+             html = HTML(exploit)
+         except ParseError:
+             return
+-        self.assertEquals(expected, (html | HTMLSanitizer()).render())
++        sanitized_html = (html | HTMLSanitizer()).render()
++        if not sanitized_html and allow_strip:
++            return
++        self.assertEquals(expected, sanitized_html)
+ 
+     def test_sanitize_unchanged(self):
+         html = HTML(u'<a href="#">fo<br />o</a>')
+@@ -416,10 +420,12 @@ class HTMLSanitizerTestCase(unittest.TestCase):
+         html = HTML(u'<SCRIPT SRC="http://example.com/"></SCRIPT>')
+         self.assertEquals('', (html | HTMLSanitizer()).render())
+         src = u'<SCR\0IPT>alert("foo")</SCR\0IPT>'
+-        self.assert_parse_error_or_equal('&lt;SCR\x00IPT&gt;alert("foo")', src)
++        self.assert_parse_error_or_equal('&lt;SCR\x00IPT&gt;alert("foo")', src,
++                                         allow_strip=True)
+         src = u'<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>'
+         self.assert_parse_error_or_equal('&lt;SCRIPT&amp;XYZ; '
+-                                         'SRC="http://example.com/"&gt;', src)
++                                         'SRC="http://example.com/"&gt;', src,
++                                         allow_strip=True)
+ 
+     def test_sanitize_remove_onclick_attr(self):
+         html = HTML(u'<div onclick=\'alert("foo")\' />')
+-- 
+2.12.0
+
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index f1ef53e1a..14cecfcb1 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14644,3 +14644,78 @@ substitute for redis.")
 
 (define-public python2-sql
   (package-with-python2 python-sql))
+
+(define-public python-genshi
+  (package
+    (name "python-genshi")
+    (version "0.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://ftp.edgewall.org/pub/genshi/Genshi-"
+             version
+             ".tar.gz"))
+       (patches
+        (search-patches
+         ;; The first 4 patches are in the master branch upstream.
+         ;; see this as a reference https://genshi.edgewall.org/ticket/582
+         ;; The last 2 are NOT in any branch.
+         ;; They were sent as attachments to a ticket opened at
+         ;; https://genshi.edgewall.org/ticket/602#no1
+         "python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch"
+         "python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch"
+         "python-genshi-isstring-helper.patch"
+         "python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch"
+         "python-genshi-fixing-the-tests-on-python35.patch"
+         "python-genshi-buildable-on-python27-too.patch"))
+       (sha256
+        (base32
+         "0lkkbp6fbwzv0zda5iqc21rr7rdldkwh3hfabfjl9i4bwq14858x"))))
+    (build-system python-build-system)
+    (home-page "https://genshi.edgewall.org/")
+    (synopsis "Toolkit for generation of output for the web")
+    (description "Genshi is a Python library that provides
+an integrated set of components for parsing, generating, and processing HTML, XML
+or other textual content for output generation on the web")
+    (license license:bsd-3)))
+
+;; the linter here claims that patch file names
+;; should start with the package name.
+;; In this case the patches are inherited from
+;; python-genshi without the "2"
+(define-public python2-genshi
+  (package-with-python2 python-genshi))
+
+
+;; this package depends on python-genshi that
+;; can be buit only with python-2
+;; so providing a python33 version of this
+;; is difficult
+(define-public python2-relatorio
+  (package
+    (name "python-relatorio")
+    (version "0.6.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "relatorio" version))
+       (sha256
+        (base32
+         "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
+    (propagated-inputs
+     `(("lxml" ,python2-lxml)
+       ("genshi" ,python2-genshi)))
+    (arguments
+     `(#:python ,python-2))
+    ;; because relatorio depends on python-genshi
+    ;; that can be built with python-2 only
+    (build-system python-build-system)
+    (home-page "https://relatorio.tryton.org/")
+    (synopsis "Templating library able to output odt and pdf files")
+    (description
+     "Relatorio is a templating library which
+provides a way to easily output several kinds of files
+(odt, ods, png, svg, …).  Support for more filetypes can be
+easily added by creating plugins for them.")
+    (license license:lgpl3)))
-- 
2.13.0


From 0eb5261eb2d696a30d5a7304dd4dc1692c14ac61 Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Wed, 5 Apr 2017 16:06:06 +0200
Subject: [PATCH 3/5]  gnu Add: python-relatorio.

* gnu/packages/python (python-relatorio, python2-relatorio): New variables.
---
 gnu/packages/python.scm | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 14cecfcb1..3268dcc85 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14687,12 +14687,7 @@ or other textual content for output generation on the web")
 (define-public python2-genshi
   (package-with-python2 python-genshi))
 
-
-;; this package depends on python-genshi that
-;; can be buit only with python-2
-;; so providing a python33 version of this
-;; is difficult
-(define-public python2-relatorio
+(define-public python-relatorio
   (package
     (name "python-relatorio")
     (version "0.6.4")
@@ -14704,12 +14699,8 @@ or other textual content for output generation on the web")
         (base32
          "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
     (propagated-inputs
-     `(("lxml" ,python2-lxml)
-       ("genshi" ,python2-genshi)))
-    (arguments
-     `(#:python ,python-2))
-    ;; because relatorio depends on python-genshi
-    ;; that can be built with python-2 only
+     `(("lxml" ,python-lxml)
+       ("genshi" ,python-genshi)))
     (build-system python-build-system)
     (home-page "https://relatorio.tryton.org/")
     (synopsis "Templating library able to output odt and pdf files")
@@ -14719,3 +14710,6 @@ provides a way to easily output several kinds of files
 (odt, ods, png, svg, …).  Support for more filetypes can be
 easily added by creating plugins for them.")
     (license license:lgpl3)))
+
+(define-public python2-relatorio
+  (package-with-python2 python-relatorio))
-- 
2.13.0


From b71cd2bd664e530dfabb3e558db15934f0ec204a Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Thu, 6 Apr 2017 09:37:59 +0200
Subject: [PATCH 4/5] gnu: Add python-trytond.

* gnu/packages/python.scm (python-trytond, python2-trytond): New variables.
---
 gnu/packages/python.scm | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 3268dcc85..0c5ff6517 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14713,3 +14713,53 @@ easily added by creating plugins for them.")
 
 (define-public python2-relatorio
   (package-with-python2 python-relatorio))
+
+(define-public python-trytond
+  (package
+    (name "python-trytond")
+    (version "4.2.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri
+             "trytond"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "1w9bc0qck9k1vzk1xvry3vb70mibaxipp229naym2fnwi282jlh5"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'preparations
+                     (lambda* _
+                       ;; this is used in the tests
+                       (setenv "DB_NAME" ":memory:"))))))
+    (propagated-inputs
+     `(("polib" ,python-polib)
+       ("dateutil" ,python-dateutil)
+       ("werkzeug" ,python-werkzeug)
+       ("wrapt" ,python-wrapt)
+       ("python-sql" ,python-sql)
+       ("genshi" ,python-genshi)
+       ("relatorio" ,python-relatorio)
+       ("lxml" ,python-lxml)
+       ;; there's no pyton-mysql in Guix right now
+       ;; so psycopg (postgresql) only for now
+       ("psycopg" ,python-psycopg2)))
+    (native-inputs
+     ;; this is used in the tests
+     `(("mock" ,python-mock)))
+    (home-page "http://www.tryton.org/")
+    (synopsis "Server component of Tryton")
+    (description
+   "The server of the Tryton application platform.
+A three-tiers high-level general purpose application platform
+written in Python and use Postgresql as main database engine.
+It is the core base of an Open Source ERP.
+It provides modularity, scalability and security.")
+  (license license:lgpl3)))
+
+(define-public python2-trytond
+  (package-with-python2 python-trytond))
-- 
2.13.0


From 48493cad90eac1d807fc6f3d7011ccc811c713a0 Mon Sep 17 00:00:00 2001
From: humanitiesNerd <catonano@gmail.com>
Date: Thu, 6 Apr 2017 22:17:11 +0200
Subject: [PATCH 5/5] gnu: Add python2-tryton.

* gnu/packages/python.scm (python2-tryton): New variable.
---
 gnu/packages/python.scm | 82 ++++++++++++++++++++++++++++++++-----------------
 1 file changed, 53 insertions(+), 29 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0c5ff6517..ac1061014 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14626,16 +14626,15 @@ substitute for redis.")
 (define-public python-sql
   (package
     (name "python-sql")
-    (version "0.8")
+    (version "0.9")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri
-             "python-sql"
-             version))
+             "python-sql" version))
        (sha256
         (base32
-         "0xik939sxqfqqbpgcsnfjnws692bjip32khgwhq1ycphfy7df3h2"))))
+         "0p6kaqj02vz0habmdx37zjk6hjxdfm8aw737zs059vvpr70ird87"))))
     (build-system python-build-system)
     (home-page "https://python-sql.tryton.org/")
     (synopsis "Library to write SQL queries")
@@ -14654,8 +14653,7 @@ substitute for redis.")
        (method url-fetch)
        (uri (string-append
              "https://ftp.edgewall.org/pub/genshi/Genshi-"
-             version
-             ".tar.gz"))
+             version ".tar.gz"))
        (patches
         (search-patches
          ;; The first 4 patches are in the master branch upstream.
@@ -14699,8 +14697,8 @@ or other textual content for output generation on the web")
         (base32
          "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
     (propagated-inputs
-     `(("lxml" ,python-lxml)
-       ("genshi" ,python-genshi)))
+     `(("python-lxml" ,python-lxml)
+       ("python-genshi" ,python-genshi)))
     (build-system python-build-system)
     (home-page "https://relatorio.tryton.org/")
     (synopsis "Templating library able to output odt and pdf files")
@@ -14714,20 +14712,19 @@ easily added by creating plugins for them.")
 (define-public python2-relatorio
   (package-with-python2 python-relatorio))
 
-(define-public python-trytond
+(define-public trytond
   (package
-    (name "python-trytond")
-    (version "4.2.3")
+    (name "trytond")
+    (version "4.4.0")
     (source
      (origin
        (method url-fetch)
-       (uri (pypi-uri
-             "trytond"
-             version
-             ".tar.gz"))
+       (uri (string-append
+             "https://downloads.tryton.org/4.4/trytond-"
+             version ".tar.gz"))
        (sha256
         (base32
-         "1w9bc0qck9k1vzk1xvry3vb70mibaxipp229naym2fnwi282jlh5"))))
+         "0f5xh4s8xr01rrz63accrz8lpsni0dfsjrnl4h3widrgz6ds2fr6"))))
     (build-system python-build-system)
     (arguments
      `(#:phases
@@ -14736,21 +14733,21 @@ easily added by creating plugins for them.")
                      (lambda* _
                        ;; this is used in the tests
                        (setenv "DB_NAME" ":memory:"))))))
-    (propagated-inputs
-     `(("polib" ,python-polib)
-       ("dateutil" ,python-dateutil)
-       ("werkzeug" ,python-werkzeug)
-       ("wrapt" ,python-wrapt)
+    (inputs
+     `(("python-polib" ,python-polib)
+       ("python-dateutil" ,python-dateutil)
+       ("python-werkzeug" ,python-werkzeug)
+       ("python-wrapt" ,python-wrapt)
        ("python-sql" ,python-sql)
-       ("genshi" ,python-genshi)
-       ("relatorio" ,python-relatorio)
-       ("lxml" ,python-lxml)
+       ("python-genshi" ,python-genshi)
+       ("python-relatorio" ,python-relatorio)
+       ("python-lxml" ,python-lxml)
        ;; there's no pyton-mysql in Guix right now
        ;; so psycopg (postgresql) only for now
-       ("psycopg" ,python-psycopg2)))
+       ("pyton-psycopg" ,python-psycopg2)))
     (native-inputs
      ;; this is used in the tests
-     `(("mock" ,python-mock)))
+     `(("python-mock" ,python-mock)))
     (home-page "http://www.tryton.org/")
     (synopsis "Server component of Tryton")
     (description
@@ -14759,7 +14756,34 @@ A three-tiers high-level general purpose application platform
 written in Python and use Postgresql as main database engine.
 It is the core base of an Open Source ERP.
 It provides modularity, scalability and security.")
-  (license license:lgpl3)))
+  (license license:gpl3)))
 
-(define-public python2-trytond
-  (package-with-python2 python-trytond))
+;; this depends on pygtk that is available or python@2 only
+(define-public tryton
+  (package
+    (name "tryton")
+    (version "4.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://downloads.tryton.org/4.4/tryton-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "1lklcz5fs6rkrd7z2m2f5gz4fdwzkgnhg2hyvzp20kdsvi33bq2j"))))
+    (arguments
+     `(#:python ,python-2))
+    (inputs
+     `(("python-chardet" ,python2-chardet)
+       ("pyton-dateutil" ,python2-dateutil)
+       ("pyton2-pygtk" ,python2-pygtk)))
+    (build-system python-build-system)
+    (home-page "http://www.tryton.org/")
+    (synopsis "Client component of Tryton")
+    (description "The client of the Tryton application platform.
+A three-tiers high-level general purpose application platform
+written in Python and use Postgresql as main database engine.
+It is the core base of an Open Source ERP.
+It provides modularity, scalability and security.")
+    (license license:gpl3)))
-- 
2.13.0


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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-05-15 19:17   ` Catonano
@ 2017-05-16 17:12     ` Arun Isaac
       [not found]     ` <c3fa946d.AEMAKXA0lrIAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZGzM6@mailjet.com>
  1 sibling, 0 replies; 16+ messages in thread
From: Arun Isaac @ 2017-05-16 17:12 UTC (permalink / raw)
  To: Catonano; +Cc: 26401


>> GNU Health usually lags behind the latest Tryon, and currently runs on
>> Tryton 3.8. We will have to create a package for Tryton 3.8 as
>> well. This can just inherit from the latest tryton package, and modify
>> only the `version' and `source' fields. Could you do this?
>
> Yes, I think I could do it.  Bt if you don't mind I'd liie to delay
> this.

Sure!

tryton, and tryton related packages (especially the server side modules,
GNU Health, etc.) are numerous and complicated enough to deserve their
own separate file. You can put them in gnu/packages/tryton.scm.

> No, the current tarball is not suficient.  Genshi builds with python
> 3.3 only. With python 3.4 and 3.5 it doesn't build.
>
> This is mainly due to a change in thhe C API so a part of Genshi tat was
> written in C has to be re-written adgering to the new API
>
> The authors claim to need more time to do this.
>
> The Genshi issue tracker reports all this infomration, I linked the
> relevant issues in the comments
>
> Admittedly I don't understand what these patches do. They're too entrenched
> in the Genshi code base
>
> I shamelessly copied them from the Fedora package definition
> See here
> http://pkgs.fedoraproject.org/cgit/rpms/python-genshi.git/snapshot/python-genshi-f25.tar.gz
>
> I understand that they made an effort to make their Genshi package
> compatible with pythhon 3.4 too and that is not necessary or Guix
>
> But it's too complicated for me to excise the support for python 3.4

For all practical purposes, I think it's best to assume that there is no
python3 genshi package. Instead, we should simply package
python2-genshi, and let the authors fix their python3 package. In any
case, tryton needs only python2-genshi. So, there is no urgent need for
the python3 genshi package. I guess, this also means that there will be
no python3 relatorio package.

>> > +    (arguments
>> > +     `(#:phases
>> > +       (modify-phases %standard-phases
>> > +         (add-before 'check 'preparations
>> > +                     (lambda* _

Since you're not using any of `lambda*' features, you can just use `lambda' here.

>> > +                       ;; this is used in the tests
>> > +                       (setenv "DB_NAME" ":memory:"))))))
>>
>> Though this is shorter, I think it would be clearer to replace the
>> `check' phase altogether.
>
> mmm I'm not sure I can do this.
> I don't know much about setuptools, eggs and the such
> The check phase of the python build system is quite articulated, I don't
> feel like messing with it
>
> Feel free to rearrange this yourself as you see fit.

Actually, this is not a big deal. We'll leave it as it is. If necessary,
I'll fix it before pushing.

> diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> index 57a67de41..f1ef53e1a 100644
> --- a/gnu/packages/python.scm
> +++ b/gnu/packages/python.scm
> @@ -14622,3 +14622,25 @@ substitute for redis.")
>
>  (define-public python2-fakeredis
>    (package-with-python2 python-fakeredis))
> +
> +(define-public python-sql
> +  (package
> +    (name "python-sql")
> +    (version "0.8")
> +    (source
> +     (origin
> +       (method url-fetch)

...

> +       (uri (pypi-uri
> +             "python-sql"
> +             version))

Could you put these on the same line?

> +;; this package depends on python-genshi that
> +;; can be buit only with python-2
> +;; so providing a python33 version of this
> +;; is difficult
> +(define-public python2-relatorio
> +  (package
> +    (name "python-relatorio")
> +    (version "0.6.4")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (pypi-uri "relatorio" version))
> +       (sha256
> +        (base32
> +         "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
> +    (propagated-inputs
> +     `(("lxml" ,python2-lxml)
> +       ("genshi" ,python2-genshi)))

Use full names here, including the python version in the package name. I
mean the full name of "lxml" is "python2-lxml", not "python-lxml". Make
similar changes wherever applicable.

Also, in several places, there was a typo saying "pyton" instead of
"python". Please fix those.

> From b71cd2bd664e530dfabb3e558db15934f0ec204a Mon Sep 17 00:00:00 2001
> From: humanitiesNerd <catonano@gmail.com>
> Date: Thu, 6 Apr 2017 09:37:59 +0200
> Subject: [PATCH 4/5] gnu: Add python-trytond.
>
> * gnu/packages/python.scm (python-trytond, python2-trytond): New variables.

Change this commit message replacing python-trytond with trytond as
discussed earlier. Make a similar change for the commit message
involving python-tryton (the client).

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

* bug#26401: [PATCH] python-tryton (with no modules)
       [not found]     ` <c3fa946d.AEMAKXA0lrIAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZGzM6@mailjet.com>
@ 2017-05-16 18:36       ` Catonano
  2017-05-16 18:41       ` Catonano
  1 sibling, 0 replies; 16+ messages in thread
From: Catonano @ 2017-05-16 18:36 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 26401

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

2017-05-16 19:12 GMT+02:00 Arun Isaac <arunisaac@systemreboot.net>:

>
> Sure!
>
> tryton, and tryton related packages (especially the server side modules,
> GNU Health, etc.) are numerous and complicated enough to deserve their
> own separate file. You can put them in gnu/packages/tryton.scm.
>

Note taken. I will.

For all practical purposes, I think it's best to assume that there is no
> python3 genshi package. Instead, we should simply package
> python2-genshi, and let the authors fix their python3 package. In any
> case, tryton needs only python2-genshi. So, there is no urgent need for
> the python3 genshi package. I guess, this also means that there will be
> no python3 relatorio package.
>

I'm afraid you're right.
Sigh. I devolved way too much effort in packaging Genshi :-/



> >> > +    (arguments
> >> > +     `(#:phases
> >> > +       (modify-phases %standard-phases
> >> > +         (add-before 'check 'preparations
> >> > +                     (lambda* _
>
> Since you're not using any of `lambda*' features, you can just use
> `lambda' here.
>

note taken



Actually, this is not a big deal. We'll leave it as it is. If necessary,
> I'll fix it before pushing.
>

Thanks


>
> > diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
> > index 57a67de41..f1ef53e1a 100644
> > --- a/gnu/packages/python.scm
> > +++ b/gnu/packages/python.scm
> > @@ -14622,3 +14622,25 @@ substitute for redis.")
> >
> >  (define-public python2-fakeredis
> >    (package-with-python2 python-fakeredis))
> > +
> > +(define-public python-sql
> > +  (package
> > +    (name "python-sql")
> > +    (version "0.8")
> > +    (source
> > +     (origin
> > +       (method url-fetch)
>
> ...
>
> > +       (uri (pypi-uri
> > +             "python-sql"
> > +             version))
>
> Could you put these on the same line?
>

[...]


> > +    (propagated-inputs
> > +     `(("lxml" ,python2-lxml)
> > +       ("genshi" ,python2-genshi)))
>
> Use full names here, including the python version in the package name. I
> mean the full name of "lxml" is "python2-lxml", not "python-lxml". Make
> similar changes wherever applicable.
>

Ouch !
I owe you an apology, here

I mistakenly sent you the same patch file as before

I'm sorry :-/



>
> Also, in several places, there was a typo saying "pyton" instead of
> "python". Please fix those.
>

Gosh.
My keyboard si defective. I've been pleading with my technician for months
now.
I try to pay attention but more errors slip than I'd like
Sorry :-/


>
> > * gnu/packages/python.scm (python-trytond, python2-trytond): New
> variables.
>
> Change this commit message replacing python-trytond with trytond as
> discussed earlier. Make a similar change for the commit message
> involving python-tryton (the client).
>

Give me me some time to mourn my Genshi package.
I will send a new series (really, this time) soonish

Thanks

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

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

* bug#26401: [PATCH] python-tryton (with no modules)
       [not found]     ` <c3fa946d.AEMAKXA0lrIAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZGzM6@mailjet.com>
  2017-05-16 18:36       ` Catonano
@ 2017-05-16 18:41       ` Catonano
  2017-05-17  5:54         ` Arun Isaac
       [not found]         ` <4d3632b9.AEEAKq6kKpkAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZG-Wd@mailjet.com>
  1 sibling, 2 replies; 16+ messages in thread
From: Catonano @ 2017-05-16 18:41 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 26401

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

2017-05-16 19:12 GMT+02:00 Arun Isaac <arunisaac@systemreboot.net>:

>
> In any
> case, tryton needs only python2-genshi.


Out of curiosity: how can you say this ?
The Fedora package uses both Genshi and Relatorio with Python 3

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

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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-05-16 18:41       ` Catonano
@ 2017-05-17  5:54         ` Arun Isaac
       [not found]         ` <4d3632b9.AEEAKq6kKpkAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZG-Wd@mailjet.com>
  1 sibling, 0 replies; 16+ messages in thread
From: Arun Isaac @ 2017-05-17  5:54 UTC (permalink / raw)
  To: Catonano; +Cc: 26401


>> In any case, tryton needs only python2-genshi.
>
> Out of curiosity: how can you say this ?
> The Fedora package uses both Genshi and Relatorio with Python 3

I was looking at the Arch Linux packages in the AUR as a reference. Arch
has tryton packaged with python 2. But, I just checked the "Programming
Language" metadata in the setup.py of the tryton and trytond source
tarballs. It seems that tryton supports python 2.7, while trytond
supports python 2.7 and 3.5.

So, yes, you're right. At least for trytond, we could use python
3.5. But, considering the complexity of packaging (patching and all)
genshi for python 3.5, I think we should just wait for the python3.5
genshi to be properly ready and use python2 in the meantime. WDYT?

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

* bug#26401: [PATCH] python-tryton (with no modules)
       [not found]         ` <4d3632b9.AEEAKq6kKpkAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZG-Wd@mailjet.com>
@ 2017-05-17  7:45           ` Catonano
  2017-05-18 17:49             ` Arun Isaac
       [not found]             ` <7e6e3d0c.ADsAALmm2EQAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZHd6n@mailjet.com>
  0 siblings, 2 replies; 16+ messages in thread
From: Catonano @ 2017-05-17  7:45 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 26401

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

2017-05-17 7:54 GMT+02:00 Arun Isaac <arunisaac@systemreboot.net>:

>
> >> In any case, tryton needs only python2-genshi.
> >
> > Out of curiosity: how can you say this ?
> > The Fedora package uses both Genshi and Relatorio with Python 3
>
> I was looking at the Arch Linux packages in the AUR as a reference. Arch
> has tryton packaged with python 2. But, I just checked the "Programming
> Language" metadata in the setup.py of the tryton and trytond source
> tarballs. It seems that tryton supports python 2.7, while trytond
> supports python 2.7 and 3.5.
>
> So, yes, you're right. At least for trytond, we could use python
> 3.5. But, considering the complexity of packaging (patching and all)
> genshi for python 3.5, I think we should just wait for the python3.5
> genshi to be properly ready and use python2 in the meantime. WDYT?
>

I know that the Guix poliicy is to let upstream do its homework.

But in this case I would keep the patched Genshi

In fact, if you read the most recent thread in the Genshi google group:

https://groups.google.com/forum/#!forum/genshi

 you can deduce that:


   1. the patches have been used by mainstream distros for almost 2 years
   now, if I understand correctly
   2. the development of Genshi is stalled. The last contribution (adding
   travis) was 2 years ago

what is being deployed by other distros already is, substantially, the new
Genshi release

And unless someone steps up in maintaning the project, there won't be a
formal release anytime soon

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

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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-05-17  7:45           ` Catonano
@ 2017-05-18 17:49             ` Arun Isaac
       [not found]             ` <7e6e3d0c.ADsAALmm2EQAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZHd6n@mailjet.com>
  1 sibling, 0 replies; 16+ messages in thread
From: Arun Isaac @ 2017-05-18 17:49 UTC (permalink / raw)
  To: Catonano; +Cc: 26401


> I know that the Guix poliicy is to let upstream do its homework.
>
> But in this case I would keep the patched Genshi
>
> In fact, if you read the most recent thread in the Genshi google group:
>
> https://groups.google.com/forum/#!forum/genshi
>
>  you can deduce that:
>
>    1. the patches have been used by mainstream distros for almost 2 years
>    now, if I understand correctly
>    2. the development of Genshi is stalled. The last contribution (adding
>    travis) was 2 years ago

> what is being deployed by other distros already is, substantially, the new
> Genshi release
>
> And unless someone steps up in maintaning the project, there won't be a
> formal release anytime soon

Oh, I thought the next genshi release was just around the corner. I
didn't realize that development was stalled. Ok, then. If other distros
are using these patches without problems, let's also have python3 genshi
and relatorio packages.

But, let's build trytond with python2. GNU Health still needs trytond
3.8, and trytond 3.8 only supports python2.

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

* bug#26401: [PATCH] python-tryton (with no modules)
       [not found]             ` <7e6e3d0c.ADsAALmm2EQAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZHd6n@mailjet.com>
@ 2017-05-18 18:03               ` Catonano
  2017-05-20  7:39               ` Catonano
  1 sibling, 0 replies; 16+ messages in thread
From: Catonano @ 2017-05-18 18:03 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 26401

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

2017-05-18 19:49 GMT+02:00 Arun Isaac <arunisaac@systemreboot.net>:

>
> > I know that the Guix poliicy is to let upstream do its homework.
> >
> > But in this case I would keep the patched Genshi
> >
> > In fact, if you read the most recent thread in the Genshi google group:
> >
> > https://groups.google.com/forum/#!forum/genshi
> >
> >  you can deduce that:
> >
> >    1. the patches have been used by mainstream distros for almost 2 years
> >    now, if I understand correctly
> >    2. the development of Genshi is stalled. The last contribution (adding
> >    travis) was 2 years ago
>
> > what is being deployed by other distros already is, substantially, the
> new
> > Genshi release
> >
> > And unless someone steps up in maintaning the project, there won't be a
> > formal release anytime soon
>
> Oh, I thought the next genshi release was just around the corner. I
> didn't realize that development was stalled. Ok, then. If other distros
> are using these patches without problems, let's also have python3 genshi
> and relatorio packages.
>
> But, let's build trytond with python2. GNU Health still needs trytond
> 3.8, and trytond 3.8 only supports python2.
>

Ok

I'll send you a new version of my patches bundle soonish.

Let's say tomorrow

Thanks !

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

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

* bug#26401: [PATCH] python-tryton (with no modules)
       [not found]             ` <7e6e3d0c.ADsAALmm2EQAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZHd6n@mailjet.com>
  2017-05-18 18:03               ` Catonano
@ 2017-05-20  7:39               ` Catonano
  2017-05-22 21:13                 ` Arun Isaac
                                   ` (2 more replies)
  1 sibling, 3 replies; 16+ messages in thread
From: Catonano @ 2017-05-20  7:39 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 26401


[-- Attachment #1.1: Type: text/plain, Size: 1025 bytes --]

So, here I am

2017-05-18 19:49 GMT+02:00 Arun Isaac <arunisaac@systemreboot.net>:

>
> Oh, I thought the next genshi release was just around the corner. I
> didn't realize that development was stalled. Ok, then. If other distros
> are using these patches without problems, let's also have python3 genshi
> and relatorio packages.
>
> But, let's build trytond with python2. GNU Health still needs trytond
> 3.8, and trytond 3.8 only supports python2.
>

I though about this a bit more

Tryton is an autonomous framework, it can be used without GNUHealth and
with no relation to it

Someone might want to use it with python3.

I myself could be involved in a project that uses Trytond and has no
relationship whatsoever with GNUHealth.
This should be in september.

When and if I will package GNUHealth, we'll see how to arrange things

It might depend on python2-trytond or I might wait for a newer version that
depends on a current Tryton

So for now I send this as it was, with some corrections.

Please let me know
Thanks

[-- Attachment #1.2: Type: text/html, Size: 1790 bytes --]

[-- Attachment #2: series.patch --]
[-- Type: text/x-patch, Size: 30941 bytes --]

From edca647dd8fdc3680567bffc555ab892499ff3a5 Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Tue, 28 Mar 2017 12:25:06 +0200
Subject: [PATCH 1/5] gnu: Add python-sql.

* gnu/packages/python.scm (python-sql, python2-sql): New variables.
---
 gnu/packages/python.scm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 57a67de41..f1ef53e1a 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14622,3 +14622,25 @@ substitute for redis.")
 
 (define-public python2-fakeredis
   (package-with-python2 python-fakeredis))
+
+(define-public python-sql
+  (package
+    (name "python-sql")
+    (version "0.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri
+             "python-sql"
+             version))
+       (sha256
+        (base32
+         "0xik939sxqfqqbpgcsnfjnws692bjip32khgwhq1ycphfy7df3h2"))))
+    (build-system python-build-system)
+    (home-page "https://python-sql.tryton.org/")
+    (synopsis "Library to write SQL queries")
+    (description "Idiomatic python function calls get transformed in well formed SQL queries.")
+    (license license:bsd-3)))
+
+(define-public python2-sql
+  (package-with-python2 python-sql))
-- 
2.13.0


From 4680a5cca214ca6992bb9bac1db9cda1c7b9be68 Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Wed, 5 Apr 2017 15:29:56 +0200
Subject: [PATCH 2/5] gnu: Add python-genshi.

 * gnu/packages/python.scm (python-genshi, python2-genshi): New variables.
 * gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patct: New file.
 * gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch: New file.
 * gnu/packages/patches/python-genshi-isstring-helper.patch: New file.
 * gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch: New file.
 * gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch: New file.
 * gnu/packages/patches/python-genshi-buildable-on-python27-too.patch: New file.
 * gnu/local.mk (dist_patch_DATA): Add them.
---
 gnu/local.mk                                       |   6 +
 ...-for-Python-3.4-AST-support-for-NameConst.patch | 151 +++++++++++++++++++++
 ...-speedups-C-extension-on-CPython-3.3-sinc.patch |  32 +++++
 .../python-genshi-buildable-on-python27-too.patch  |  25 ++++
 ...ython-genshi-fixing-the-tests-on-python35.patch | 112 +++++++++++++++
 .../patches/python-genshi-isstring-helper.patch    |  37 +++++
 ...tripping-of-unsafe-script-tags-Python-3.4.patch |  51 +++++++
 gnu/packages/python.scm                            |  42 ++++++
 8 files changed, 456 insertions(+)
 create mode 100644 gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
 create mode 100644 gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
 create mode 100644 gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
 create mode 100644 gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
 create mode 100644 gnu/packages/patches/python-genshi-isstring-helper.patch
 create mode 100644 gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 04d259df9..676e3fd0c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -930,6 +930,12 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-file-double-encoding-bug.patch	\
   %D%/packages/patches/python-fix-tests.patch			\
   %D%/packages/patches/python-parse-too-many-fields.patch	\
+  %D%/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch	\
+  %D%/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch	\
+  %D%/packages/patches/python-genshi-isstring-helper.patch	\
+  %D%/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch	\
+  %D%/packages/patches/python-genshi-fixing-the-tests-on-python35.patch	\
+  %D%/packages/patches/python-genshi-buildable-on-python27-too.patch	\
   %D%/packages/patches/python2-rdflib-drop-sparqlwrapper.patch	\
   %D%/packages/patches/python-statsmodels-fix-tests.patch	\
   %D%/packages/patches/python-configobj-setuptools.patch	\
diff --git a/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch b/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
new file mode 100644
index 000000000..4e40c1daa
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch
@@ -0,0 +1,151 @@
+From 86b98a11559da7d1b21dc9b4c6b10511b9095bc4 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:46:15 +0000
+Subject: [PATCH 05/16] Add support for Python 3.4 AST (support for
+ NameConstants and changes to existing to arguments node attributes).
+
+---
+ genshi/template/astutil.py | 31 ++++++++++++++++++++++++++++---
+ genshi/template/eval.py    | 34 +++++++++++++++++++---------------
+ 2 files changed, 47 insertions(+), 18 deletions(-)
+
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index a4c21c8..a3946b4 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -21,7 +21,7 @@ else:
+     def parse(source, mode):
+         return compile(source, '', mode, _ast.PyCF_ONLY_AST)
+ 
+-from genshi.compat import IS_PYTHON2
++from genshi.compat import IS_PYTHON2, isstring
+ 
+ __docformat__ = 'restructuredtext en'
+ 
+@@ -103,8 +103,13 @@ class ASTCodeGenerator(object):
+         self._new_line()
+         return self.visit(node.body)
+ 
++    # Python < 3.4
+     # arguments = (expr* args, identifier? vararg,
+     #              identifier? kwarg, expr* defaults)
++    #
++    # Python >= 3.4
++    # arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,
++    #              arg? kwarg, expr* defaults)
+     def visit_arguments(self, node):
+         first = True
+         no_default_count = len(node.args) - len(node.defaults)
+@@ -122,13 +127,21 @@ class ASTCodeGenerator(object):
+                 self._write(', ')
+             else:
+                 first = False
+-            self._write('*' + node.vararg)
++            self._write('*')
++            if isstring(node.vararg):
++                self._write(node.vararg)
++            else:
++                self.visit(node.vararg)
+         if getattr(node, 'kwarg', None):
+             if not first:
+                 self._write(', ')
+             else:
+                 first = False
+-            self._write('**' + node.kwarg)
++            self._write('**')
++            if isstring(node.kwarg):
++                self._write(node.kwarg)
++            else:
++                self.visit(node.kwarg)
+ 
+     if not IS_PYTHON2:
+         # In Python 3 arguments get a special node
+@@ -724,6 +737,17 @@ class ASTCodeGenerator(object):
+     def visit_Name(self, node):
+         self._write(node.id)
+ 
++    # NameConstant(singleton value)
++    def visit_NameConstant(self, node):
++        if node.value is None:
++            self._write('None')
++        elif node.value is True:
++            self._write('True')
++        elif node.value is False:
++            self._write('False')
++        else:
++            raise Exception("Unknown NameConstant %r" % (node.value,))
++
+     # List(expr* elts, expr_context ctx)
+     def visit_List(self, node):
+         self._write('[')
+@@ -829,6 +853,7 @@ class ASTTransformer(object):
+     visit_Attribute = _clone
+     visit_Subscript = _clone
+     visit_Name = _clone
++    visit_NameConstant = _clone
+     visit_List = _clone
+     visit_Tuple = _clone
+ 
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index 89aec49..de4bc86 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -24,7 +24,8 @@ from genshi.template.astutil import ASTTransformer, ASTCodeGenerator, \
+ from genshi.template.base import TemplateRuntimeError
+ from genshi.util import flatten
+ 
+-from genshi.compat import get_code_params, build_code_chunk, IS_PYTHON2
++from genshi.compat import get_code_params, build_code_chunk, isstring, \
++                          IS_PYTHON2
+ 
+ __all__ = ['Code', 'Expression', 'Suite', 'LenientLookup', 'StrictLookup',
+            'Undefined', 'UndefinedError']
+@@ -495,28 +496,31 @@ class TemplateASTTransformer(ASTTransformer):
+     def __init__(self):
+         self.locals = [CONSTANTS]
+ 
++    def _process(self, names, node):
++        if not IS_PYTHON2 and isinstance(node, _ast.arg):
++            names.add(node.arg)
++        elif isstring(node):
++            names.add(node)
++        elif isinstance(node, _ast.Name):
++            names.add(node.id)
++        elif isinstance(node, _ast.alias):
++            names.add(node.asname or node.name)
++        elif isinstance(node, _ast.Tuple):
++            for elt in node.elts:
++                self._process(names, elt)
++
+     def _extract_names(self, node):
+         names = set()
+-        def _process(node):
+-            if not IS_PYTHON2 and isinstance(node, _ast.arg):
+-                names.add(node.arg)
+-            if isinstance(node, _ast.Name):
+-                names.add(node.id)
+-            elif isinstance(node, _ast.alias):
+-                names.add(node.asname or node.name)
+-            elif isinstance(node, _ast.Tuple):
+-                for elt in node.elts:
+-                    _process(elt)
+         if hasattr(node, 'args'):
+             for arg in node.args:
+-                _process(arg)
++                self._process(names, arg)
+             if hasattr(node, 'vararg'):
+-                names.add(node.vararg)
++                self._process(names, node.vararg)
+             if hasattr(node, 'kwarg'):
+-                names.add(node.kwarg)
++                self._process(names, node.kwarg)
+         elif hasattr(node, 'names'):
+             for elt in node.names:
+-                _process(elt)
++                self._process(names, elt)
+         return names
+ 
+     def visit_Str(self, node):
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch b/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
new file mode 100644
index 000000000..c25c3bd7a
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch
@@ -0,0 +1,32 @@
+From cef2c8df44166195e1705638f9f17033a4943bb7 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:32:21 +0000
+Subject: [PATCH 02/15] Disable the speedups C extension on CPython >= 3.3
+ since Genshi doesn't support the new Unicode C API yet.
+
+---
+ setup.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 123a2cb..a3d748c 100755
+--- a/setup.py
++++ b/setup.py
+@@ -65,9 +65,13 @@ available.""")
+ 
+ 
+ if Feature:
++    # Optional C extension module for speeding up Genshi:
++    # Not activated by default on:
++    # - PyPy (where it harms performance)
++    # - CPython >= 3.3 (the new Unicode C API is not supported yet)
+     speedups = Feature(
+         "optional C speed-enhancements",
+-        standard = not is_pypy,
++        standard = not is_pypy and sys.version_info < (3, 3),
+         ext_modules = [
+             Extension('genshi._speedups', ['genshi/_speedups.c']),
+         ],
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch b/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
new file mode 100644
index 000000000..13289fbe8
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-buildable-on-python27-too.patch
@@ -0,0 +1,25 @@
+From 32bfaa7cc1c736fd62fcbb6414de9498dc20ed07 Mon Sep 17 00:00:00 2001
+From: Adriano Peluso <catonano@gmail.com>
+Date: Wed, 5 Apr 2017 15:13:06 +0200
+Subject: [PATCH 2/2] buildable on python27 too
+
+---
+ genshi/template/directives.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/genshi/template/directives.py b/genshi/template/directives.py
+index 6fd0f28..1f70ef6 100644
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,7 +266,7 @@ class DefDirective(Directive):
+         if isinstance(ast, _ast.Call):
+             self.name = ast.func.id
+             for arg in ast.args:
+-                if isinstance(arg, _ast.Starred):
++                if hasattr(_ast, 'Starred') and isinstance(arg, _ast.Starred):
+                     # Python 3.5+
+                     self.star_args = arg.value.id
+                 else:
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch b/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
new file mode 100644
index 000000000..f1905e7cf
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-fixing-the-tests-on-python35.patch
@@ -0,0 +1,112 @@
+From ce796ad4bae5c47011876778674ad036357febdf Mon Sep 17 00:00:00 2001
+From: Adriano Peluso <catonano@gmail.com>
+Date: Wed, 5 Apr 2017 15:10:06 +0200
+Subject: [PATCH 1/2] fixing the tests on python35
+
+---
+ genshi/filters/i18n.py        |  6 ++++--
+ genshi/template/astutil.py    | 14 +++++++++++---
+ genshi/template/directives.py | 20 ++++++++++++++------
+ genshi/template/eval.py       |  5 +++++
+ 4 files changed, 34 insertions(+), 11 deletions(-)
+
+diff --git a/genshi/filters/i18n.py b/genshi/filters/i18n.py
+index 526fda4..5387fcf 100644
+--- a/genshi/filters/i18n.py
++++ b/genshi/filters/i18n.py
+@@ -1194,8 +1194,10 @@ def extract_from_code(code, gettext_functions):
+                 elif arg:
+                     strings.append(None)
+             [_add(arg) for arg in node.args]
+-            _add(node.starargs)
+-            _add(node.kwargs)
++            if hasattr(node, 'starargs'):
++                _add(node.starargs)
++            if hasattr(node, 'kwargs'):
++                _add(node.kwargs)
+             if len(strings) == 1:
+                 strings = strings[0]
+             else:
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index f4e1edd..e561846 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -151,6 +151,10 @@ class ASTCodeGenerator(object):
+         def visit_arg(self, node):
+             self._write(node.arg)
+ 
++    def visit_Starred(self, node):
++        self._write('*')
++        self.visit(node.value)
++
+     # FunctionDef(identifier name, arguments args,
+     #                           stmt* body, expr* decorator_list)
+     def visit_FunctionDef(self, node):
+@@ -664,9 +668,13 @@ class ASTCodeGenerator(object):
+             if not first:
+                 self._write(', ')
+             first = False
+-            # keyword = (identifier arg, expr value)
+-            self._write(keyword.arg)
+-            self._write('=')
++            if not keyword.arg:
++                # Python 3.5+ star-star args
++                self._write('**')
++            else:
++                # keyword = (identifier arg, expr value)
++                self._write(keyword.arg)
++                self._write('=')
+             self.visit(keyword.value)
+         if getattr(node, 'starargs', None):
+             if not first:
+diff --git a/genshi/template/directives.py b/genshi/template/directives.py
+index 7301c2d..6fd0f28 100644
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,13 +266,21 @@ class DefDirective(Directive):
+         if isinstance(ast, _ast.Call):
+             self.name = ast.func.id
+             for arg in ast.args:
+-                # only names
+-                self.args.append(arg.id)
++                if isinstance(arg, _ast.Starred):
++                    # Python 3.5+
++                    self.star_args = arg.value.id
++                else:
++                    # only names
++                    self.args.append(arg.id)
+             for kwd in ast.keywords:
+-                self.args.append(kwd.arg)
+-                exp = Expression(kwd.value, template.filepath,
+-                                 lineno, lookup=template.lookup)
+-                self.defaults[kwd.arg] = exp
++                if kwd.arg is None:
++                    # Python 3.5+
++                    self.dstar_args = kwd.value.id
++                else:
++                    self.args.append(kwd.arg)
++                    exp = Expression(kwd.value, template.filepath,
++                                     lineno, lookup=template.lookup)
++                    self.defaults[kwd.arg] = exp
+             if getattr(ast, 'starargs', None):
+                 self.star_args = ast.starargs.id
+             if getattr(ast, 'kwargs', None):
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index d378419..81644a7 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -600,6 +600,11 @@ class TemplateASTTransformer(ASTTransformer):
+         finally:
+             self.locals.pop()
+ 
++    # Only used in Python 3.5+
++    def visit_Starred(self, node):
++        node.value = self.visit(node.value)
++        return node
++
+     def visit_Name(self, node):
+         # If the name refers to a local inside a lambda, list comprehension, or
+         # generator expression, leave it alone
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-isstring-helper.patch b/gnu/packages/patches/python-genshi-isstring-helper.patch
new file mode 100644
index 000000000..4f6c19bba
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-isstring-helper.patch
@@ -0,0 +1,37 @@
+From cc5e07284f44cdd9beec178c69070a53f55d1323 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:43:20 +0000
+Subject: [PATCH 03/15] Add isstring helper.
+
+---
+ genshi/compat.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/genshi/compat.py b/genshi/compat.py
+index 9787325..6574e39 100644
+--- a/genshi/compat.py
++++ b/genshi/compat.py
+@@ -35,6 +35,15 @@ else:
+                 'Python 2 compatibility function. Not usable in Python 3.')
+ 
+ 
++# We need to test if an object is an instance of a string type in places
++
++if IS_PYTHON2:
++    def isstring(obj):
++        return isinstance(obj, basestring)
++else:
++    def isstring(obj):
++        return isinstance(obj, str)
++
+ # We need to differentiate between StringIO and BytesIO in places
+ 
+ if IS_PYTHON2:
+@@ -112,4 +121,3 @@ except NameError:
+             if not x:
+                 return False
+         return True
+-
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch b/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch
new file mode 100644
index 000000000..29951a614
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch
@@ -0,0 +1,51 @@
+From 0769be04c3891ae5c724c6779ba13d1d0f53b4ae Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:25:17 +0000
+Subject: [PATCH 01/15] Also allow stripping of unsafe script tags (Python 3.4
+ parses the second example as a tag whose name is script&xyz).
+
+---
+ genshi/filters/tests/test_html.py | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/genshi/filters/tests/test_html.py b/genshi/filters/tests/test_html.py
+index 0c6cfe1..45ec0da 100644
+--- a/genshi/filters/tests/test_html.py
++++ b/genshi/filters/tests/test_html.py
+@@ -368,12 +368,16 @@ def StyleSanitizer():
+ 
+ class HTMLSanitizerTestCase(unittest.TestCase):
+ 
+-    def assert_parse_error_or_equal(self, expected, exploit):
++    def assert_parse_error_or_equal(self, expected, exploit,
++                                    allow_strip=False):
+         try:
+             html = HTML(exploit)
+         except ParseError:
+             return
+-        self.assertEquals(expected, (html | HTMLSanitizer()).render())
++        sanitized_html = (html | HTMLSanitizer()).render()
++        if not sanitized_html and allow_strip:
++            return
++        self.assertEquals(expected, sanitized_html)
+ 
+     def test_sanitize_unchanged(self):
+         html = HTML(u'<a href="#">fo<br />o</a>')
+@@ -416,10 +420,12 @@ class HTMLSanitizerTestCase(unittest.TestCase):
+         html = HTML(u'<SCRIPT SRC="http://example.com/"></SCRIPT>')
+         self.assertEquals('', (html | HTMLSanitizer()).render())
+         src = u'<SCR\0IPT>alert("foo")</SCR\0IPT>'
+-        self.assert_parse_error_or_equal('&lt;SCR\x00IPT&gt;alert("foo")', src)
++        self.assert_parse_error_or_equal('&lt;SCR\x00IPT&gt;alert("foo")', src,
++                                         allow_strip=True)
+         src = u'<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>'
+         self.assert_parse_error_or_equal('&lt;SCRIPT&amp;XYZ; '
+-                                         'SRC="http://example.com/"&gt;', src)
++                                         'SRC="http://example.com/"&gt;', src,
++                                         allow_strip=True)
+ 
+     def test_sanitize_remove_onclick_attr(self):
+         html = HTML(u'<div onclick=\'alert("foo")\' />')
+-- 
+2.12.0
+
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index f1ef53e1a..898fef153 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14644,3 +14644,45 @@ substitute for redis.")
 
 (define-public python2-sql
   (package-with-python2 python-sql))
+
+(define-public python-genshi
+  (package
+    (name "python-genshi")
+    (version "0.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://ftp.edgewall.org/pub/genshi/Genshi-"
+             version
+             ".tar.gz"))
+       (patches
+        (search-patches
+         ;; The first 4 patches are in the master branch upstream.
+         ;; see this as a reference https://genshi.edgewall.org/ticket/582
+         ;; The last 2 are NOT in any branch.
+         ;; They were sent as attachments to a ticket opened at
+         ;; https://genshi.edgewall.org/ticket/602#no1
+         "python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch"
+         "python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch"
+         "python-genshi-isstring-helper.patch"
+         "python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch"
+         "python-genshi-fixing-the-tests-on-python35.patch"
+         "python-genshi-buildable-on-python27-too.patch"))
+       (sha256
+        (base32
+         "0lkkbp6fbwzv0zda5iqc21rr7rdldkwh3hfabfjl9i4bwq14858x"))))
+    (build-system python-build-system)
+    (home-page "https://genshi.edgewall.org/")
+    (synopsis "Toolkit for generation of output for the web")
+    (description "Genshi is a Python library that provides
+an integrated set of components for parsing, generating, and processing HTML, XML
+or other textual content for output generation on the web")
+    (license license:bsd-3)))
+
+;; the linter here claims that patch file names
+;; should start with the package name.
+;; In this case the patches are inherited from
+;; python-genshi without the "2"
+(define-public python2-genshi
+  (package-with-python2 python-genshi))
-- 
2.13.0


From 01c83c390865628b8889262ee59e0b460bd85328 Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Sat, 20 May 2017 09:19:00 +0200
Subject: [PATCH 3/5] gnu: Add relatorio.

* gnu/packages/python.scm (python-relatorio, python2-relatorio): New variables.
---
 gnu/packages/python.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 898fef153..3268dcc85 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14686,3 +14686,30 @@ or other textual content for output generation on the web")
 ;; python-genshi without the "2"
 (define-public python2-genshi
   (package-with-python2 python-genshi))
+
+(define-public python-relatorio
+  (package
+    (name "python-relatorio")
+    (version "0.6.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "relatorio" version))
+       (sha256
+        (base32
+         "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
+    (propagated-inputs
+     `(("lxml" ,python-lxml)
+       ("genshi" ,python-genshi)))
+    (build-system python-build-system)
+    (home-page "https://relatorio.tryton.org/")
+    (synopsis "Templating library able to output odt and pdf files")
+    (description
+     "Relatorio is a templating library which
+provides a way to easily output several kinds of files
+(odt, ods, png, svg, …).  Support for more filetypes can be
+easily added by creating plugins for them.")
+    (license license:lgpl3)))
+
+(define-public python2-relatorio
+  (package-with-python2 python-relatorio))
-- 
2.13.0


From 603e00c231ea889293e159c7543f2ef40f6c7b81 Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Sat, 20 May 2017 08:21:31 +0200
Subject: [PATCH 4/5] gnu: Add trytond.

* gnu/packages/tryton.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Register it.
* gnu/packages/tryton.scm (trytond, python2-trytond): New variables.
---
 gnu/local.mk            |  1 +
 gnu/packages/tryton.scm | 78 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
 create mode 100644 gnu/packages/tryton.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 676e3fd0c..1eb9f5bfa 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -321,6 +321,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/protobuf.scm			\
   %D%/packages/pv.scm				\
   %D%/packages/python.scm			\
+  %D%/packages/tryton.scm			\
   %D%/packages/qemu.scm				\
   %D%/packages/qt.scm				\
   %D%/packages/ragel.scm			\
diff --git a/gnu/packages/tryton.scm b/gnu/packages/tryton.scm
new file mode 100644
index 000000000..856ed6f3a
--- /dev/null
+++ b/gnu/packages/tryton.scm
@@ -0,0 +1,78 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 Adriano Peluso <catonano@gmail.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/>.
+;;;
+;;; Copyright © 2017 Adriano Peluso <catonano@gmail.com>
+
+(define-module (gnu packages tryton)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system python)
+  #:use-module (gnu packages gtk)  
+  )
+
+(define-public trytond
+  (package
+    (name "trytond")
+    (version "4.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://downloads.tryton.org/4.4/trytond-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "0f5xh4s8xr01rrz63accrz8lpsni0dfsjrnl4h3widrgz6ds2fr6"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'preparations
+                     (lambda* _
+                       ;; this is used in the tests
+                       (setenv "DB_NAME" ":memory:"))))))
+    (inputs
+     `(("python-polib" ,python-polib)
+       ("python-dateutil" ,python-dateutil)
+       ("python-werkzeug" ,python-werkzeug)
+       ("python-wrapt" ,python-wrapt)
+       ("python-sql" ,python-sql)
+       ("python-genshi" ,python-genshi)
+       ("python-relatorio" ,python-relatorio)
+       ("python-lxml" ,python-lxml)
+       ;; there's no python-mysql in Guix right now
+       ;; so psycopg (postgresql) only for now
+       ("python-psycopg" ,python-psycopg2)))
+    (native-inputs
+     ;; this is used in the tests
+     `(("python-mock" ,python-mock)))
+    (home-page "http://www.tryton.org/")
+    (synopsis "Server component of Tryton")
+    (description
+   "The server of the Tryton application platform.
+A three-tiers high-level general purpose application platform
+written in Python and use Postgresql as main database engine.
+It is the core base of an Open Source ERP.
+It provides modularity, scalability and security.")
+    (license license:gpl3)))
+
+(define-public python2-trytond
+  (package-with-python2 trytond))
-- 
2.13.0


From 4e0dbe38855b115749f5deb278d7a6d64d978e99 Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Sat, 20 May 2017 08:32:08 +0200
Subject: [PATCH 5/5] gnu: Add tryton.

* gnu/packages/tryton.scm (tryton): New variable.
---
 gnu/packages/tryton.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/tryton.scm b/gnu/packages/tryton.scm
index 856ed6f3a..eb923f889 100644
--- a/gnu/packages/tryton.scm
+++ b/gnu/packages/tryton.scm
@@ -76,3 +76,33 @@ It provides modularity, scalability and security.")
 
 (define-public python2-trytond
   (package-with-python2 trytond))
+
+;; this depends on pygtk that is available or python@2 only
+(define-public tryton
+  (package
+    (name "tryton")
+    (version "4.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://downloads.tryton.org/4.4/tryton-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "1lklcz5fs6rkrd7z2m2f5gz4fdwzkgnhg2hyvzp20kdsvi33bq2j"))))
+    (arguments
+     `(#:python ,python-2))
+    (inputs
+     `(("python-chardet" ,python2-chardet)
+       ("python-dateutil" ,python2-dateutil)
+       ("python2-pygtk" ,python2-pygtk)))
+    (build-system python-build-system)
+    (home-page "http://www.tryton.org/")
+    (synopsis "Client component of Tryton")
+    (description "The client of the Tryton application platform.
+A three-tiers high-level general purpose application platform
+written in Python and use Postgresql as main database engine.
+It is the core base of an Open Source ERP.
+It provides modularity, scalability and security.")
+    (license license:gpl3)))
-- 
2.13.0


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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-05-20  7:39               ` Catonano
@ 2017-05-22 21:13                 ` Arun Isaac
  2017-05-27 14:21                 ` Arun Isaac
       [not found]                 ` <57fa2a94.AEMAKvi84IwAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZKYuO@mailjet.com>
  2 siblings, 0 replies; 16+ messages in thread
From: Arun Isaac @ 2017-05-22 21:13 UTC (permalink / raw)
  To: Catonano; +Cc: 26401

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


> Tryton is an autonomous framework, it can be used without GNUHealth and
> with no relation to it
>
> Someone might want to use it with python3.

Ok, fair enough. Let's build trytond with python3.

I have made many small improvements to your patchset. I think it is ready
to be pushed. But, do verify, and let me know. I could have missed
something or removed something you consider important. Please find the
new patchset attached.


[-- Attachment #2: series.patch --]
[-- Type: text/x-patch, Size: 30738 bytes --]

From 53feec2122c419a424471148e0c8c68407a54f7b Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Tue, 28 Mar 2017 12:25:06 +0200
Subject: [PATCH 1/5] gnu: Add python-sql.

* gnu/packages/python.scm (python-sql, python2-sql): New variables.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
---
 gnu/packages/python.scm | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 54dc49390..579886933 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14622,3 +14622,24 @@ substitute for redis.")
 
 (define-public python2-fakeredis
   (package-with-python2 python-fakeredis))
+
+(define-public python-sql
+  (package
+    (name "python-sql")
+    (version "0.9")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-sql" version))
+       (sha256
+        (base32
+         "0p6kaqj02vz0habmdx37zjk6hjxdfm8aw737zs059vvpr70ird87"))))
+    (build-system python-build-system)
+    (home-page "https://python-sql.tryton.org/")
+    (synopsis "Library to write SQL queries in a pythonic way")
+    (description "@code{python-sql} is a library to write SQL queries, that
+transforms idiomatic python function calls to well-formed SQL queries.")
+    (license license:bsd-3)))
+
+(define-public python2-sql
+  (package-with-python2 python-sql))
-- 
2.12.2

From 69bd9ad411e9f7e229199267bb0d7fe62b77fbde Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Wed, 5 Apr 2017 15:29:56 +0200
Subject: [PATCH 2/5] gnu: Add python-genshi.

 * gnu/packages/python.scm (python-genshi, python2-genshi): New variables.
 * gnu/packages/patches/python-genshi-add-support-for-python-3.4-AST.patch: New file.
 * gnu/packages/patches/python-genshi-buildable-on-python-2.7.patch: New file.
 * gnu/packages/patches/python-genshi-disable-speedups-on-python-3.3.patch: New file.
 * gnu/packages/patches/python-genshi-fix-tests-on-python-3.5.patch: New file.
 * gnu/packages/patches/python-genshi-isstring-helper.patch: New file.
 * gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags.patch: New file.
 * gnu/local.mk (dist_patch_DATA): Add them.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
---
 gnu/local.mk                                       |   6 +
 ...hon-genshi-add-support-for-python-3.4-AST.patch | 151 +++++++++++++++++++++
 .../python-genshi-buildable-on-python-2.7.patch    |  25 ++++
 ...hon-genshi-disable-speedups-on-python-3.3.patch |  32 +++++
 .../python-genshi-fix-tests-on-python-3.5.patch    | 112 +++++++++++++++
 .../patches/python-genshi-isstring-helper.patch    |  37 +++++
 ...on-genshi-stripping-of-unsafe-script-tags.patch |  51 +++++++
 gnu/packages/python.scm                            |  40 ++++++
 8 files changed, 454 insertions(+)
 create mode 100644 gnu/packages/patches/python-genshi-add-support-for-python-3.4-AST.patch
 create mode 100644 gnu/packages/patches/python-genshi-buildable-on-python-2.7.patch
 create mode 100644 gnu/packages/patches/python-genshi-disable-speedups-on-python-3.3.patch
 create mode 100644 gnu/packages/patches/python-genshi-fix-tests-on-python-3.5.patch
 create mode 100644 gnu/packages/patches/python-genshi-isstring-helper.patch
 create mode 100644 gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 16b80fde9..f5b32bd88 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -932,6 +932,12 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-file-double-encoding-bug.patch	\
   %D%/packages/patches/python-fix-tests.patch			\
   %D%/packages/patches/python-parse-too-many-fields.patch	\
+  %D%/packages/patches/python-genshi-Disable-the-speedups-C-extension-on-CPython-3.3-sinc.patch	\
+  %D%/packages/patches/python-genshi-stripping-of-unsafe-script-tags-Python-3.4.patch	\
+  %D%/packages/patches/python-genshi-isstring-helper.patch	\
+  %D%/packages/patches/python-genshi-Add-support-for-Python-3.4-AST-support-for-NameConst.patch	\
+  %D%/packages/patches/python-genshi-fixing-the-tests-on-python35.patch	\
+  %D%/packages/patches/python-genshi-buildable-on-python27-too.patch	\
   %D%/packages/patches/python2-rdflib-drop-sparqlwrapper.patch	\
   %D%/packages/patches/python-statsmodels-fix-tests.patch	\
   %D%/packages/patches/python-configobj-setuptools.patch	\
diff --git a/gnu/packages/patches/python-genshi-add-support-for-python-3.4-AST.patch b/gnu/packages/patches/python-genshi-add-support-for-python-3.4-AST.patch
new file mode 100644
index 000000000..4e40c1daa
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-add-support-for-python-3.4-AST.patch
@@ -0,0 +1,151 @@
+From 86b98a11559da7d1b21dc9b4c6b10511b9095bc4 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:46:15 +0000
+Subject: [PATCH 05/16] Add support for Python 3.4 AST (support for
+ NameConstants and changes to existing to arguments node attributes).
+
+---
+ genshi/template/astutil.py | 31 ++++++++++++++++++++++++++++---
+ genshi/template/eval.py    | 34 +++++++++++++++++++---------------
+ 2 files changed, 47 insertions(+), 18 deletions(-)
+
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index a4c21c8..a3946b4 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -21,7 +21,7 @@ else:
+     def parse(source, mode):
+         return compile(source, '', mode, _ast.PyCF_ONLY_AST)
+ 
+-from genshi.compat import IS_PYTHON2
++from genshi.compat import IS_PYTHON2, isstring
+ 
+ __docformat__ = 'restructuredtext en'
+ 
+@@ -103,8 +103,13 @@ class ASTCodeGenerator(object):
+         self._new_line()
+         return self.visit(node.body)
+ 
++    # Python < 3.4
+     # arguments = (expr* args, identifier? vararg,
+     #              identifier? kwarg, expr* defaults)
++    #
++    # Python >= 3.4
++    # arguments = (arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults,
++    #              arg? kwarg, expr* defaults)
+     def visit_arguments(self, node):
+         first = True
+         no_default_count = len(node.args) - len(node.defaults)
+@@ -122,13 +127,21 @@ class ASTCodeGenerator(object):
+                 self._write(', ')
+             else:
+                 first = False
+-            self._write('*' + node.vararg)
++            self._write('*')
++            if isstring(node.vararg):
++                self._write(node.vararg)
++            else:
++                self.visit(node.vararg)
+         if getattr(node, 'kwarg', None):
+             if not first:
+                 self._write(', ')
+             else:
+                 first = False
+-            self._write('**' + node.kwarg)
++            self._write('**')
++            if isstring(node.kwarg):
++                self._write(node.kwarg)
++            else:
++                self.visit(node.kwarg)
+ 
+     if not IS_PYTHON2:
+         # In Python 3 arguments get a special node
+@@ -724,6 +737,17 @@ class ASTCodeGenerator(object):
+     def visit_Name(self, node):
+         self._write(node.id)
+ 
++    # NameConstant(singleton value)
++    def visit_NameConstant(self, node):
++        if node.value is None:
++            self._write('None')
++        elif node.value is True:
++            self._write('True')
++        elif node.value is False:
++            self._write('False')
++        else:
++            raise Exception("Unknown NameConstant %r" % (node.value,))
++
+     # List(expr* elts, expr_context ctx)
+     def visit_List(self, node):
+         self._write('[')
+@@ -829,6 +853,7 @@ class ASTTransformer(object):
+     visit_Attribute = _clone
+     visit_Subscript = _clone
+     visit_Name = _clone
++    visit_NameConstant = _clone
+     visit_List = _clone
+     visit_Tuple = _clone
+ 
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index 89aec49..de4bc86 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -24,7 +24,8 @@ from genshi.template.astutil import ASTTransformer, ASTCodeGenerator, \
+ from genshi.template.base import TemplateRuntimeError
+ from genshi.util import flatten
+ 
+-from genshi.compat import get_code_params, build_code_chunk, IS_PYTHON2
++from genshi.compat import get_code_params, build_code_chunk, isstring, \
++                          IS_PYTHON2
+ 
+ __all__ = ['Code', 'Expression', 'Suite', 'LenientLookup', 'StrictLookup',
+            'Undefined', 'UndefinedError']
+@@ -495,28 +496,31 @@ class TemplateASTTransformer(ASTTransformer):
+     def __init__(self):
+         self.locals = [CONSTANTS]
+ 
++    def _process(self, names, node):
++        if not IS_PYTHON2 and isinstance(node, _ast.arg):
++            names.add(node.arg)
++        elif isstring(node):
++            names.add(node)
++        elif isinstance(node, _ast.Name):
++            names.add(node.id)
++        elif isinstance(node, _ast.alias):
++            names.add(node.asname or node.name)
++        elif isinstance(node, _ast.Tuple):
++            for elt in node.elts:
++                self._process(names, elt)
++
+     def _extract_names(self, node):
+         names = set()
+-        def _process(node):
+-            if not IS_PYTHON2 and isinstance(node, _ast.arg):
+-                names.add(node.arg)
+-            if isinstance(node, _ast.Name):
+-                names.add(node.id)
+-            elif isinstance(node, _ast.alias):
+-                names.add(node.asname or node.name)
+-            elif isinstance(node, _ast.Tuple):
+-                for elt in node.elts:
+-                    _process(elt)
+         if hasattr(node, 'args'):
+             for arg in node.args:
+-                _process(arg)
++                self._process(names, arg)
+             if hasattr(node, 'vararg'):
+-                names.add(node.vararg)
++                self._process(names, node.vararg)
+             if hasattr(node, 'kwarg'):
+-                names.add(node.kwarg)
++                self._process(names, node.kwarg)
+         elif hasattr(node, 'names'):
+             for elt in node.names:
+-                _process(elt)
++                self._process(names, elt)
+         return names
+ 
+     def visit_Str(self, node):
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-buildable-on-python-2.7.patch b/gnu/packages/patches/python-genshi-buildable-on-python-2.7.patch
new file mode 100644
index 000000000..2bc516c69
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-buildable-on-python-2.7.patch
@@ -0,0 +1,25 @@
+From 32bfaa7cc1c736fd62fcbb6414de9498dc20ed07 Mon Sep 17 00:00:00 2001
+From: Adriano Peluso <catonano@gmail.com>
+Date: Wed, 5 Apr 2017 15:13:06 +0200
+Subject: [PATCH 2/2] buildable on python27 too
+
+---
+ genshi/template/directives.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/genshi/template/directives.py b/genshi/template/directives.py
+index 6fd0f28..1f70ef6 100644
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,7 +266,7 @@ class DefDirective(Directive):
+         if isinstance(ast, _ast.Call):
+             self.name = ast.func.id
+             for arg in ast.args:
+-                if isinstance(arg, _ast.Starred):
++                if hasattr(_ast, 'Starred') and isinstance(arg, _ast.Starred):
+                     # Python 3.5+
+                     self.star_args = arg.value.id
+                 else:
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-disable-speedups-on-python-3.3.patch b/gnu/packages/patches/python-genshi-disable-speedups-on-python-3.3.patch
new file mode 100644
index 000000000..c25c3bd7a
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-disable-speedups-on-python-3.3.patch
@@ -0,0 +1,32 @@
+From cef2c8df44166195e1705638f9f17033a4943bb7 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:32:21 +0000
+Subject: [PATCH 02/15] Disable the speedups C extension on CPython >= 3.3
+ since Genshi doesn't support the new Unicode C API yet.
+
+---
+ setup.py | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 123a2cb..a3d748c 100755
+--- a/setup.py
++++ b/setup.py
+@@ -65,9 +65,13 @@ available.""")
+ 
+ 
+ if Feature:
++    # Optional C extension module for speeding up Genshi:
++    # Not activated by default on:
++    # - PyPy (where it harms performance)
++    # - CPython >= 3.3 (the new Unicode C API is not supported yet)
+     speedups = Feature(
+         "optional C speed-enhancements",
+-        standard = not is_pypy,
++        standard = not is_pypy and sys.version_info < (3, 3),
+         ext_modules = [
+             Extension('genshi._speedups', ['genshi/_speedups.c']),
+         ],
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-fix-tests-on-python-3.5.patch b/gnu/packages/patches/python-genshi-fix-tests-on-python-3.5.patch
new file mode 100644
index 000000000..05be080cd
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-fix-tests-on-python-3.5.patch
@@ -0,0 +1,112 @@
+From ce796ad4bae5c47011876778674ad036357febdf Mon Sep 17 00:00:00 2001
+From: Adriano Peluso <catonano@gmail.com>
+Date: Wed, 5 Apr 2017 15:10:06 +0200
+Subject: [PATCH 1/2] fixing the tests on python35
+
+---
+ genshi/filters/i18n.py        |  6 ++++--
+ genshi/template/astutil.py    | 14 +++++++++++---
+ genshi/template/directives.py | 20 ++++++++++++++------
+ genshi/template/eval.py       |  5 +++++
+ 4 files changed, 34 insertions(+), 11 deletions(-)
+
+diff --git a/genshi/filters/i18n.py b/genshi/filters/i18n.py
+index 526fda4..5387fcf 100644
+--- a/genshi/filters/i18n.py
++++ b/genshi/filters/i18n.py
+@@ -1194,8 +1194,10 @@ def extract_from_code(code, gettext_functions):
+                 elif arg:
+                     strings.append(None)
+             [_add(arg) for arg in node.args]
+-            _add(node.starargs)
+-            _add(node.kwargs)
++            if hasattr(node, 'starargs'):
++                _add(node.starargs)
++            if hasattr(node, 'kwargs'):
++                _add(node.kwargs)
+             if len(strings) == 1:
+                 strings = strings[0]
+             else:
+diff --git a/genshi/template/astutil.py b/genshi/template/astutil.py
+index f4e1edd..e561846 100644
+--- a/genshi/template/astutil.py
++++ b/genshi/template/astutil.py
+@@ -151,6 +151,10 @@ class ASTCodeGenerator(object):
+         def visit_arg(self, node):
+             self._write(node.arg)
+ 
++    def visit_Starred(self, node):
++        self._write('*')
++        self.visit(node.value)
++
+     # FunctionDef(identifier name, arguments args,
+     #                           stmt* body, expr* decorator_list)
+     def visit_FunctionDef(self, node):
+@@ -664,9 +668,13 @@ class ASTCodeGenerator(object):
+             if not first:
+                 self._write(', ')
+             first = False
+-            # keyword = (identifier arg, expr value)
+-            self._write(keyword.arg)
+-            self._write('=')
++            if not keyword.arg:
++                # Python 3.5+ star-star args
++                self._write('**')
++            else:
++                # keyword = (identifier arg, expr value)
++                self._write(keyword.arg)
++                self._write('=')
+             self.visit(keyword.value)
+         if getattr(node, 'starargs', None):
+             if not first:
+diff --git a/genshi/template/directives.py b/genshi/template/directives.py
+index 7301c2d..6fd0f28 100644
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -266,13 +266,21 @@ class DefDirective(Directive):
+         if isinstance(ast, _ast.Call):
+             self.name = ast.func.id
+             for arg in ast.args:
+-                # only names
+-                self.args.append(arg.id)
++                if isinstance(arg, _ast.Starred):
++                    # Python 3.5+
++                    self.star_args = arg.value.id
++                else:
++                    # only names
++                    self.args.append(arg.id)
+             for kwd in ast.keywords:
+-                self.args.append(kwd.arg)
+-                exp = Expression(kwd.value, template.filepath,
+-                                 lineno, lookup=template.lookup)
+-                self.defaults[kwd.arg] = exp
++                if kwd.arg is None:
++                    # Python 3.5+
++                    self.dstar_args = kwd.value.id
++                else:
++                    self.args.append(kwd.arg)
++                    exp = Expression(kwd.value, template.filepath,
++                                     lineno, lookup=template.lookup)
++                    self.defaults[kwd.arg] = exp
+             if getattr(ast, 'starargs', None):
+                 self.star_args = ast.starargs.id
+             if getattr(ast, 'kwargs', None):
+diff --git a/genshi/template/eval.py b/genshi/template/eval.py
+index d378419..81644a7 100644
+--- a/genshi/template/eval.py
++++ b/genshi/template/eval.py
+@@ -600,6 +600,11 @@ class TemplateASTTransformer(ASTTransformer):
+         finally:
+             self.locals.pop()
+ 
++    # Only used in Python 3.5+
++    def visit_Starred(self, node):
++        node.value = self.visit(node.value)
++        return node
++
+     def visit_Name(self, node):
+         # If the name refers to a local inside a lambda, list comprehension, or
+         # generator expression, leave it alone
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-isstring-helper.patch b/gnu/packages/patches/python-genshi-isstring-helper.patch
new file mode 100644
index 000000000..4f6c19bba
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-isstring-helper.patch
@@ -0,0 +1,37 @@
+From cc5e07284f44cdd9beec178c69070a53f55d1323 Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:43:20 +0000
+Subject: [PATCH 03/15] Add isstring helper.
+
+---
+ genshi/compat.py | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/genshi/compat.py b/genshi/compat.py
+index 9787325..6574e39 100644
+--- a/genshi/compat.py
++++ b/genshi/compat.py
+@@ -35,6 +35,15 @@ else:
+                 'Python 2 compatibility function. Not usable in Python 3.')
+ 
+ 
++# We need to test if an object is an instance of a string type in places
++
++if IS_PYTHON2:
++    def isstring(obj):
++        return isinstance(obj, basestring)
++else:
++    def isstring(obj):
++        return isinstance(obj, str)
++
+ # We need to differentiate between StringIO and BytesIO in places
+ 
+ if IS_PYTHON2:
+@@ -112,4 +121,3 @@ except NameError:
+             if not x:
+                 return False
+         return True
+-
+-- 
+2.12.0
+
diff --git a/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags.patch b/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags.patch
new file mode 100644
index 000000000..29951a614
--- /dev/null
+++ b/gnu/packages/patches/python-genshi-stripping-of-unsafe-script-tags.patch
@@ -0,0 +1,51 @@
+From 0769be04c3891ae5c724c6779ba13d1d0f53b4ae Mon Sep 17 00:00:00 2001
+From: Simon Cross <hodgestar@gmail.com>
+Date: Sun, 16 Feb 2014 18:25:17 +0000
+Subject: [PATCH 01/15] Also allow stripping of unsafe script tags (Python 3.4
+ parses the second example as a tag whose name is script&xyz).
+
+---
+ genshi/filters/tests/test_html.py | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/genshi/filters/tests/test_html.py b/genshi/filters/tests/test_html.py
+index 0c6cfe1..45ec0da 100644
+--- a/genshi/filters/tests/test_html.py
++++ b/genshi/filters/tests/test_html.py
+@@ -368,12 +368,16 @@ def StyleSanitizer():
+ 
+ class HTMLSanitizerTestCase(unittest.TestCase):
+ 
+-    def assert_parse_error_or_equal(self, expected, exploit):
++    def assert_parse_error_or_equal(self, expected, exploit,
++                                    allow_strip=False):
+         try:
+             html = HTML(exploit)
+         except ParseError:
+             return
+-        self.assertEquals(expected, (html | HTMLSanitizer()).render())
++        sanitized_html = (html | HTMLSanitizer()).render()
++        if not sanitized_html and allow_strip:
++            return
++        self.assertEquals(expected, sanitized_html)
+ 
+     def test_sanitize_unchanged(self):
+         html = HTML(u'<a href="#">fo<br />o</a>')
+@@ -416,10 +420,12 @@ class HTMLSanitizerTestCase(unittest.TestCase):
+         html = HTML(u'<SCRIPT SRC="http://example.com/"></SCRIPT>')
+         self.assertEquals('', (html | HTMLSanitizer()).render())
+         src = u'<SCR\0IPT>alert("foo")</SCR\0IPT>'
+-        self.assert_parse_error_or_equal('&lt;SCR\x00IPT&gt;alert("foo")', src)
++        self.assert_parse_error_or_equal('&lt;SCR\x00IPT&gt;alert("foo")', src,
++                                         allow_strip=True)
+         src = u'<SCRIPT&XYZ SRC="http://example.com/"></SCRIPT>'
+         self.assert_parse_error_or_equal('&lt;SCRIPT&amp;XYZ; '
+-                                         'SRC="http://example.com/"&gt;', src)
++                                         'SRC="http://example.com/"&gt;', src,
++                                         allow_strip=True)
+ 
+     def test_sanitize_remove_onclick_attr(self):
+         html = HTML(u'<div onclick=\'alert("foo")\' />')
+-- 
+2.12.0
+
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 579886933..24d80ace5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14643,3 +14643,43 @@ transforms idiomatic python function calls to well-formed SQL queries.")
 
 (define-public python2-sql
   (package-with-python2 python-sql))
+
+(define-public python-genshi
+  (package
+    (name "python-genshi")
+    (version "0.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://ftp.edgewall.org/pub/genshi/Genshi-"
+             version ".tar.gz"))
+       (patches
+        (search-patches
+         ;; The first 4 patches are in the master branch upstream.
+         ;; See this as a reference https://genshi.edgewall.org/ticket/582
+         ;; The last 2 are NOT in any branch.
+         ;; They were sent as attachments to a ticket opened at
+         ;; https://genshi.edgewall.org/ticket/602#no1
+         "python-genshi-stripping-of-unsafe-script-tags.patch"
+         "python-genshi-disable-speedups-on-python-3.3.patch"
+         "python-genshi-isstring-helper.patch"
+         "python-genshi-add-support-for-python-3.4-AST.patch"
+         "python-genshi-fix-tests-on-python-3.5.patch"
+         "python-genshi-buildable-on-python-2.7.patch"))
+       (sha256
+        (base32
+         "0lkkbp6fbwzv0zda5iqc21rr7rdldkwh3hfabfjl9i4bwq14858x"))))
+    (build-system python-build-system)
+    (home-page "https://genshi.edgewall.org/")
+    (synopsis "Toolkit for generation of output for the web")
+    (description "Genshi is a Python library that provides an integrated set
+of components for parsing, generating, and processing HTML, XML or other
+textual content for output generation on the web.")
+    (license license:bsd-3)))
+
+;; The linter here claims that patch file names should start with the package
+;; name. But, in this case the patches are inherited from python-genshi with
+;; the "python-genshi-" prefix instead of "python2-genshi-".
+(define-public python2-genshi
+  (package-with-python2 python-genshi))
-- 
2.12.2

From 04c5ce688c3e09236a8bd522defdb43271d31b93 Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Sat, 20 May 2017 09:19:00 +0200
Subject: [PATCH 3/5] gnu: Add python-relatorio.

* gnu/packages/python.scm (python-relatorio, python2-relatorio): New variables.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
---
 gnu/packages/python.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 24d80ace5..77bbc16f5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -14683,3 +14683,28 @@ textual content for output generation on the web.")
 ;; the "python-genshi-" prefix instead of "python2-genshi-".
 (define-public python2-genshi
   (package-with-python2 python-genshi))
+
+(define-public python-relatorio
+  (package
+    (name "python-relatorio")
+    (version "0.6.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "relatorio" version))
+       (sha256
+        (base32
+         "0lincq79mzgazwd9gh41dybjh9c3n87r83pl8nk3j79aihyfk84z"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-lxml" ,python-lxml)
+       ("python-genshi" ,python-genshi)))
+    (home-page "https://relatorio.tryton.org/")
+    (synopsis "Templating library able to output ODT and PDF files")
+    (description "Relatorio is a templating library which provides a way to
+easily output ODT, ODS, PNG, SVG and several other kinds of files.  Support
+for more filetypes can be easily added by creating plugins for them.")
+    (license license:gpl3+)))
+
+(define-public python2-relatorio
+  (package-with-python2 python-relatorio))
-- 
2.12.2

From 875d0451827a38208484f899e6594c1254389431 Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Sat, 20 May 2017 08:21:31 +0200
Subject: [PATCH 4/5] gnu: Add trytond.

* gnu/packages/tryton.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/tryton.scm (trytond): New variable.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
---
 gnu/local.mk            |  1 +
 gnu/packages/tryton.scm | 67 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)
 create mode 100644 gnu/packages/tryton.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index f5b32bd88..5bde11f1f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -321,6 +321,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/protobuf.scm			\
   %D%/packages/pv.scm				\
   %D%/packages/python.scm			\
+  %D%/packages/tryton.scm			\
   %D%/packages/qemu.scm				\
   %D%/packages/qt.scm				\
   %D%/packages/ragel.scm			\
diff --git a/gnu/packages/tryton.scm b/gnu/packages/tryton.scm
new file mode 100644
index 000000000..590bd5438
--- /dev/null
+++ b/gnu/packages/tryton.scm
@@ -0,0 +1,67 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 Adriano Peluso <catonano@gmail.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 tryton)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (gnu packages)
+  #:use-module (gnu packages python)
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system python))
+
+(define-public trytond
+  (package
+    (name "trytond")
+    (version "4.4.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://downloads.tryton.org/4.4/trytond-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "15gm34qwj5fpnkqvrxzndl8653zbczhsa76dm1gi4cqj1r29bbpr"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python-dateutil" ,python-dateutil)
+       ("python-genshi" ,python-genshi)
+       ("python-polib" ,python-polib)
+       ;; there's no python-mysql in Guix right now
+       ;; so python-psycopg2 (postgresql) only for now
+       ("python-psycopg2" ,python-psycopg2)
+       ("python-relatorio" ,python-relatorio)
+       ("python-lxml" ,python-lxml)
+       ("python-sql" ,python-sql)
+       ("python-werkzeug" ,python-werkzeug)
+       ("python-wrapt" ,python-wrapt)))
+    (native-inputs
+     `(("python-mock" ,python-mock)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'check 'preparations
+           (lambda _
+             (setenv "DB_NAME" ":memory:"))))))
+    (home-page "https://www.tryton.org/")
+    (synopsis "Server component of Tryton")
+    (description "Tryton is a three-tier high-level general purpose
+application platform using PostgreSQL as its main database engine.  It is the
+core base of a complete business solution providing modularity, scalability
+and security.")
+    (license license:gpl3+)))
-- 
2.12.2

From bedbd2f4b8f378d6e010d1fc2fb0c43b6f44dbd7 Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano@gmail.com>
Date: Sat, 20 May 2017 08:32:08 +0200
Subject: [PATCH 5/5] gnu: Add tryton.

* gnu/packages/tryton.scm (tryton): New variable.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
---
 gnu/packages/tryton.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/tryton.scm b/gnu/packages/tryton.scm
index 590bd5438..c9e9e50f8 100644
--- a/gnu/packages/tryton.scm
+++ b/gnu/packages/tryton.scm
@@ -19,6 +19,7 @@
 (define-module (gnu packages tryton)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages python)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -65,3 +66,28 @@ application platform using PostgreSQL as its main database engine.  It is the
 core base of a complete business solution providing modularity, scalability
 and security.")
     (license license:gpl3+)))
+
+(define-public tryton
+  (package
+    (name "tryton")
+    (version "4.4.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://downloads.tryton.org/4.4/tryton-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "1lklcz5fs6rkrd7z2m2f5gz4fdwzkgnhg2hyvzp20kdsvi33bq2j"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python2-chardet" ,python2-chardet)
+       ("python2-dateutil" ,python2-dateutil)
+       ("python2-pygtk" ,python2-pygtk)))
+    (arguments
+     `(#:python ,python-2))
+    (home-page "https://www.tryton.org/")
+    (synopsis "Client component of Tryton")
+    (description "This package is the client component of Tryton.")
+    (license license:gpl3+)))
-- 
2.12.2


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


I removed python2-trytond. When we want to package trytond 3.8 (for GNU
Health), we will simply create a variable `trytond-3.8' which inherits
from `trytond' and adds an argument to build against python2.

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

* bug#26401: [PATCH] python-tryton (with no modules)
  2017-05-20  7:39               ` Catonano
  2017-05-22 21:13                 ` Arun Isaac
@ 2017-05-27 14:21                 ` Arun Isaac
       [not found]                 ` <57fa2a94.AEMAKvi84IwAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZKYuO@mailjet.com>
  2 siblings, 0 replies; 16+ messages in thread
From: Arun Isaac @ 2017-05-27 14:21 UTC (permalink / raw)
  To: Catonano; +Cc: 26401-done


Pushed the final patchset with a few more minor corrections...! Thanks!

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

* bug#26401: [PATCH] python-tryton (with no modules)
       [not found]                 ` <57fa2a94.AEMAKvi84IwAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZKYuO@mailjet.com>
@ 2017-05-27 14:38                   ` Catonano
  0 siblings, 0 replies; 16+ messages in thread
From: Catonano @ 2017-05-27 14:38 UTC (permalink / raw)
  To: Arun Isaac; +Cc: 26401-done

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

2017-05-27 16:21 GMT+02:00 Arun Isaac <arunisaac@systemreboot.net>:

>
> Pushed the final patchset with a few more minor corrections...! Thanks!
>

thank you Arun, sorry or the delay in my answer, I was caught up in some
pressing activities !

Thanks !

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

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

end of thread, other threads:[~2017-05-27 14:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-08 12:17 bug#26401: [PATCH] python-tryton (with no modules) Catonano
2017-05-08 14:33 ` Arun Isaac
2017-05-15  6:39   ` Catonano
2017-05-15 13:19     ` Arun Isaac
2017-05-15 19:17   ` Catonano
2017-05-16 17:12     ` Arun Isaac
     [not found]     ` <c3fa946d.AEMAKXA0lrIAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZGzM6@mailjet.com>
2017-05-16 18:36       ` Catonano
2017-05-16 18:41       ` Catonano
2017-05-17  5:54         ` Arun Isaac
     [not found]         ` <4d3632b9.AEEAKq6kKpkAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZG-Wd@mailjet.com>
2017-05-17  7:45           ` Catonano
2017-05-18 17:49             ` Arun Isaac
     [not found]             ` <7e6e3d0c.ADsAALmm2EQAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZHd6n@mailjet.com>
2017-05-18 18:03               ` Catonano
2017-05-20  7:39               ` Catonano
2017-05-22 21:13                 ` Arun Isaac
2017-05-27 14:21                 ` Arun Isaac
     [not found]                 ` <57fa2a94.AEMAKvi84IwAAAAAAAAAAAOu6r8AAAACwQwAAAAAAAW9WABZKYuO@mailjet.com>
2017-05-27 14:38                   ` Catonano

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