increasing the python requirement

Toshio Kuratomi a.badger at gmail.com
Thu Jan 6 18:55:08 UTC 2011


On Thu, Jan 06, 2011 at 10:57:27AM +0100, Vincent Ladeuil wrote:
> >>>>> John Barstow <jbowtie at amathaine.com> writes:
> 
> <snip/>
> 
>     > The recommended transition strategy is, roughly:
> 
>     > # Port your code to Python 2.6.
>     > # Make sure all the tests pass using that version.
>     > # Run your code under Python 2.6 with the -3 flag.
>     > # Fix any warnings.
>     > # Run the tests again (still under Python 2.6).
>     > # Run the 2to3 tool.
>     > # Run your tests under Python 3.
>     > # Fix any problems.
>     > # Repeat until all tests pass.
> 
>     > The main point for maintenance is to only write Python 2.6 code and
>     > use 2to3 to generate a 3.x version as part of the build process. You
>     > don't really need to create a 3.x fork until such time as you decide
>     > to abandon Python 2.x entirely.
> 
> That was my understanding (well, mostly based on a gut feeling rather
> than really informed).
> 
> Martin and Andrew have good arguments about the apparent low cost of
> maintaining compatibility with 2.4/2.5, so I think we should just try
> the -3 flag and 2to3 and see.
> 
I think this is the first thing to try since my experience packaging python3
modules from upstream is that most projects have python-2.4 compatible code.
Then they use distribute (the setuptools fork) to run 2to3 from the setup.py
if python3 is being used.  Now, I think bzr may be harder since it actually
does need to work with real bytes a lot but I'm not sure that dropping
python-2.4 compatibility makes that easier to manage.  It's just something
someone's going to need to try to port.

> This means keeping trunk in 2.x and experiment with a fork based on the
> 2to3 results.
> 
> If we decide to target 3 more aggressively later, we can still change
> our mind and switch to maintaining trunk in 3 and a fork based on the
> 3to2 results.
> 
Note that although conceptually this is better, the 3to2 author thinks that
3to2 can never do as good of a job as 2to3 because python3's features are
a superset of python2's.  So, he thinks that you'll always end up doing more
manual work if you go this route.

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20110106/e9d0dac2/attachment.pgp>


More information about the bazaar mailing list