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

FR: Encode flit-core build backend in uv #6423

Closed
chrisrodrigue opened this issue Aug 22, 2024 · 4 comments
Closed

FR: Encode flit-core build backend in uv #6423

chrisrodrigue opened this issue Aug 22, 2024 · 4 comments

Comments

@chrisrodrigue
Copy link

chrisrodrigue commented Aug 22, 2024

I have previously floated the idea of uv defining/providing its own backend (see #3957) since the standard library does not provide this critical capability. I think that hatchling is a great build backend to use in the meantime and I am happy to see that it has been adopted as the default backend (#5527) when initializing projects.

I want to float the idea of base85 (or other more efficient) encoding a default backend in uv to bootstrap offline systems with a way to build when utilizing commands such as uv init or uv sync. Inspiration for this can be seen in the get-pip.py bootstrapping script.

Not only do I think that encoding/decoding a blessed backend will aid offline users, but I also think that it could improve performance by eliminating downloads for the transient build environment for users who elect to use the provided default.

While hatchling is a nice backend, it has numerous dependencies (packaging, pathspec, pluggy, tomli, trove-classifiers) that would need to be co-encoded, complicating maintenance and bloating the binary. I think flit-core is a great modern and minimalist alternative since it has no dependencies itself. It supports editable installations and a number of other common tasks.

@chrisrodrigue chrisrodrigue changed the title FR: encode default backend in uv binary FR: Encode default backend in uv binary Aug 22, 2024
@chrisrodrigue chrisrodrigue changed the title FR: Encode default backend in uv binary FR: Encode default backend in uv Aug 22, 2024
@chrisrodrigue
Copy link
Author

chrisrodrigue commented Aug 22, 2024

I’d be happy to implement this myself as a build time job that dynamically downloads and encodes the remote build backend when there’s a new version found.

But feel free to close this as an absolutely terrible idea 😄

@chrisrodrigue chrisrodrigue changed the title FR: Encode default backend in uv FR: Encode flit-core build backend in uv Aug 22, 2024
@chrisrodrigue chrisrodrigue changed the title FR: Encode flit-core build backend in uv FR: Encode flit-core build backend in uv Aug 22, 2024
@chrisrodrigue
Copy link
Author

There’s a base116 crate that advertises a data size increase of only 1/6 (versus 1/4 for base85) by leveraging UTF-8 over pure ASCII encoding.

@zanieb
Copy link
Member

zanieb commented Aug 22, 2024

I think we'd implement our own build backend before embedding a Python one into uv itself.

Related:

@zanieb
Copy link
Member

zanieb commented Aug 22, 2024

It's a cool idea though. The offline use-case for #3957 is interesting.

@zanieb zanieb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2024
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

No branches or pull requests

2 participants