From: Stephen F. <st...@th...> - 2019-08-25 15:57:35
|
This is no longer necessary. The documentation and 'tox.ini' file are updated accordingly. Signed-off-by: Stephen Finucane <st...@th...ru> --- docutils/.gitignore | 1 - docutils/README.txt | 33 ++++-------------------------- docutils/RELEASE-NOTES.txt | 9 ++++++++- docutils/docs/dev/testing.txt | 12 +++++++---- docutils/docs/dev/todo.txt | 9 --------- docutils/setup.py | 38 ----------------------------------- docutils/tox.ini | 8 -------- 7 files changed, 20 insertions(+), 90 deletions(-) diff --git a/docutils/.gitignore b/docutils/.gitignore index 55701f5f6..cd9dc988d 100644 --- a/docutils/.gitignore +++ b/docutils/.gitignore @@ -9,7 +9,6 @@ __pycache__ .venv .tox -/test3 /test/alltests.out /test/record.txt /test/functional/output diff --git a/docutils/README.txt b/docutils/README.txt index 41c8c6ba9..5c3eaea71 100644 --- a/docutils/README.txt +++ b/docutils/README.txt @@ -123,23 +123,9 @@ installed: Python 3 compatibility ---------------------- -The Docutils codebase is written for Python 2 and uses "on-demand" -translation for `porting to Python 3`_. - -* The `setup.py` script generates Python 3 compatible sources in - ``build/`` and tests in ``tests3/`` sub-directories during - installation_ with Python 3. - -* The scripts in the ``tools/`` sub-directory work with all supported - Python versions without conversion. - -* To convert the sources without installing (e.g. for testing), run - ``python3 setup.py build``. - -* When editing the source, do changes on the Python 2 versions of the - files and re-run the build command. - -.. _porting to Python 3: http://docs.python.org/py3k/howto/pyporting.html +Historically, the docutils codebase was Python 2 only and was translated +"on-demand" using the 2to3 tool. Starting with docutils 0.17, the code base now +supports both Python 2.7 and 3.4+ natively. Project Files & Directories @@ -194,12 +180,6 @@ Project Files & Directories if you're planning to modify it. See `Running the Test Suite`_ below. -Generated directories when installing under Python 3: - -* build: Converted sources. - -* test3: Converted tests. - Installation ============ @@ -232,7 +212,7 @@ GNU/Linux, BSDs, Unix, Mac OS X, etc. To install for a specific Python version, use this version in the setup call, e.g. :: - python3.1 setup.py install + python3.7 setup.py install To install for different Python versions, repeat step 3 for every required version. The last installed version will be used in the @@ -332,11 +312,6 @@ Under Windows, type:: cd <archive_directory_path>\test python alltests.py -For testing with Python 3 use the converted test suite:: - - cd <archive_directory_path>/test3 - python3 alltests.py - You should see a long line of periods, one for each test, and then a summary like this:: diff --git a/docutils/RELEASE-NOTES.txt b/docutils/RELEASE-NOTES.txt index 36872eef7..49e8fd4b4 100644 --- a/docutils/RELEASE-NOTES.txt +++ b/docutils/RELEASE-NOTES.txt @@ -61,7 +61,14 @@ Release 0.16 Docutils 0.16 is compatible with Python versions 2.7 and 3.5 to 3.7. (cf. `Python 3 compatibility`_). -* Keep `backslash escapes`__ in the document tree. +* General: + + - docutils now supports Python 2.7 and Python 3.5+ without the use of the + ``2to3`` tool + +* reStructuredText: + + - Keep `backslash escapes`__ in the document tree. __ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism diff --git a/docutils/docs/dev/testing.txt b/docutils/docs/dev/testing.txt index d7151d681..e685108c4 100644 --- a/docutils/docs/dev/testing.txt +++ b/docutils/docs/dev/testing.txt @@ -29,11 +29,15 @@ be sure that you haven't broken anything. From a shell:: cd docutils/test ./alltests.py -For Python 3, the tests must be converted with 2to3. To run the tests with -Python 3, ``cd`` to the package's root directory and do:: +You should run this with multiple Python versions. You can use ``tox`` for +this purpose. To run tests against all supported versions of Python, run:: - python3 setup.py build - python3 test3/alltests.py + tox + +To run against a specific version of Python, use the ``pyNN`` environment. +For example:: + + tox -e py37 Python Versions =============== diff --git a/docutils/docs/dev/todo.txt b/docutils/docs/dev/todo.txt index 16bb33dfc..70fa4060d 100644 --- a/docutils/docs/dev/todo.txt +++ b/docutils/docs/dev/todo.txt @@ -71,15 +71,6 @@ Many of these are now handled by Sphinx_ General ======= -* Move to single source for Python 2 and Python 3. - (Cf. `Porting Python 2 Code to Python 3`_ and - `clean single-source support for Python 2/3`_.) - - .. _Porting Python 2 Code to Python 3: - https://docs.python.org/3/howto/pyporting.html - .. _clean single-source support for Python 2/3: - http://python-future.org - * Encoding of command line arguments can only be guessed: * try UTF-8/strict first, then try the locale's encoding with diff --git a/docutils/setup.py b/docutils/setup.py index 77e151f6a..b952cdb40 100755 --- a/docutils/setup.py +++ b/docutils/setup.py @@ -13,9 +13,6 @@ try: from distutils.core import setup, Command from distutils.command.build import build from distutils.command.build_py import build_py - if sys.version_info >= (3,): - from distutils.command.build_py import build_py_2to3 - from distutils.util import copydir_run_2to3 from distutils.command.install_data import install_data from distutils.util import convert_path from distutils import log @@ -27,36 +24,6 @@ except ImportError: sys.exit(1) -if sys.version_info >= (3,): - # copy-convert auxiliary python sources - class copy_build_py_2to3(build_py_2to3): - """Copy/convert Python source files in given directories recursively. - - Build py3k versions of the modules and packages. - Also copy 'test/' suite and run 2to3 on *.py files. - """ - manifest_in = """\ - exclude *.pyc *~ .DS_Store - recursive-exclude * *.pyc *~ .DS_Store - recursive-exclude functional/output * - include functional/output/README.txt - prune .svn - prune */.svn - prune */*/.svn - prune */*/*/.svn - prune */*/*/*/.svn - prune */*/*/*/*/.svn - """ - def run(self): - # fix - print("build_py_2to3") - build_py_2to3.run(self) - print("copy/convert test suite") - loglevel = log.set_threshold(log.ERROR) - copydir_run_2to3('test', 'test3', template=self.manifest_in) - log.set_threshold(loglevel) - - class smart_install_data(install_data): # From <http://wiki.python.org/moin/DistutilsInstallDataScattered>, # by Pete Shinners. @@ -96,11 +63,6 @@ def do_setup(): # Install data files properly. kwargs['cmdclass'] = {'build_data': build_data, 'install_data': smart_install_data} - # Auto-convert source code for Python 3 - if sys.version_info >= (3,): - kwargs['cmdclass']['build_py'] = copy_build_py_2to3 - else: - kwargs['cmdclass']['build_py'] = build_py dist = setup(**kwargs) return dist diff --git a/docutils/tox.ini b/docutils/tox.ini index e575cb7dd..08c194495 100644 --- a/docutils/tox.ini +++ b/docutils/tox.ini @@ -11,14 +11,6 @@ skipsdist = True whitelist_externals = find rm -commands = - find . -type f -name "*.pyc" -delete - rm -rf build test3 - python setup.py build - python setup.py install - python test3/alltests.py - -[testenv:py27] commands = find . -type f -name "*.pyc" -delete rm -rf build -- 2.21.0 |