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

Add pex3 lock export-subset. #2145

Merged
merged 1 commit into from
May 5, 2023
Merged

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented May 4, 2023

Due to lack of foresight, pex3 lock export has a CLI that is poisoned
for use in a consistent way with the rest of PEX while at the same time
introducing subset support; so an export-subset sub-command is broken
out sharing the vast majority of the export code.

This is immediately useful to a-scie/lift for supporting Pex lock files
on Windows where there is no Pex support yet but seems useful in general
on the same interoperability front the export goal was introduced for:
speaking the ~lingua-franca of Pip.

Due to lack of foresight, `pex3 lock export` has a CLI that is poisoned
for use in a consistent way with the rest of PEX while at the same time
introducing subset support; so an `export-subset` subcommand is broken
out sharing the vast majority of the `export` code.

This is immediately useful to a-scie/lift for supporting Pex lock files
on Windows where there is no Pex support yet but seems useful in general
on the same interoperability front the `export` goal was introduced for:
speaking the ~lingua-franca of Pip.
@jsirois jsirois requested review from zmanji and benjyw May 4, 2023 00:32
@jsirois jsirois mentioned this pull request May 4, 2023
2 tasks
@zmanji
Copy link
Collaborator

zmanji commented May 4, 2023

The code and tests lgtm. I'm not an expert as to how lock export works but the behaviour in the tests lgtm.

@jsirois jsirois requested a review from stuhood May 4, 2023 22:09
Copy link
Collaborator

@benjyw benjyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that the CLI poison is the use of a positional arg for the lockfile, while also wanting to use positional args for the requirement subset? It would be possible to have the first positional arg be the lockfile and subsequent ones be the requirements, no? I agree that is janky though.

@jsirois
Copy link
Member Author

jsirois commented May 5, 2023

Exactly. Yeah, that seems like a confusing, or at least easy to get wrong, interface for users.

@jsirois jsirois merged commit b215f37 into pex-tool:main May 5, 2023
@jsirois jsirois deleted the pex3/lock/subset branch May 5, 2023 04:09
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.

4 participants