GNU bug report logs - #26401
[PATCH] python-tryton (with no modules)

Previous Next

Package: guix-patches;

Reported by: Catonano <catonano <at> gmail.com>

Date: Sat, 8 Apr 2017 12:18:01 UTC

Severity: normal

Tags: moreinfo, patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26401 in the body.
You can then email your comments to 26401 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Sat, 08 Apr 2017 12:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Catonano <catonano <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 08 Apr 2017 12:18:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] python-tryton (with no modules)
Date: Sat, 8 Apr 2017 14:17:15 +0200
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]
[series.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Mon, 08 May 2017 14:35:02 GMT) Full text and rfc822 format available.

Message #8 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Mon, 08 May 2017 20:03:59 +0530
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 <at> 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 <at> 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'.




Added tag(s) moreinfo. Request was from Ricardo Wurmus <ricardo.wurmus <at> mdc-berlin.de> to control <at> debbugs.gnu.org. (Wed, 10 May 2017 06:10:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Mon, 15 May 2017 06:40:01 GMT) Full text and rfc822 format available.

Message #13 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Mon, 15 May 2017 08:39:04 +0200
[Message part 1 (text/plain, inline)]
2017-05-08 16:33 GMT+02:00 Arun Isaac <arunisaac <at> 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 !
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Mon, 15 May 2017 13:21:02 GMT) Full text and rfc822 format available.

Message #16 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Catonano <catonano <at> gmail.com>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Mon, 15 May 2017 18:49:20 +0530
> 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!




Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Mon, 15 May 2017 19:19:02 GMT) Full text and rfc822 format available.

Message #19 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Mon, 15 May 2017 21:17:46 +0200
[Message part 1 (text/plain, inline)]
2017-05-08 16:33 GMT+02:00 Arun Isaac <arunisaac <at> 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 <at> 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 <at> 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 😎
[Message part 2 (text/html, inline)]
[series.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Tue, 16 May 2017 17:14:02 GMT) Full text and rfc822 format available.

Message #22 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Catonano <catonano <at> gmail.com>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Tue, 16 May 2017 22:42:59 +0530
>> 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 <at> 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).




Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Tue, 16 May 2017 18:37:01 GMT) Full text and rfc822 format available.

Message #25 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Tue, 16 May 2017 20:36:22 +0200
[Message part 1 (text/plain, inline)]
2017-05-16 19:12 GMT+02:00 Arun Isaac <arunisaac <at> 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
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Tue, 16 May 2017 18:42:02 GMT) Full text and rfc822 format available.

Message #28 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Tue, 16 May 2017 20:41:26 +0200
[Message part 1 (text/plain, inline)]
2017-05-16 19:12 GMT+02:00 Arun Isaac <arunisaac <at> 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
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Wed, 17 May 2017 05:55:02 GMT) Full text and rfc822 format available.

Message #31 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Catonano <catonano <at> gmail.com>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Wed, 17 May 2017 11:24:05 +0530
>> 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?




Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Wed, 17 May 2017 07:46:01 GMT) Full text and rfc822 format available.

Message #34 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Wed, 17 May 2017 09:45:44 +0200
[Message part 1 (text/plain, inline)]
2017-05-17 7:54 GMT+02:00 Arun Isaac <arunisaac <at> 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
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Thu, 18 May 2017 17:50:02 GMT) Full text and rfc822 format available.

Message #37 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Catonano <catonano <at> gmail.com>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Thu, 18 May 2017 23:19:03 +0530
> 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.




Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Thu, 18 May 2017 18:04:01 GMT) Full text and rfc822 format available.

Message #40 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Thu, 18 May 2017 20:03:04 +0200
[Message part 1 (text/plain, inline)]
2017-05-18 19:49 GMT+02:00 Arun Isaac <arunisaac <at> 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 !
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Sat, 20 May 2017 07:40:02 GMT) Full text and rfc822 format available.

Message #43 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Sat, 20 May 2017 09:39:10 +0200
[Message part 1 (text/plain, inline)]
So, here I am

2017-05-18 19:49 GMT+02:00 Arun Isaac <arunisaac <at> 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
[Message part 2 (text/html, inline)]
[series.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Mon, 22 May 2017 21:15:02 GMT) Full text and rfc822 format available.

Message #46 received at 26401 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Catonano <catonano <at> gmail.com>
Cc: 26401 <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Tue, 23 May 2017 02:43:16 +0530
[Message part 1 (text/plain, inline)]
> 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.

[series.patch (text/x-patch, inline)]
From 53feec2122c419a424471148e0c8c68407a54f7b Mon Sep 17 00:00:00 2001
From: Adriano Peluso <catonano <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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 <at> 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

[Message part 3 (text/plain, inline)]
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.

Reply sent to Arun Isaac <arunisaac <at> systemreboot.net>:
You have taken responsibility. (Sat, 27 May 2017 14:23:02 GMT) Full text and rfc822 format available.

Notification sent to Catonano <catonano <at> gmail.com>:
bug acknowledged by developer. (Sat, 27 May 2017 14:23:02 GMT) Full text and rfc822 format available.

Message #51 received at 26401-done <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Catonano <catonano <at> gmail.com>
Cc: 26401-done <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Sat, 27 May 2017 19:51:59 +0530
Pushed the final patchset with a few more minor corrections...! Thanks!




Information forwarded to guix-patches <at> gnu.org:
bug#26401; Package guix-patches. (Sat, 27 May 2017 14:39:02 GMT) Full text and rfc822 format available.

Message #54 received at 26401-done <at> debbugs.gnu.org (full text, mbox):

From: Catonano <catonano <at> gmail.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 26401-done <at> debbugs.gnu.org
Subject: Re: bug#26401: [PATCH] python-tryton (with no modules)
Date: Sat, 27 May 2017 16:38:27 +0200
[Message part 1 (text/plain, inline)]
2017-05-27 16:21 GMT+02:00 Arun Isaac <arunisaac <at> 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 !
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 Jun 2017 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.