Prototype InterMine Python 3 support

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Prototype InterMine Python 3 support

Justin Clark-Casey-2
Hi devs.  I have just posted a package that adds Python 3 support to the Python webservices module [1].  If you're interested in Python then testing is very
much appreciated.  If nothing comes up I plan to have it go live next week.

A further wrinkle with Python 3 support is the code generated by InterMine itself, which is currently only Python 2 compatible.  The most obvious problem is the
lack of parenthesis around print statements, which I'm thinking of fixing by sticking

from __future__ import print_function

at the top of the generated code so Python 2 can handle them.  However, there might be other issues as well when I investigate further (maybe unicode, for
example).  Any thoughts?

[1] https://testpypi.python.org/pypi?:action=display&name=intermine&version=1.09.08

--
Justin Clark-Casey, Synbiomine/InterMine Developer
http://synbiomine.org
http://twitter.com/justincc
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Prototype InterMine Python 3 support

Paulo Nuin
Hi Justin

Is this code on the repository?

Thanks

Paulo


> On May 11, 2017, at 6:33 AM, Justin Clark-Casey <[hidden email]> wrote:
>
> Hi devs.  I have just posted a package that adds Python 3 support to the Python webservices module [1].  If you're interested in Python then testing is very much appreciated.  If nothing comes up I plan to have it go live next week.
>
> A further wrinkle with Python 3 support is the code generated by InterMine itself, which is currently only Python 2 compatible.  The most obvious problem is the lack of parenthesis around print statements, which I'm thinking of fixing by sticking
>
> from __future__ import print_function
>
> at the top of the generated code so Python 2 can handle them.  However, there might be other issues as well when I investigate further (maybe unicode, for example).  Any thoughts?
>
> [1] https://testpypi.python.org/pypi?:action=display&name=intermine&version=1.09.08
>
> --
> Justin Clark-Casey, Synbiomine/InterMine Developer
> http://synbiomine.org
> http://twitter.com/justincc
> _______________________________________________
> dev mailing list
> [hidden email]
> https://lists.intermine.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Prototype InterMine Python 3 support

Justin Clark-Casey-2
Hi Paulo.  Not yet, sorry got delayed a bit.  I plan to do the production update next Monday (5th June 2017) so I can quickly fix any issues rather than having
to keep an eye out over the weekend with slower response times.  I will let this list know when the update is done.

The next step will be to update InterMine to produce Python 3 and 2 compliant code, as outlined below.  I considered leaving it as Python 2 but I don't think
this is a good long term solution.  I also considered separate python 2 and python 3 generation buttons but that's getting messy and not really necessary.

I think the cons of the compatibility approach below are slightly more wordy code (which I don't think is an issue) and some very old versions of Python 2 that
don't have __future__ imports no longer being usable.  But these versions will be extremely old (I believe it has been there since 2.6 in 2008, almost 10 years
ago).

On 01/06/17 20:32, Paulo Nuin wrote:

> Hi Justin
>
> Is this code on the repository?
>
> Thanks
>
> Paulo
>
>
>> On May 11, 2017, at 6:33 AM, Justin Clark-Casey <[hidden email]> wrote:
>>
>> Hi devs.  I have just posted a package that adds Python 3 support to the Python webservices module [1].  If you're interested in Python then testing is very much appreciated.  If nothing comes up I plan to have it go live next week.
>>
>> A further wrinkle with Python 3 support is the code generated by InterMine itself, which is currently only Python 2 compatible.  The most obvious problem is the lack of parenthesis around print statements, which I'm thinking of fixing by sticking
>>
>> from __future__ import print_function
>>
>> at the top of the generated code so Python 2 can handle them.  However, there might be other issues as well when I investigate further (maybe unicode, for example).  Any thoughts?
>>
>> [1] https://testpypi.python.org/pypi?:action=display&name=intermine&version=1.09.08
>>
>> --
>> Justin Clark-Casey, Synbiomine/InterMine Developer
>> http://synbiomine.org
>> http://twitter.com/justincc
>> _______________________________________________
>> dev mailing list
>> [hidden email]
>> https://lists.intermine.org/mailman/listinfo/dev
>
_______________________________________________
dev mailing list
[hidden email]
https://lists.intermine.org/mailman/listinfo/dev
Loading...