diff options
-rw-r--r-- | CHANGES.txt | 6 | ||||
-rw-r--r-- | setuptools/command/bdist_egg.py | 2 | ||||
-rw-r--r-- | setuptools/tests/test_bdist_egg.py | 69 |
3 files changed, 77 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 2707f01c..a58c1ce1 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,12 @@ CHANGES ======= ------ +0.6.28 +------ + +* Issue #283 bdist_egg issues with python 3.3.0aX + +------ 0.6.27 ------ diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 68ca15c7..a9d98d3b 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -459,6 +459,8 @@ def iter_symbols(code): yield name def can_scan(): + if sys.version_info > (3, 3): + return False # Can't scan recent formats if not sys.platform.startswith('java') and sys.platform != 'cli': # CPython, PyPy, etc. return True diff --git a/setuptools/tests/test_bdist_egg.py b/setuptools/tests/test_bdist_egg.py new file mode 100644 index 00000000..7da122cc --- /dev/null +++ b/setuptools/tests/test_bdist_egg.py @@ -0,0 +1,69 @@ +"""develop tests +""" +import sys +import os, re, shutil, tempfile, unittest +import tempfile +import site +from StringIO import StringIO + +from distutils.errors import DistutilsError +from setuptools.command.bdist_egg import bdist_egg +from setuptools.command import easy_install as easy_install_pkg +from setuptools.dist import Distribution + +SETUP_PY = """\ +from setuptools import setup + +setup(name='foo', py_modules=['hi']) +""" + +class TestDevelopTest(unittest.TestCase): + + def setUp(self): + self.dir = tempfile.mkdtemp() + self.old_cwd = os.getcwd() + os.chdir(self.dir) + f = open('setup.py', 'w') + f.write(SETUP_PY) + f.close() + f = open('hi.py', 'w') + f.write('1\n') + f.close() + if sys.version >= "2.6": + self.old_base = site.USER_BASE + site.USER_BASE = tempfile.mkdtemp() + self.old_site = site.USER_SITE + site.USER_SITE = tempfile.mkdtemp() + + def tearDown(self): + os.chdir(self.old_cwd) + shutil.rmtree(self.dir) + if sys.version >= "2.6": + shutil.rmtree(site.USER_BASE) + shutil.rmtree(site.USER_SITE) + site.USER_BASE = self.old_base + site.USER_SITE = self.old_site + + def test_bdist_egg(self): + dist = Distribution(dict( + script_name='setup.py', + script_args=['bdist_egg'], + name='foo', + py_modules=['hi'] + )) + os.makedirs(os.path.join('build', 'src')) + old_stdout = sys.stdout + sys.stdout = o = StringIO() + try: + dist.parse_command_line() + dist.run_commands() + finally: + sys.stdout = old_stdout + + # let's see if we got our egg link at the right place + [content] = os.listdir('dist') + self.assertTrue(re.match('foo-0.0.0-py[23].\d.egg$', content)) + +def test_suite(): + return unittest.makeSuite(TestDevelopTest) + |