[Python-checkins] bpo-43425: Remove test2to3 from Tools (#26981)

ambv webhook-mailer at python.org
Sat Jul 17 06:10:47 EDT 2021


https://github.com/python/cpython/commit/d0b2b00c7d5ac3dc18d77bf4fcf607ee98c11650
commit: d0b2b00c7d5ac3dc18d77bf4fcf607ee98c11650
branch: main
author: Dong-hee Na <donghee.na at python.org>
committer: ambv <lukasz at langa.pl>
date: 2021年07月17日T12:10:43+02:00
summary:
bpo-43425: Remove test2to3 from Tools (#26981)
Co-authored-by: Łukasz Langa <lukasz at langa.pl>
files:
A Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst
D Tools/test2to3/README
D Tools/test2to3/maintest.py
D Tools/test2to3/setup.py
D Tools/test2to3/test/runtests.py
D Tools/test2to3/test/test_foo.py
D Tools/test2to3/test2to3/__init__.py
D Tools/test2to3/test2to3/hello.py
M Tools/README
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..b9ce6c467f90b9
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2021-07-01-22-21-25.bpo-43425.t65len.rst
@@ -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
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 at 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /