It is possible to redistribute setuptools to use the ports packages implemented in python 2 to 3
Found some information on porting packages from python 2 through 3 using the setuptools distribution in the link below.
http://packages.python.org/distribute/python3.html
I have a C api that can be built with python 2.x, but I need to build it in python 3.x. This can be done using a distribution.
Anyone have an idea on this?
a source to share
No, it cannot be done with Distribute. Distribute just calls the 2to3
script in the build phase, but 2to3
can only convert between Python 2.x source files and Python 3.x source files. For the C API, you need to do it the hard way by manually configuring your code to compile with both Python APIs.
A very incomplete list of C API changes between Python 2.x and Python 3.x can be found here . The same document also describes the main differences between Python 2.x and 3.x at the Python source level.
a source to share
distriubte uses the Python 2to3 tool to automatically (try) convert Python 2 code to Python 3. However, this only works for code written in Python. The C code needs to be ported manually.
The good news is that the Python C API hasn't changed much between Python 2.6 and 3.1. The main difference is that Python 3 now uses Unicode for all strings and has a separate type bytes
for handling raw binary data.
a source to share