mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Add build_py_2to3.
This commit is contained in:
parent
3faa84f18e
commit
73a22f0500
3 changed files with 47 additions and 1 deletions
|
@ -1820,7 +1820,25 @@ This module supplies the abstract base class :class:`Command`.
|
|||
:synopsis: Build the .py/.pyc files of a package
|
||||
|
||||
|
||||
.. % todo
|
||||
.. class:: build_py(Command)
|
||||
|
||||
.. class:: build_py_2to3(build_py)
|
||||
|
||||
Alternative implementation of build_py which also runs the
|
||||
2to3 conversion library on each .py file that is going to be
|
||||
installed. To use this in a setup.py file for a distribution
|
||||
that is designed to run with both Python 2.x and 3.x, add::
|
||||
|
||||
try:
|
||||
from distutils.command.build_py import build_py_2to3 as build_py
|
||||
except ImportError:
|
||||
from distutils.command.build_py import build_py
|
||||
|
||||
to your setup.py, and later::
|
||||
|
||||
cmdclass = {'build_py':build_py}
|
||||
|
||||
to the invocation of setup().
|
||||
|
||||
|
||||
:mod:`distutils.command.build_scripts` --- Build the scripts of a package
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue