Commit 17502a06 authored by Tarek Ziade's avatar Tarek Ziade

changed test locally so distribute.egg-info/entry_points.txt is not changed when running tests

--HG--
branch : distribute
extra : rebase_source : ae42d5a7c843fb5dd3bede9ba44ece9742075cbf
parent 0c8f3ad9
......@@ -41,6 +41,8 @@ VERSION = "0.6.13"
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as _build_py
from setuptools.command.test import test as _test
scripts = []
# specific command that is used to generate windows .exe files
......@@ -64,6 +66,36 @@ class build_py(_build_py):
if copied and srcfile in self.distribution.convert_2to3_doctests:
self.__doctests_2to3.append(outf)
class test(_test):
"""Specific test class to avoid rewriting the entry_points.txt"""
def run(self):
entry_points = os.path.join('distribute.egg-info', 'entry_points.txt')
if not os.path.exists(entry_points):
try:
_test.run(self)
finally:
return
f = open(entry_points)
# running the test
try:
ep_content = f.read()
finally:
f.close()
try:
_test.run(self)
finally:
# restoring the file
f = open(entry_points, 'w')
try:
f.write(ep_content)
finally:
f.close()
# if we are installing Distribute using "python setup.py install"
# we need to get setuptools out of the way
def _easy_install_marker():
......@@ -90,6 +122,7 @@ if _being_installed():
from distribute_setup import _before_install
_before_install()
dist = setup(
name="distribute",
version=VERSION,
......@@ -110,6 +143,7 @@ dist = setup(
zip_safe = (sys.version>="2.5"), # <2.5 needs unzipped for -m to work
cmdclass = {'test': test},
entry_points = {
"distutils.commands" : [
......
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