Commit 9875a7b2 authored by Jason R. Coombs's avatar Jason R. Coombs

Remove support for setup.py test. Use the recommended test runner (setup.py ptr).

parent c7de48c1
......@@ -4,7 +4,6 @@ import io
import os
import sys
import textwrap
import contextlib
# Allow to run setup.py from another directory.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
......@@ -27,7 +26,6 @@ with open(ver_path) as ver_file:
import setuptools
from setuptools.command.build_py import build_py as _build_py
from setuptools.command.test import test as _test
scripts = []
......@@ -61,32 +59,6 @@ class build_py(_build_py):
outf, copied = self.copy_file(srcfile, target)
srcfile = os.path.abspath(srcfile)
class test(_test):
"""Specific test class to avoid rewriting the entry_points.txt"""
def run(self):
with self._save_entry_points():
_test.run(self)
@contextlib.contextmanager
def _save_entry_points(self):
entry_points = os.path.join('setuptools.egg-info', 'entry_points.txt')
if not os.path.exists(entry_points):
yield
return
# save the content
with open(entry_points, 'rb') as f:
ep_content = f.read()
# run the tests
try:
yield
finally:
# restore the file
with open(entry_points, 'wb') as f:
f.write(ep_content)
readme_file = io.open('README.txt', encoding='utf-8')
......@@ -116,7 +88,6 @@ setup_params = dict(
long_description=long_description,
keywords="CPAN PyPI distutils eggs package management",
url="https://bitbucket.org/pypa/setuptools",
test_suite='setuptools.tests',
src_root=src_root,
packages=setuptools.find_packages(),
package_data=package_data,
......@@ -125,7 +96,6 @@ setup_params = dict(
zip_safe=True,
cmdclass={'test': test},
entry_points={
"distutils.commands": [
"%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s" % locals()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment