def __init__(self, wheel_file): wheel = Wheel(wheel_file) assert wheel.is_compatible(), \ "%s is not compatible with this platform" % wheel_file wheel.verify() self.wheel = wheel
def __init__(self, wheel_file): wheel = Wheel(wheel_file) if not wheel.is_compatible(): # Workaround for https://bitbucket.org/pypa/distlib/issues/93 log.warning( "WARNING: Distlib reports that %s is not compatible " "with this platform. " "(Note that on some versions of python, " "distlib's detection of compatible ABIs is broken. " "See distlib issue #93.)", wheel_file) wheel.verify() self.wheel = wheel
def test_mount_extensions(self): if PYVER == 'py27': fn = 'minimext-0.1-cp27-none-linux_x86_64.whl' elif PYVER == 'py32': fn = 'minimext-0.1-cp32-cp32mu-linux_x86_64.whl' elif PYVER == 'py33': fn = 'minimext-0.1-cp33-cp33m-linux_x86_64.whl' else: fn = None if not fn: # pragma: no cover raise unittest.SkipTest('Suitable wheel not found.') fn = os.path.join(HERE, fn) w = Wheel(fn) if not w.is_compatible() or not w.is_mountable(): # pragma: no cover raise unittest.SkipTest('Wheel not suitable for mounting.') self.assertRaises(ImportError, __import__, 'minimext') w.mount() mod = __import__('minimext') self.assertIs(mod, sys.modules['minimext']) self.assertEqual(mod.fib(10), 55) w.unmount() del sys.modules['minimext'] self.assertRaises(ImportError, __import__, 'minimext')
def test_mount_extensions(self): if PYVER == "py27": fn = "minimext-0.1-cp27-none-linux_x86_64.whl" elif PYVER == "py32": fn = "minimext-0.1-cp32-cp32mu-linux_x86_64.whl" elif PYVER == "py33": fn = "minimext-0.1-cp33-cp33m-linux_x86_64.whl" else: fn = None if not fn: # pragma: no cover raise unittest.SkipTest("Suitable wheel not found.") fn = os.path.join(HERE, fn) w = Wheel(fn) if not w.is_compatible() or not w.is_mountable(): # pragma: no cover raise unittest.SkipTest("Wheel not suitable for mounting.") self.assertRaises(ImportError, __import__, "minimext") w.mount() mod = __import__("minimext") self.assertIs(mod, sys.modules["minimext"]) self.assertEqual(mod.fib(10), 55) w.unmount() del sys.modules["minimext"] self.assertRaises(ImportError, __import__, "minimext")