[PEAK] setuptools: add .pth file to site-packages automatically

PJ Eby pje at telecommunity.com
Sat Jan 11 17:20:08 EST 2014


On Wed, Jan 8, 2014 at 5:22 AM, Maxim Yaskevich
<yaskevichmaxim at gmail.com> wrote:
> Hi.
>
> I'm wondering about how a user could add package's .pth file into system
> `site-packages` directory without having write access to it.
>
> Setuptools documentation says there is a workaroung for this problem, but I
> don't really get it.
>
> Is it possible to have the foobar.pth file copied to site-packages dir
> automatically with python setup.py install command?
>
> src/
>   foobar/...
>   foobar.pth
>   setup.py
>

No.  Setuptools generates and installs various .pth files in order to
support namespace packages and to put eggs on sys.path, but it does
not support package-supplied .pth files, and you should probably not
be using them anyway.  Most use cases for .pth files are properly
handled by laying out your package correctly in the first place, or by
using namespace packages.  All other uses of .pth files are pretty
much either esoteric, deprecated, or both.  ;-)


More information about the PEAK mailing list