-
Notifications
You must be signed in to change notification settings - Fork 0
Description
This issue aims to point out problems resulting from not adhering to PEP 517/518, that is storing a minimal pyproject.toml file in every Coherent project:
[build-system]
requires = ['coherent.build']
build-backend = 'coherent.build'At the moment, this file is only supplied temporarily in certain contexts and coherent.build has full control over its lifespan. I am thinking this isn't the most optimal approach, because:
- Coherent projects aren't universally identifiable—there is no official way of identifying what projects use the essential layout. Since that layout is inseparably tied to
coherent.build, it would be easy to figure that out by looking intobuild-system.build-backend. I think that assuming the presence of__init__.pyor__main__.pyis slightly short-sighted: this definitely isn't the essential layout. - Coherent projects don't play well with the existing installers—
coh installmakes assumptions about the preferred way of installing a project. I personally like to develop using virtual environments and that is one of the most popular practices, enabling inline hints and more. It should be possible to simply install Coherent projects using whatever method preferred: for instance, I want to develop 3 coherent projects in my super directory using editable installs. - Coherent projects aren't detected by third-party software as Python packages—while it could often be easily done just by seeing
.pyfiles in the root directory, this is often short-sighted too and might not be enough to prove a directory constituing a standalone package. For that reason Starship looks for specific files, withpyproject.tomlbeing the common part of two enablers (https://starship.rs/config/#package-version, https://starship.rs/config/#python).
While the idea of temporarily supplying pyproject.toml allows to save some boilerplate, I still do think it comes with much more caveats than benefits. I'd like to suggest every Coherent project has a pyproject.toml so that it is just easier to work with.
Now that poses some questions, what about (meta)/. If we statically keep pyproject.toml for every Coherent project, shouldn't we rather let others customize ancillary details inside pyproject.toml and then, optionally, in (meta)/?
Personally, I think that it would mean even easier migration to the Coherent System from flat/src layouts.
- Update docs to reflect initialization steps.
- (optional) Create a routine to initialize a repo with the boilerplate.
- Apply changes to existing coherent projects (
coherent.*,tempora@experiment/coherent).