2009-10-10 19:14:13 +03:00
|
|
|
=================
|
|
|
|
PYTHON 3 SUPPORT
|
|
|
|
=================
|
|
|
|
|
|
|
|
Current Python 3k support in SQLAlchemy is provided by a customized
|
|
|
|
2to3 script which wraps Python's 2to3 tool.
|
|
|
|
|
2010-02-13 03:42:52 +02:00
|
|
|
Installing Distribute
|
|
|
|
---------------------
|
2009-10-10 19:14:13 +03:00
|
|
|
|
2010-02-13 03:42:52 +02:00
|
|
|
Distribute should be installed with the Python3 installation. The
|
|
|
|
distribute bootloader is included.
|
2009-10-10 19:14:13 +03:00
|
|
|
|
2010-02-13 03:42:52 +02:00
|
|
|
Running as a user with permission to modify the Python distribution,
|
|
|
|
install Distribute:
|
2009-10-10 19:14:13 +03:00
|
|
|
|
2010-02-13 03:42:52 +02:00
|
|
|
python3 distribute_setup.py
|
2011-01-02 21:23:42 +02:00
|
|
|
|
2009-10-10 19:14:13 +03:00
|
|
|
|
2010-02-13 03:42:52 +02:00
|
|
|
Installing SQLAlchemy in Python 3
|
|
|
|
---------------------------------
|
2010-01-07 20:47:39 +02:00
|
|
|
|
2011-01-02 21:23:42 +02:00
|
|
|
Once Distribute is installed, SQLAlchemy can be installed directly.
|
2010-02-13 03:42:52 +02:00
|
|
|
The 2to3 process will kick in which takes several minutes:
|
2010-01-07 20:47:39 +02:00
|
|
|
|
2010-02-13 03:42:52 +02:00
|
|
|
python3 setup.py install
|
|
|
|
|
|
|
|
Converting Tests, Examples, Source to Python 3
|
|
|
|
----------------------------------------------
|
|
|
|
|
|
|
|
To convert all files in the source distribution, run
|
|
|
|
SQLAlchemys "sa2to3.py" script, which monkeypatches a preprocessor
|
|
|
|
onto the 2to3 tool:
|
|
|
|
|
2010-02-25 07:23:14 +02:00
|
|
|
python3 sa2to3.py --no-diffs -w lib test examples
|
2010-02-13 03:42:52 +02:00
|
|
|
|
|
|
|
The above will rewrite all files in-place in Python 3 format.
|
2009-10-10 19:14:13 +03:00
|
|
|
|
|
|
|
Running Tests
|
|
|
|
-------------
|
|
|
|
|
2010-11-16 02:25:34 +02:00
|
|
|
To run unit tests in Py3k, Nose 1.0 is required, or a development
|
|
|
|
version of Nose that supports Python 3. The tests are run
|
|
|
|
using ./sqla_nose.py as described in README.unittests.
|
2010-02-13 03:42:52 +02:00
|
|
|
|
|
|
|
Current 3k Issues
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
Current bugs and tickets related to Py3k are on the Py3k milestone in trac:
|
|
|
|
|
|
|
|
http://www.sqlalchemy.org/trac/query?status=new&status=assigned&status=reopened&milestone=py3k
|
2009-10-10 19:14:13 +03:00
|
|
|
|