On 29 July 2017 at 18:47, Paul Moore <p.f.moore@gmail.com> wrote:
On 29 July 2017 at 00:07, Nathaniel Smith <njs@pobox.com> wrote:
Given how much trouble we're having with PEP 517 already, it might make more sense to have PEP 517 just mandate that the directory not be on sys.path, and make a little follow-up PEP just for python-path.
Or we just document that sys.path will contain the project root, and keep it simple but flexible. A follow-up PEP could add a pyproject.toml setting that *overrides* this default at a later date, if the need was found compelling enough.
+1 from me on just adding the project root to sys.path.
It's also *much* easier for backends to remove things from sys.path than it is to add them, so this option makes the most sense to me. If folks including custom build backends directly with their projects decide they don't like the resulting top level clutter, then they have some clear options for resolving that: 1. Move it inside a tools package, not just a tools directory: [build-system] build-backend = "tools.my_custom_backend" # refers to tools/my_custom_backend.py For Py3 only projects, that approach doesn't even need a tools/__init__.py file. 2. migrate their custom backend out to a separately installable component that reads per-project config settings from pyproject.toml. For the latter case, it would even be possible for someone that was so inclined to write a meta-backend that delegated to an in-repo backend stored somewhere other than the repository root: [tools.py_build_hooks] python-path = "tools" build-backend = "my_custom_backend" Either way, the python-path setting qualifies as "not necessary" in the base PEP. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia