Don't clutter /usr/lib/python2.7/site-packages/
Closed, DeclinedPublic

Description

Author: yardenack

Description:
It's reasonable to expect setup.py to install things in this directory:

/usr/lib/python2.7/site-packages/pywikibot/

But it's not reasonable for it to also put things in these directories:

/usr/lib/python2.7/site-packages/externals/
/usr/lib/python2.7/site-packages/scripts/
/usr/lib/python2.7/site-packages/tests/

What if every python project tried to do that?


Version: core-(2.0)
Severity: normal
OS: Linux
URL: https://github.com/yardenac/pkgbuilds/blob/master/packages/python2-pywikibot-git/

bzimport added a project: Pywikibot-General.Via ConduitNov 22 2014, 2:25 AM
bzimport added a subscriber: Unknown Object (????).
bzimport set Reference to bz55584.
bzimport created this task.Via LegacyOct 10 2013, 7:58 PM
valhallasw added a comment.Via ConduitOct 10 2013, 8:04 PM

Setting packages=['pywikibot'],
in setup.py does not seem to solve this.

Simple way to reproduce:

valhallasw@lisilwen:~/src/pwb/pywikibot-core$ virtualenv test
New python executable in test/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.
valhallasw@lisilwen:~/src/pwb/pywikibot-core$ source test/bin/activate
valhallasw@lisilwen:~/src/pwb/pywikibot-core$ python setup.py install
(...)
(test)valhallasw@lisilwen:~/src/pwb/pywikibot-core$ ls -l test/lib/python2.7/site-packages/
total 40
drwxrwxr-x 4 valhallasw valhallasw 4096 Oct 10 22:03 distribute-0.6.24-py2.7.egg
-rw-rw-r-- 1 valhallasw valhallasw 235 Oct 10 22:03 easy-install.pth
drwxrwxr-x 3 valhallasw valhallasw 4096 Oct 10 22:04 externals
drwxrwxr-x 4 valhallasw valhallasw 4096 Oct 10 22:03 pip-1.1-py2.7.egg
drwxrwxr-x 7 valhallasw valhallasw 4096 Oct 10 22:04 pywikibot
drwxrwxr-x 2 valhallasw valhallasw 4096 Oct 10 22:04 Pywikipediabot-2.0b1-py2.7.egg-info
drwxrwxr-x 2 valhallasw valhallasw 4096 Oct 10 22:04 Pywikipediabot.egg-info
drwxrwxr-x 3 valhallasw valhallasw 4096 Oct 10 22:04 scripts
-rw-rw-r-- 1 valhallasw valhallasw 30 Oct 10 22:03 setuptools.pth
drwxrwxr-x 6 valhallasw valhallasw 4096 Oct 10 22:04 tests

gerritbot added a comment.Via ConduitDec 15 2013, 4:17 PM

Change 101661 had a related patch set uploaded by Merlijn van Deen:
(bug 55584) only install pywikibot.*

https://gerrit.wikimedia.org/r/101661

gerritbot added a comment.Via ConduitDec 17 2013, 11:02 AM

Change 101661 merged by jenkins-bot:
(bug 55584) only install pywikibot.*

https://gerrit.wikimedia.org/r/101661

bzimport added a comment.Via ConduitDec 31 2013, 7:57 AM

yardenack wrote:

Thanks, I'm trying again with commit b7bff6b. It is no longer installing those exact files but now it seems to install these, which are inappropriate for the same reason:

/usr/lib/python2.7/site-packages/easy-install.pth
/usr/lib/python2.7/site-packages/site.py
/usr/lib/python2.7/site-packages/site.pyc
/usr/lib/python2.7/site-packages/site.pyo

Should I open a new bug? I think this pretty much falls within the same scope.

valhallasw added a comment.Via ConduitDec 31 2013, 9:37 AM

I'm not sure -- it sounds like Setuptools installing itself to me (at least easy-install.pth is from Setuptools, and I think the site.py makes sure .egg's work.

Are you building on a system that has a recent-enough (2.0+) version of Setuptools installed? That might cause this, I think. It's not (or should not be) a runtime dependency, though.

Also, maybe you should use

python setup.py build

instead of

python setup.py install

as the latter is supposed to install dependencies, while the former just builds the set of files from to install.

jayvdb added a comment.Via ConduitJul 25 2014, 11:36 AM

setup.py install places all files in the following directory on my workstation.

/usr/lib/python2.7/site-packages/pywikibot-2.0b1-py2.7.egg

If you are still seeing files places in site-packages, please re-open and indicate which version of python and setuptools you are using.

Aklapper added a project: pywikibot-core.Via WebNov 27 2014, 4:16 PM

Add Comment