zhengzheng / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Avoid to use 2to3 to support Python 3 #274

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
At the time I ported psutil to python 3 (issue 73) the recommended porting 
strategy was to use 2to3.
As such, 2to3 is currently run for all the py files at installation time:
http://code.google.com/p/psutil/source/browse/tags/release-0.4.1/setup.py#19

Now that 2 years has passed I realize this is a poor strategy for different 
reasons:

- installation on python 3 is slower than on python 2 because of 2to3 run; not 
too much but...

- if psutil is first installed with python 2 and then python 3, the second 
installation fails if "build" directory is not removed first

- with python 3 it is not possible to use "python setup.py develop" because 
2to3 is not run

With pyftpdlib I learned that maintaining a single code base which runs with 
both python 2 and 3 is possible without too much effort and saves the trouble 
of using 2to3:
http://code.google.com/p/pyftpdlib/issues/detail?id=198#c15
The same thing should be made for psutil.

Original issue reported on code.google.com by g.rodola on 2 Jun 2012 at 8:16

GoogleCodeExporter commented 9 years ago
Fixed in r1335.

Original comment by g.rodola on 3 Jun 2012 at 6:22

GoogleCodeExporter commented 9 years ago
0.5.0 is finally out. Closing out as fixed.

Original comment by g.rodola on 27 Jun 2012 at 6:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Updated csets after the SVN -> Mercurial migration:
r1335 == revision ???

Original comment by g.rodola on 2 Mar 2013 at 12:08