Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 531648 - dev-lang/python should not install /usr/lib*/python*/test/
Summary: dev-lang/python should not install /usr/lib*/python*/test/
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
: 574322 650336 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-12-04 10:37 UTC by Patrick Lauer
Modified: 2024-02-02 16:44 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Lauer gentoo-dev 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 gentoo-dev 2014-12-04 15:44:29 UTC
Upstream installs them. If you don't want them, use INSTALL_MASK.
Comment 2 Mike Gilbert gentoo-dev 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 gentoo-dev 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 archtester Gentoo Infrastructure gentoo-dev Security 2014-12-10 23:00:40 UTC
I'd say this is a case for INSTALL_MASK.
Comment 6 Mike Gilbert gentoo-dev 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 archtester Gentoo Infrastructure gentoo-dev Security 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.
Comment 9 Arfrever Frehtes Taifersar Arahesis 2018-03-13 00:15:12 UTC
*** Bug 650336 has been marked as a duplicate of this bug. ***