diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/deprecated/python3.rst | 94 | ||||
| -rw-r--r-- | docs/references/keywords.rst | 15 | ||||
| -rw-r--r-- | docs/userguide/declarative_config.rst | 4 | ||||
| -rw-r--r-- | docs/userguide/development_mode.rst | 8 | ||||
| -rw-r--r-- | docs/userguide/keywords.rst | 12 |
5 files changed, 0 insertions, 133 deletions
diff --git a/docs/deprecated/python3.rst b/docs/deprecated/python3.rst deleted file mode 100644 index 6b55fe78..00000000 --- a/docs/deprecated/python3.rst +++ /dev/null @@ -1,94 +0,0 @@ -===================================================== -Supporting both Python 2 and Python 3 with Setuptools -===================================================== - -Starting with Distribute version 0.6.2 and Setuptools 0.7, the Setuptools -project supported Python 3. Installing and -using setuptools for Python 3 code works exactly the same as for Python 2 -code. - -Setuptools provides a facility to invoke 2to3 on the code as a part of the -build process, by setting the keyword parameter ``use_2to3`` to True, but -the Setuptools project strongly recommends instead developing a unified codebase -using `six <https://pypi.org/project/six/>`_, -`future <https://pypi.org/project/future/>`_, or another compatibility -library. - - -Using 2to3 -========== - -Setuptools attempts to make the porting process easier by automatically -running -2to3 as a part of running tests. To do so, you need to configure the -setup.py so that you can run the unit tests with ``python setup.py test``. - -See :ref:`test` for more information on this. - -Once you have the tests running under Python 2, you can add the use_2to3 -keyword parameters to setup(), and start running the tests under Python 3. -The test command will now first run the build command during which the code -will be converted with 2to3, and the tests will then be run from the build -directory, as opposed from the source directory as is normally done. - -Setuptools will convert all Python files, and also all doctests in Python -files. However, if you have doctests located in separate text files, these -will not automatically be converted. By adding them to the -``convert_2to3_doctests`` keyword parameter Setuptools will convert them as -well. - -By default, the conversion uses all fixers in the ``lib2to3.fixers`` package. -To use additional fixers, the parameter ``use_2to3_fixers`` can be set -to a list of names of packages containing fixers. To exclude fixers, the -parameter ``use_2to3_exclude_fixers`` can be set to fixer names to be -skipped. - -An example setup.py might look something like this:: - - from setuptools import setup - - setup( - name='your.module', - version='1.0', - description='This is your awesome module', - author='You', - author_email='your@email', - package_dir={'': 'src'}, - packages=['your', 'you.module'], - test_suite='your.module.tests', - use_2to3=True, - convert_2to3_doctests=['src/your/module/README.txt'], - use_2to3_fixers=['your.fixers'], - use_2to3_exclude_fixers=['lib2to3.fixes.fix_import'], - ) - -Differential conversion ------------------------ - -Note that a file will only be copied and converted during the build process -if the source file has been changed. If you add a file to the doctests -that should be converted, it will not be converted the next time you run -the tests, since it hasn't been modified. You need to remove it from the -build directory. Also if you run the build, install or test commands before -adding the use_2to3 parameter, you will have to remove the build directory -before you run the test command, as the files otherwise will seem updated, -and no conversion will happen. - -In general, if code doesn't seem to be converted, deleting the build directory -and trying again is a good safeguard against the build directory getting -"out of sync" with the source directory. - -Distributing Python 3 modules -============================= - -You can distribute your modules with Python 3 support in different ways. A -normal source distribution will work, but can be slow in installing, as the -2to3 process will be run during the install. But you can also distribute -the module in binary format, such as a binary egg. That egg will contain the -already converted code, and hence no 2to3 conversion is needed during install. - -Advanced features -================= - -If you don't want to run the 2to3 conversion on the doctests in Python files, -you can turn that off by setting ``setuptools.use_2to3_on_doctests = False``. diff --git a/docs/references/keywords.rst b/docs/references/keywords.rst index 619b2d14..c26b9d49 100644 --- a/docs/references/keywords.rst +++ b/docs/references/keywords.rst @@ -330,21 +330,6 @@ Keywords mess with it. For more details on how this argument works, see the section below on :ref:`Automatic Resource Extraction`. -``use_2to3`` - Convert the source code from Python 2 to Python 3 with 2to3 during the - build process. See :doc:`../deprecated/python3` for more details. - -``convert_2to3_doctests`` - List of doctest source files that need to be converted with 2to3. - See :doc:`../deprecated/python3` for more details. - -``use_2to3_fixers`` - A list of modules to search for additional fixers to be used during - the 2to3 conversion. See :doc:`../deprecated/python3` for more details. - -``use_2to3_exclude_fixers`` - List of fixer names to be skipped. - ``project_urls`` An arbitrary map of URL names to hyperlinks, allowing more extensible documentation of where various resources can be found than the simple diff --git a/docs/userguide/declarative_config.rst b/docs/userguide/declarative_config.rst index 3b72611c..c50fcf6d 100644 --- a/docs/userguide/declarative_config.rst +++ b/docs/userguide/declarative_config.rst @@ -211,10 +211,6 @@ install_requires list-semi extras_require section [#opt-2]_ python_requires str entry_points file:, section 51.0.0 -use_2to3 bool -use_2to3_fixers list-comma -use_2to3_exclude_fixers list-comma -convert_2to3_doctests list-comma scripts list-comma eager_resources list-comma dependency_links list-comma diff --git a/docs/userguide/development_mode.rst b/docs/userguide/development_mode.rst index 3c477ec1..90bc5676 100644 --- a/docs/userguide/development_mode.rst +++ b/docs/userguide/development_mode.rst @@ -28,14 +28,6 @@ Python's ``site-packages`` directory, it will also update the ``easy-install.pth`` file to include your project's source code, thereby making it available on ``sys.path`` for all programs using that Python installation. -If you have enabled the ``use_2to3`` flag, then of course the ``.egg-link`` -will not link directly to your source code when run under Python 3, since -that source code would be made for Python 2 and not work under Python 3. -Instead the ``setup.py develop`` will build Python 3 code under the ``build`` -directory, and link there. This means that after doing code changes you will -have to run ``setup.py build`` before these changes are picked up by your -Python 3 installation. - In addition, the ``develop`` command creates wrapper scripts in the target script directory that will run your in-development scripts after ensuring that all your ``install_requires`` packages are available on ``sys.path``. diff --git a/docs/userguide/keywords.rst b/docs/userguide/keywords.rst index 268e4f42..5388ffea 100644 --- a/docs/userguide/keywords.rst +++ b/docs/userguide/keywords.rst @@ -157,18 +157,6 @@ unless you need the associated ``setuptools`` feature. mess with it. For more details on how this argument works, see the section below on :ref:`Automatic Resource Extraction`. -``use_2to3`` - Convert the source code from Python 2 to Python 3 with 2to3 during the - build process. See :doc:`../deprecated/python3` for more details. - -``convert_2to3_doctests`` - List of doctest source files that need to be converted with 2to3. - See :doc:`../deprecated/python3` for more details. - -``use_2to3_fixers`` - A list of modules to search for additional fixers to be used during - the 2to3 conversion. See :doc:`../deprecated/python3` for more details. - ``project_urls`` An arbitrary map of URL names to hyperlinks, allowing more extensible documentation of where various resources can be found than the simple |
