[Import-SIG] Do we really need to read .pth files in PEP 382?
Barry Warsaw
barry at python.org
Fri Jun 24 23:07:58 CEST 2011
On Jun 24, 2011, at 07:48 PM, Martin v. Löwis wrote:
>In any case, the motivation for using .pth files in PEP 382
>was that I considered a natural extension to the mechanism that
>was already there.
Except, they're not really an extension, but more of a narrowing of the
current conventions (i.e. they don't support `import` lines).
>The use case I could imagine is what I think was the original use
>case for .pth files as well: allow users to contribute their own
>stuff to a package without having to modify a central location. The
>sysadmin could create a writable file /usr/lib/python.../zope/pje.pth,
>and you could then add stuff to the zope package without having write
>access to its package folder.
>
>> If we separate the "this is a namespace" funtionality from "here are
>> paths" functionality, ISTM that the "here are paths" functionality is
>> already adequately met by the existing .pth machinery.
>
>I agree that it would simplify the PEP to not have to look into the
>contents of a .pth file. Before discussing what the implementation
>would look like exactly, I'd rather first establish whether there
>is agreement to drop the feature.
>
>So: anybody opposed to not being able to specify the path of a package
>in a declarative manner?
I'm not opposed to dropping this feature.
>P.S. FWIW, my approach to a checkmark for namespace-ness of a directory
>would be to have a directory name extension, say .ns or .py, indicating
>that this directory is a namespaced Python package - that would drop
>the need for special files at all (I actually think I'd prefer .py over
>.ns, despite the risk for confusion with Python source files).
I agree with PJE's follow up on favoring flag files over special directory
names. I'd like for the flag files to be named something other than .pth
though. .ns seems fine to me and doesn't have any obvious collisions:
http://en.wikipedia.org/wiki/List_of_file_formats_(alphabetical)#N
Cheers,
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/import-sig/attachments/20110624/05d7bb5d/attachment-0001.pgp>
More information about the Import-SIG
mailing list