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

Create source artifacts depending only on flit-core #12

Open
jaraco opened this issue Jul 30, 2024 · 0 comments
Open

Create source artifacts depending only on flit-core #12

jaraco opened this issue Jul 30, 2024 · 0 comments

Comments

@jaraco
Copy link
Member

jaraco commented Jul 30, 2024

This weekend, I had an epiphany.

One of the major pain points for any build backend is adopting dependencies (pypa/packaging-problems#342). As soon as any backend adds a dependency that's not built on flit-core, it runs into a cyclic dependency on itself and breaks source-only builds.

coherent.build hits this cycle on the first loop - coherent.build requires coherent.build to build.

Setuptools "solves" this problem by vendoring all of its dependencies, though it wishes not to do so.
Hatchling "solves" this problem incidentally by only having dependencies on projects that use flit-core or setuptools. If any of its dependencies were to adopt hatchling or if any of their dependencies were to adopt hatchling, it would have a circular dependency.
coherent.build doesn't solve this problem (source-only builds are broken).
flit-core solves the problem by implementing the whole of its functionality on the stdlib (a suitable approach, but doesn't generalize).

But it occurred to me - what if coherent.build, instead of producing sdists that depend on coherent.build, built its sdists to rely on flit-core. That is, all of the complicated work that relies on dependencies is in the "discovery" of metadata, and all of the metadata is materialized in the sdist. coherent.build could produce sdists that use a different build backend that merely copies the files and metadata into a wheel.

This approach would mean that system integrators and build frontends could install coherent projects from source with nothing but flit-core.

PEP 621 provides a way to provide the metadata (entry points and such).

I'm not sure what PEP 517 has to say about this approach. In particular, would implementing this mean that the project would implementing building sdists, editable wheels, and metadata, but not wheels?

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

1 participant