From 7e046140653ce51c0ee5542338501d5f679f051c Mon Sep 17 00:00:00 2001 From: Dong-hee Na Date: Thu, 1 Jul 2021 22:17:53 +0900 Subject: [PATCH 1/3] bpo-43425: Remove test2to3 from Tools --- .../2021-07-01-22-21-25.bpo-43425.t65len.rst | 2 ++ Tools/README | 2 -- Tools/test2to3/README | 3 --- Tools/test2to3/maintest.py | 10 ------- Tools/test2to3/setup.py | 26 ------------------- Tools/test2to3/test/runtests.py | 19 -------------- Tools/test2to3/test/test_foo.py | 8 ------ Tools/test2to3/test2to3/__init__.py | 1 - Tools/test2to3/test2to3/hello.py | 5 ---- 9 files changed, 2 insertions(+), 74 deletions(-) create mode 100644 Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst delete mode 100644 Tools/test2to3/README delete mode 100755 Tools/test2to3/maintest.py delete mode 100644 Tools/test2to3/setup.py delete mode 100644 Tools/test2to3/test/runtests.py delete mode 100644 Tools/test2to3/test/test_foo.py delete mode 100644 Tools/test2to3/test2to3/__init__.py delete mode 100644 Tools/test2to3/test2to3/hello.py diff --git a/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst b/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst new file mode 100644 index 00000000000000..07dbba6aed6af9 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst @@ -0,0 +1,2 @@ +The project demo(test2to3) that demonstrates how a distutils package is +removed. Patch by Dong-hee Na diff --git a/Tools/README b/Tools/README index b6d0b18e5a5c27..1f9d927fb613b0 100644 --- a/Tools/README +++ b/Tools/README @@ -35,8 +35,6 @@ scripts A number of useful single-file programs, e.g. tabnanny.py stringbench A suite of micro-benchmarks for various operations on strings (both 8-bit and unicode). (*) -test2to3 A demonstration of how to use 2to3 transparently in setup.py. - unicode Tools for generating unicodedata and codecs from unicode.org and other mapping files (by Fredrik Lundh, Marc-Andre Lemburg and Martin von Loewis). diff --git a/Tools/test2to3/README b/Tools/test2to3/README deleted file mode 100644 index 9365593bee106f..00000000000000 --- a/Tools/test2to3/README +++ /dev/null @@ -1,3 +0,0 @@ -This project demonstrates how a distutils package -can support Python 2.x and Python 3.x from a single -source, using lib2to3. \ No newline at end of file diff --git a/Tools/test2to3/maintest.py b/Tools/test2to3/maintest.py deleted file mode 100755 index 036dd4f00ce24b..00000000000000 --- a/Tools/test2to3/maintest.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 - -# The above line should get replaced with the path to the Python -# interpreter; the block below should get 2to3-converted. - -try: - from test2to3.hello import hello -except ImportError, e: - print "Import failed", e -hello() diff --git a/Tools/test2to3/setup.py b/Tools/test2to3/setup.py deleted file mode 100644 index a0f9024145eacb..00000000000000 --- a/Tools/test2to3/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: iso-8859-1 -*- -from distutils.core import setup - -try: - from distutils.command.build_py import build_py_2to3 as build_py -except ImportError: - from distutils.command.build_py import build_py - -try: - from distutils.command.build_scripts import build_scripts_2to3 as build_scripts -except ImportError: - from distutils.command.build_scripts import build_scripts - -setup( - name = "test2to3", - version = "1.0", - description = "2to3 distutils test package", - author = "Martin v. Löwis", - author_email = "python-dev@python.org", - license = "PSF license", - packages = ["test2to3"], - scripts = ["maintest.py"], - cmdclass = {'build_py': build_py, - 'build_scripts': build_scripts, - } -) diff --git a/Tools/test2to3/test/runtests.py b/Tools/test2to3/test/runtests.py deleted file mode 100644 index 1730f0db13e658..00000000000000 --- a/Tools/test2to3/test/runtests.py +++ /dev/null @@ -1,19 +0,0 @@ -# Fictitious test runner for the project - -import sys, os - -if sys.version_info > (3,): - # copy test suite over to "build/lib" and convert it - from distutils.util import copydir_run_2to3 - testroot = os.path.dirname(__file__) - newroot = os.path.join(testroot, '..', 'build/lib/test') - copydir_run_2to3(testroot, newroot) - # in the following imports, pick up the converted modules - sys.path[0] = newroot - -# run the tests here... - -from test_foo import FooTest - -import unittest -unittest.main() diff --git a/Tools/test2to3/test/test_foo.py b/Tools/test2to3/test/test_foo.py deleted file mode 100644 index ec8f26a65a9710..00000000000000 --- a/Tools/test2to3/test/test_foo.py +++ /dev/null @@ -1,8 +0,0 @@ -import sys -import unittest - -class FooTest(unittest.TestCase): - def test_foo(self): - # use 2.6 syntax to demonstrate conversion - print 'In test_foo, using Python %s...' % (sys.version_info,) - self.assertTrue(False) diff --git a/Tools/test2to3/test2to3/__init__.py b/Tools/test2to3/test2to3/__init__.py deleted file mode 100644 index 1bb8bf6d7fd4c8..00000000000000 --- a/Tools/test2to3/test2to3/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# empty diff --git a/Tools/test2to3/test2to3/hello.py b/Tools/test2to3/test2to3/hello.py deleted file mode 100644 index f52926b03ce0f7..00000000000000 --- a/Tools/test2to3/test2to3/hello.py +++ /dev/null @@ -1,5 +0,0 @@ -def hello(): - try: - print "Hello, world" - except IOError, e: - print e.errno From 413fec08c2c2c50a1ac706cf6bfeec136c5b722c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Langa?= Date: Sat, 17 Jul 2021 11:02:40 +0200 Subject: [PATCH 2/3] Update 2021-07-01-22-21-25.bpo-43425.t65len.rst --- .../next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst b/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst index 07dbba6aed6af9..f0d4377db1575b 100644 --- a/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst +++ b/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst @@ -1,2 +1 @@ -The project demo(test2to3) that demonstrates how a distutils package is -removed. Patch by Dong-hee Na +Removed the `test2to3` demo project that demonstrated using lib2to3 to support Python 2.x and Python 3.x from a single source in a distutils package. Patch by Dong-hee Na From b8c5afaf0f088b8db495848f0abc55d225d16976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Langa?= Date: Sat, 17 Jul 2021 11:34:30 +0200 Subject: [PATCH 3/3] Make rstcheck happy --- .../next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst b/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst index f0d4377db1575b..b9ce6c467f90b9 100644 --- a/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst +++ b/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst @@ -1 +1,3 @@ -Removed the `test2to3` demo project that demonstrated using lib2to3 to support Python 2.x and Python 3.x from a single source in a distutils package. Patch by Dong-hee Na +Removed the 'test2to3' demo project that demonstrated using lib2to3 +to support Python 2.x and Python 3.x from a single source in +a distutils package. Patch by Dong-hee Na