Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 380275 - dev-python/pytest-2.0.3 tries to install .pyc files if built with tests enabled
Summary: dev-python/pytest-2.0.3 tries to install .pyc files if built with tests enabled
Status: RESOLVED FIXED
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:
Depends on:
Blocks:
 
Reported: 2011-08-22 19:35 UTC by David Leverton
Modified: 2011-09-11 04:42 UTC (History)
0 users

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


Attachments
pytest-2.0.3.ebuild.patch (pytest-2.0.3.ebuild.patch,339 bytes, text/plain)
2011-08-22 19:35 UTC, David Leverton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Leverton 2011-08-22 19:35:32 UTC
Created attachment 284243 [details]
pytest-2.0.3.ebuild.patch

The file pytest-2.0.3/testing/acceptance_test.py, in the function test_cmdline_python_package, does

        monkeypatch.delenv('PYTHONDONTWRITEBYTECODE', False)

and then runs Python on its own to-be-installed modules.  This causes .pyc files to be written in pytest-2.0.3/build-*/lib, which then get installed.  If pytest was previously installed without running tests, this can cause collision errors with the .pyc files that were written by python_mod_optimize from python.eclass.

The most straightforward way to fix this would appear to be python_clean_installation_image, as in the attached patch, although it generates a load of ewarns which might not be desirable.
Comment 1 David Leverton 2011-08-22 20:34:44 UTC
(In reply to comment #0)
> The most straightforward way to fix this would appear to be
> python_clean_installation_image, as in the attached patch, although it
> generates a load of ewarns which might not be desirable.

Just noticed that python_clean_installation_image has a --quiet option, so I suppose that would be the thing to use.
Comment 2 Mike Gilbert gentoo-dev 2011-09-11 04:42:17 UTC
+*pytest-2.1.1 (11 Sep 2011)
+
+  11 Sep 2011; Mike Gilbert <floppym@gentoo.org> +pytest-2.1.1.ebuild:
+  Version bump. Clean out pyc files; bug 380275. Thanks to David Leverton for
+  the suggestion.
+