aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2008-08-21 18:36:39 +0000
committerPJ Eby <distutils-sig@python.org>2008-08-21 18:36:39 +0000
commit49dfb4a17843282fa7359247b68d857d737847fd (patch)
tree3579cf01b3615a66fcda0fd5782dd69c77352160 /setuptools
parent2d3007539b9ed75f8f5d5a35284640a03235f422 (diff)
downloadexternal_python_setuptools-49dfb4a17843282fa7359247b68d857d737847fd.tar.gz
external_python_setuptools-49dfb4a17843282fa7359247b68d857d737847fd.tar.bz2
external_python_setuptools-49dfb4a17843282fa7359247b68d857d737847fd.zip
Fix http://bugs.python.org/setuptools/issue31 (backport from trunk)
--HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4065948
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/depends.py12
-rw-r--r--setuptools/tests/__init__.py14
2 files changed, 11 insertions, 15 deletions
diff --git a/setuptools/depends.py b/setuptools/depends.py
index 20e5cecb..4b7b3437 100644
--- a/setuptools/depends.py
+++ b/setuptools/depends.py
@@ -204,7 +204,6 @@ def get_module_constant(module, symbol, default=-1, paths=None):
def extract_constant(code,symbol,default=-1):
-
"""Extract the constant value of 'symbol' from 'code'
If the name 'symbol' is bound to a constant value by the Python code
@@ -237,10 +236,11 @@ def extract_constant(code,symbol,default=-1):
return const
else:
const = default
-
-
-
-
-
+
+if sys.platform.startswith('java') or sys.platform == 'cli':
+ # XXX it'd be better to test assertions about bytecode instead...
+ del extract_constant, get_module_constant
+ __all__.remove('extract_constant')
+ __all__.remove('get_module_constant')
diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py
index c269be02..287bc240 100644
--- a/setuptools/tests/__init__.py
+++ b/setuptools/tests/__init__.py
@@ -1,5 +1,4 @@
"""Tests for the 'setuptools' package"""
-
from unittest import TestSuite, TestCase, makeSuite, defaultTestLoader
import distutils.core, distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError
@@ -7,8 +6,8 @@ from distutils.errors import DistutilsSetupError
import setuptools, setuptools.dist
from setuptools import Feature
from distutils.core import Extension
-from setuptools.depends import extract_constant, get_module_constant
-from setuptools.depends import find_module, Require
+extract_constant, get_module_constant = None, None
+from setuptools.depends import *
from distutils.version import StrictVersion, LooseVersion
from distutils.util import convert_path
import sys, os.path
@@ -41,14 +40,10 @@ def makeSetup(**args):
-
-
-
class DependsTests(TestCase):
def testExtractConst(self):
-
- from setuptools.depends import extract_constant
+ if not extract_constant: return # skip on non-bytecode platforms
def f1():
global x,y,z
@@ -74,6 +69,7 @@ class DependsTests(TestCase):
f,p,i = find_module('setuptools.tests'); f.close()
def testModuleExtract(self):
+ if not get_module_constant: return # skip on non-bytecode platforms
from distutils import __version__
self.assertEqual(
get_module_constant('distutils','__version__'), __version__
@@ -86,6 +82,7 @@ class DependsTests(TestCase):
)
def testRequire(self):
+ if not extract_constant: return # skip on non-bytecode platforms
req = Require('Distutils','1.0.3','distutils')
@@ -125,7 +122,6 @@ class DependsTests(TestCase):
self.failUnless(req.is_current(paths))
-
class DistroTests(TestCase):
def setUp(self):