-
-
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
PEX zips now contain directory entries. #1022
Conversation
Previously they did not which led to PEP-420 namespace packages not working in `--zip-safe` context. Fixes pex-tool#1021
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.
Excellent. The tests look great, too. Thanks!
with temporary_dir() as output_dir: | ||
with temporary_dir() as input_dir: | ||
with safe_open(os.path.join(input_dir, "a/b/c.py"), "w") as fh: |
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.
Nit, you can combine these to reduce nesting:
with temporary_dir() as output_dir, temporary_dir() as input_dir():
This is fine to keep - only want to make sure you're aware.
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.
Ack. I'll stick with the copypasta from the test above for now.
if os.path.isdir(member1_path): | ||
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.
What's the reason for skipping? Are the directory entries not byte-for-byte identical?
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.
It's because filecmp.cmp
considers anything not a regular file (symlink, directory, etc.) unequal.
Previously they did not which led to PEP-420 namespace packages not
working in
--zip-safe
context.Fixes #1021