diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2012-07-21 17:25:51 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2012-07-21 17:25:51 -0400 |
| commit | 686a056a8c3b362ae112b289644ef34e8a272b65 (patch) | |
| tree | 8ab5eb9c0ec60143f973a98ced721cec1642971a | |
| parent | 3a042756a6f849a81171204d1f922214fe8483f0 (diff) | |
| parent | 12c0d7f3e916957294a095a8425554fe8413e42e (diff) | |
| download | python-setuptools-git-686a056a8c3b362ae112b289644ef34e8a272b65.tar.gz | |
Merge pull request #12
--HG--
branch : distribute
extra : rebase_source : d28d651ee0c59a1194c171613aefe284ade4399b
| -rw-r--r-- | CHANGES.txt | 1 | ||||
| -rw-r--r-- | setuptools/command/bdist_egg.py | 2 | ||||
| -rw-r--r-- | setuptools/tests/test_bdist_egg.py | 69 |
3 files changed, 72 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 7502ecac..149b1fed 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,7 @@ CHANGES * Issue 294: setup.py can now be invoked from any directory. * Scripts are now installed honoring the umask. * Added support for .dist-info directories. +* 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) + |
