]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43425: Remove test2to3 from Tools (#26981)
authorDong-hee Na <donghee.na@python.org>
Sat, 17 Jul 2021 10:10:43 +0000 (19:10 +0900)
committerGitHub <noreply@github.com>
Sat, 17 Jul 2021 10:10:43 +0000 (12:10 +0200)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst [new file with mode: 0644]
Tools/README
Tools/test2to3/README [deleted file]
Tools/test2to3/maintest.py [deleted file]
Tools/test2to3/setup.py [deleted file]
Tools/test2to3/test/runtests.py [deleted file]
Tools/test2to3/test/test_foo.py [deleted file]
Tools/test2to3/test2to3/__init__.py [deleted file]
Tools/test2to3/test2to3/hello.py [deleted file]

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 (file)
index 0000000..b9ce6c4
--- /dev/null
@@ -0,0 +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
index b6d0b18e5a5c27492a7e5f6de574f16adeb0c0ce..1f9d927fb613b0fe8a86c8fc93e8a3b6a48a6d31 100644 (file)
@@ -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 (file)
index 9365593..0000000
+++ /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 (executable)
index 036dd4f..0000000
+++ /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 (file)
index a0f9024..0000000
+++ /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 (file)
index 1730f0d..0000000
+++ /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 (file)
index ec8f26a..0000000
+++ /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 (file)
index 1bb8bf6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# empty
diff --git a/Tools/test2to3/test2to3/hello.py b/Tools/test2to3/test2to3/hello.py
deleted file mode 100644 (file)
index f52926b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-def hello():
-    try:
-        print "Hello, world"
-    except IOError, e:
-        print e.errno