Discussion:
[PEAK] setuptools: add .pth file to site-packages automatically
Maxim Yaskevich
2014-01-08 11:47:32 UTC
Permalink
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<http://pythonhosted.org/setuptools/formats.html#installation-and-path-management-issues>
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


--
Best regards,
Maxim Yaskevich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.eby-sarna.com/pipermail/peak/attachments/20140108/10ca742a/attachment.html
PJ Eby
2014-01-11 23:20:37 UTC
Permalink
On Wed, Jan 8, 2014 at 5:22 AM, Maxim Yaskevich
Post by Maxim Yaskevich
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. ;-)

Loading...