|Summary:||dev-lang/python should not install /usr/lib*/python*/test/|
|Product:||Gentoo Linux||Reporter:||Patrick Lauer <patrick>|
|Component:||[OLD] Development||Assignee:||Python Gentoo Team <python>|
|Severity:||normal||CC:||alexander, chewi, dev.rindeal+gentoo, gentoo, joakim.tjernlund, mgorny|
|Package list:||Runtime testing required:||---|
Description Patrick Lauer 2014-12-04 10:37:09 UTC
# du -h /usr/lib64/python2.7/test/ 28M /usr/lib64/python2.7/test/ * dev-lang/python-2.7.7 Total files : 4057 Total size : 56.68 MiB So about half the installed size are the python unit tests that no one uses and which are only relevant at install time. Not installing (unconditionally, or with use=-test) would halve the installed size for great benefit.
Comment 1 Mike Gilbert 2014-12-04 15:44:29 UTC
Upstream installs them. If you don't want them, use INSTALL_MASK.
Comment 2 Mike Gilbert 2014-12-04 17:21:03 UTC
Hmm... I see other distros package the test suite separately. So I guess a use flag would not be too abnormal here.
Comment 3 Johan Bergström 2014-12-10 04:37:52 UTC
I'd also like to see test suites go away. This should be documented somewhere since its pretty common for test folders to be installed for setuptools/pip packages as well.
Comment 4 Mike Gilbert 2014-12-10 16:40:09 UTC
(In reply to Johan Bergström from comment #3) > I'd also like to see test suites go away. This should be documented > somewhere since its pretty common for test folders to be installed for > setuptools/pip packages as well. Agreed. If we are going to remove tests, we should come up with a consistent policy for it. This would include: - A consistently named use flag - A code snippet on the wiki Personally, I would prefer to keep installing tests unconditionally, but if I'm out-voted it is no great bother to me.
Comment 5 Michał Górny 2014-12-10 23:00:40 UTC
I'd say this is a case for INSTALL_MASK.
Comment 6 Mike Gilbert 2015-01-18 02:03:39 UTC
A note on implementing this for dev-lang/python: The test.support module gets used in the test suites for lib2to3, idlelib, and distutils. These are installed outside of the python/test/ directory. Also, it looks like some the tests of some third-party packages import test.support. For example: site-packages/simplejson/tests/test_tool.py: from test.support import strip_python_stderr site-packages/bsddb3/tests/test_all.py: from test import test_support So, we would probably need to install the test.support module to avoid breaking src_test in a few python-related ebuilds.
Comment 7 Michał Górny 2016-02-10 12:11:22 UTC
*** Bug 574322 has been marked as a duplicate of this bug. ***
Comment 8 . 2016-05-18 16:41:22 UTC
(In reply to Mike Gilbert from comment #6) > A note on implementing this for dev-lang/python: > > The test.support module gets used in the test suites for lib2to3, idlelib, > and distutils. These are installed outside of the python/test/ directory. > > Also, it looks like some the tests of some third-party packages import > test.support. For example: > > site-packages/simplejson/tests/test_tool.py: from test.support import > strip_python_stderr > site-packages/bsddb3/tests/test_all.py: from test import test_support > > > So, we would probably need to install the test.support module to avoid > breaking src_test in a few python-related ebuilds. test directory is only for people who do testing. People who do testing, have `test` USE-flag set. So I think python: ``` use test || rm -rf .... ``` and dev-python/simplejson: ``` PYTHON_REQ_USE="test=" ``` would solve this case.