Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #10014

Re: Packaging with 2to3

Path csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Thomas Goirand <zigo@debian.org>
Newsgroups linux.debian.maint.python
Subject Re: Packaging with 2to3
Date Mon, 18 Dec 2017 23:20:01 +0100
Message-ID <uYbVn-6iv-3@gated-at.bofh.it> (permalink)
References <uYbsl-5Sc-5@gated-at.bofh.it>
X-Mailbox-Line From debian-python-request@lists.debian.org Mon Dec 18 22:10:52 2017
Old-Return-Path <zigo@debian.org>
X-Amavis-Spam-Status No, score=-6.98 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, MURPHY_DRUGS_REL8=0.02, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
X-Policyd-Weight using cached result; rate:hard: -5
Organization Debian
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Language en-US
Content-Transfer-Encoding 7bit
X-Mailing-List <debian-python@lists.debian.org> archive/latest/15409
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/f5aecde6-2429-546a-4b96-83c608b6d710@debian.org
Approved robomod@news.nic.it
Lines 28
Sender robomod@news.nic.it
X-Original-Date Mon, 18 Dec 2017 23:10:27 +0100
X-Original-Message-ID <f5aecde6-2429-546a-4b96-83c608b6d710@debian.org>
X-Original-References <87wp1jenho.fsf@debian.org>
Xref csiph.com linux.debian.maint.python:10014

Show key headers only | View raw


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)

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Packaging with 2to3 Ole Streicher <olebole@debian.org> - 2017-12-18 22:50 +0100
  Re: Packaging with 2to3 Thomas Goirand <zigo@debian.org> - 2017-12-18 23:20 +0100
  Re: Packaging with 2to3 Michael Hudson-Doyle <michael.hudson@canonical.com> - 2017-12-19 01:50 +0100
    Re: Packaging with 2to3 Piotr Ożarowski <piotr@debian.org> - 2017-12-19 13:40 +0100

csiph-web