[Distutils] PEP 517 again
thomas at kluyver.me.uk
Fri Aug 25 17:21:58 EDT 2017
On Fri, Aug 25, 2017, at 10:02 PM, xoviat wrote:
> While we're waiting for others to respond, what are we going to do
> with respect to the sys.path issue? I don't think there has been
> discussion on that yet.
I'm more or less persuaded by Nathaniel's argument that the source
directory shouldn't be on sys.path, because:
- Most projects won't need it to be
- There are plausible ways it could go wrong
- I think we could make a backend which loads the real hooks from the
source dir, so there's a backdoor for projects that do want it.
IIRC, however, Nick was still strongly in favour of including the source
directory on sys.path, and he can usually persuade me of his position
with a few emails. I do think that behaviour is more like the 'obvious
thing' that Python programmers would expect.
> - removing srcdir from sys.path requires explicitly removing "" from
> the head of sys.path, which is not normally done.
Not necessarily. If the hook process is launched with a script at the
command line, it is the script directory, not the cwd, that is added to
sys.path. My WIP hook-calling module works this way:https://github.com/takluyver/pep517/blob/ee43a9334c377d7c37badcc8527cb7a8500180f7/pep517/wrappers.py#L75
With this code, we would actually need to explicitly *add* the source
directory (CWD) to sys.path before importing the hook.
> - it would break many setuptools based projects, probably forcing the
> setuptools backend to reinsert it, defeating the purpose of removing
> it in the first place.
I don't think we should decide this based on what setuptools does; I
expect it to need quite a bit of special handling in any case.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Distutils-SIG