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 minimal CLI #42

Merged
merged 3 commits into from
Jan 4, 2023
Merged

Add minimal CLI #42

merged 3 commits into from
Jan 4, 2023

Conversation

stephenfin
Copy link
Contributor

Add a minimal CLI interface that can be used as an alternative to build.

This clearly isn't complete: I'd like to see whether it's worth doing before I go any further.

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

You'll need to add tests too, and I think we should add build_editable too via -e, --editable too.

src/pyproject_api/build.py Outdated Show resolved Hide resolved
src/pyproject_api/build.py Outdated Show resolved Hide resolved
src/pyproject_api/build.py Outdated Show resolved Hide resolved
Signed-off-by: Stephen Finucane <stephen@that.guru>
src/pyproject_api/__main__.py Outdated Show resolved Hide resolved
tests/test_main.py Outdated Show resolved Hide resolved
@stephenfin
Copy link
Contributor Author

stephenfin commented Jan 4, 2023

I'm still not sure about the -e / --editable. Given we're not actually installing these things (that's the job of pip or something else), what value is there is generating them? From PEP-660:

An “editable” wheel uses the wheel format not for distribution but as ephemeral communication between the build system and the front end. This avoids having the build backend install anything directly. This wheel must not be exposed to end users, nor cached, nor distributed.

Should we really be exposing this?

This can be useful for testing purposes.

Signed-off-by: Stephen Finucane <stephen@that.guru>
@stephenfin stephenfin changed the title Add minimal frontend Add minimal CLI Jan 4, 2023
@gaborbernat
Copy link
Member

'm still not sure about the -e / --editable. Given we're not actually installing these things (that's the job of pip or something else), what value is there is generating them?

The main utility of this endpoint is for people to validate their build backend, and for that, I think it's useful.

src/pyproject_api/__main__.py Outdated Show resolved Hide resolved
Leave this to argparse.

Signed-off-by: Stephen Finucane <stephen@that.guru>
@gaborbernat
Copy link
Member

By the way what's your use case for this functionality?

@stephenfin
Copy link
Contributor Author

By the way what's your use case for this functionality?

I was using it as a quick way to understand the pbr issues I was investigating in tox-dev/tox#2712. This gave me a realistic "user" of the sample frontend and helped me understand how it was all working. I figured if it helped me it would probably help others. In time, it would be nice to add a frontend that re-uses process like the Pep517VirtualEnvFrontend frontend in tox, since I suspect that's likely to highlight bugs in other build backends over time. This is still a good enough first pass though, IMO.

@gaborbernat gaborbernat merged commit 1a95ecc into tox-dev:main Jan 4, 2023
@stephenfin stephenfin deleted the cli branch January 4, 2023 20:58
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.

None yet

2 participants