New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

special casing importlib.machinery breaks PyPy #487

Closed
bb-migration opened this Issue Jan 22, 2016 · 4 comments

Comments

Projects
None yet
1 participant
@bb-migration

bb-migration commented Jan 22, 2016

Originally reported by: s3anj (Bitbucket: s3anj, GitHub: Unknown)


In pkg_resources/init.py the import of importlib only succeeds on cpython breaking pip on PyPy.

# Avoid try/except due to potential problems with delayed import mechanisms.
if sys.version_info >= (3, 3) and sys.implementation.name == "cpython":
    import importlib.machinery as importlib_machinery
else:
    importlib_machinery = None

PyPy3 has a working importlib.machinery package


@bb-migration

This comment has been minimized.

bb-migration commented Jan 23, 2016

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Invoke import on importlib.machinery directly. Access an attribute to force import in delayed-import environments. Fixes #487.

@bb-migration

This comment has been minimized.

bb-migration commented Jan 25, 2016

Original comment by s3anj (Bitbucket: s3anj, GitHub: Unknown):


Excellent!

@bb-migration

This comment has been minimized.

bb-migration commented Jan 26, 2016

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Turns out pypy3 2.4 doesn't have a complete importlib.machinery package. I had to make another commit, 11ef9534d735. Still, some tests fail on pypy3. Expect even more work will be needed to get full pypy3 compatibility.

@bb-migration

This comment has been minimized.

bb-migration commented Jan 31, 2016

Original comment by s3anj (Bitbucket: s3anj, GitHub: Unknown):


Thanks. I will continue to test against pypy3 3.2.x and the dev branch for pypy3 3.3.5 (where I discovered the above issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment