diff options
author | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> | 2010-05-25 18:39:05 +0200 |
---|---|---|
committer | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> | 2010-05-25 18:39:05 +0200 |
commit | bacf36252a50b1ad1347955d5a6c33e571d2c8cf (patch) | |
tree | 3449925ad3df907737bcb4eb843933c58fd1f23f /setup.py | |
parent | 9456da484efba996b190310fa39dca7db2c8ea81 (diff) | |
parent | 0756b06fcfc6bb9c045c6927605d1165cd7000cb (diff) | |
download | external_python_setuptools-bacf36252a50b1ad1347955d5a6c33e571d2c8cf.tar.gz external_python_setuptools-bacf36252a50b1ad1347955d5a6c33e571d2c8cf.tar.bz2 external_python_setuptools-bacf36252a50b1ad1347955d5a6c33e571d2c8cf.zip |
merge
--HG--
branch : distribute
extra : rebase_source : 5fbe57fd3b9bb48afcc78a87a7f7a46d9f4d2567
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -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" : [ |