Closed jaraco closed 2 weeks ago
I've started investigating how this might work. After reviewing the editables project, I can see how the RedirectingFinder might be re-usable for this project's purposes. In fact, it seems to work great for simple, top-level packages. For namespace packages, however, it doesn't work, as there's no target for the top-level (namespace) package to redirect to (e.g. no place for the package coherent
to point), so I've started work on adding such support.
PEP 660 describes a protocol for a build backend to implement an editable install.
I'd like for
coherent.build
to implement such a hook.Note that the
editables
andsetuptools
projects implement this PEP, but neither in a way thatcoherent.build
can. Becausecoherent.build
is based on the essential layout, there's no good root to link into site-packages (or to add to sys.path) to make imports possible.Instead, we'll need to devise another technique to make the name of the project visible to the import system.
The PEP describes what to put in the wheel, including mentioning that editables uses the "proxy module" technique. I'm thinking that proxy module technique could be used for the "essential layout" as well. An example wheel might contain:
Where
build.py
is a proxy module to the package at the repo root. It's possible that proxy module will need to instead becoherent/build/__init__.py
.It may be desirable to adapt or extend the
editables
project to implement the hook or maybe not.Out of scope is to actually support installation. There's a known issue where projects under the Coherent Software Development System aren't installable by pip. You can test the viability by
cp system.toml pyproject.toml
and thenpip install -e
that.