-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
Make sure namespace packages (e.g. virtualenvwrapper) don't break pex #338
Conversation
I'll fix the (minor style) error tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, one thought.
try: | ||
module.__path__[0] | ||
except (TypeError, KeyError, IndexError): | ||
TRACER.log('Dropping %s' % (module_name,), V=3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given the treatment of module.__path__
on the lines below - which includes index access as well as a .pop()
method call - I wonder if an explicit type check might be more appropriate as a drop condition vs the attempted index access?
e.g.
if not isinstance(module.__path__, list):
TRACER.log(...)
continue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
OK, updated. Thanks for the quick review! A speedy release would be nice: for server-side deploys this is less of an issue, but for my use case (distributing developer tools) this is a blocking bug. If anyone else is using pex to distribute developer tools their tool will be breaking at random. |
@itamarst thanks for the PR! this went out in the 1.1.19 release today. |
Summary: This diff is basically just an import of pex-tool/pex#338, but without the tests (we don't have the pex tests in this repo?). This solves a problem where the pex would fail to run any time you had a namespaced package in your path. Test Plan: eyes Reviewed By: sdwilsh fbshipit-source-id: 8d500c3
Fixes #337.
Let me know what else I can do to get this accepted.