Skip to content
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
ghost opened this issue Jan 22, 2016 · 4 comments
Closed

special casing importlib.machinery breaks PyPy #487

ghost opened this issue Jan 22, 2016 · 4 comments

Comments

@ghost
Copy link

ghost 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


@ghost
Copy link
Author

ghost 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.

@ghost
Copy link
Author

ghost commented Jan 25, 2016

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


Excellent!

@ghost
Copy link
Author

ghost 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.

@ghost
Copy link
Author

ghost 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).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants