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

PEX zips now contain directory entries. #1022

Merged
merged 2 commits into from
Aug 29, 2020
Merged

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Aug 29, 2020

Previously they did not which led to PEP-420 namespace packages not
working in --zip-safe context.

Fixes #1021

Previously they did not which led to PEP-420 namespace packages not
working in `--zip-safe` context.

Fixes pex-tool#1021
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a 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!

Comment on lines +1134 to +1136
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:
Copy link
Contributor

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.

Copy link
Member Author

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.

Comment on lines +1672 to +1673
if os.path.isdir(member1_path):
continue
Copy link
Contributor

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?

Copy link
Member Author

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.

@jsirois jsirois merged commit 51dbf84 into pex-tool:master Aug 29, 2020
@jsirois jsirois deleted the issues/1021 branch August 30, 2020 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zipped PEXes don't contain directory entries.
2 participants