Re: Packaging with 2to3

2017-12-18 Thread Michael Hudson-Doyle
On 19 December 2017 at 10:26, Ole Streicher  wrote:

> Hi,
>
> I want to create a package (pyraf, #711038) for both Python2 and
> Python3. While the package itself is still not Python 3 compatible,
> upstream says that running through 2to3 will make it; however the
> resulting code is not Python 2 compatible anymore.
>
> Is there a way to instruct pybuild to run the Python 3 code through
> 2to3?


python-urwid does this, by passing use_2to3 to the distutils setup()
function, I guess you could patch it to do the same.

Cheers,
mwh


Re: Packaging with 2to3

2017-12-18 Thread Thomas Goirand
On 12/18/2017 10:26 PM, Ole Streicher wrote:
> Hi,
> 
> I want to create a package (pyraf, #711038) for both Python2 and
> Python3. While the package itself is still not Python 3 compatible,
> upstream says that running through 2to3 will make it; however the
> resulting code is not Python 2 compatible anymore.
> 
> Is there a way to instruct pybuild to run the Python 3 code through
> 2to3?
> 
> Best regards
> 
> Ole

Instead, I'd advise to use sixer (available in Debian
Stretch/Buster/Sid) to produce a patch that you can submit upstream, or
embed in your package. Sixer will patch the code in a way so that it
works with both Python 2 and 3.

Note that it wont do *all* for you, like you'll have to convert print
statements into function calls manually, but it does a big chunk, which
is quite helpful.

I hope that helps,
Cheers,

Thomas Goirand (zigo)



Packaging with 2to3

2017-12-18 Thread Ole Streicher
Hi,

I want to create a package (pyraf, #711038) for both Python2 and
Python3. While the package itself is still not Python 3 compatible,
upstream says that running through 2to3 will make it; however the
resulting code is not Python 2 compatible anymore.

Is there a way to instruct pybuild to run the Python 3 code through
2to3?

Best regards

Ole