Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 703104 - dev-python/importlib_resources-1.0.2-r1: non-byte-compiled modules
Summary: dev-python/importlib_resources-1.0.2-r1: non-byte-compiled modules
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ralph Seichter
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2019-12-16 14:18 UTC by Michał Górny
Modified: 2020-02-27 11:31 UTC (History)
3 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-12-16 14:18:40 UTC
* 
 * This package installs one or more Python modules that are not byte-compiled.
 * The following files are missing:
 * 
 *   /usr/lib/pypy2.7/site-packages/importlib_resources/_py3.pyc
 *   /usr/lib64/python2.7/site-packages/importlib_resources/_py3.pyc
 *   /usr/lib64/python2.7/site-packages/importlib_resources/_py3.pyo
 * 
 * Please either fix the upstream build system to byte-compile Python modules
 * correctly, or call python_optimize after installing them.  For more
 * information, see:
 * https://wiki.gentoo.org/wiki/Project:Python/Byte_compiling
Comment 1 Ralph Seichter 2019-12-16 19:25:42 UTC
Here's what happens when I try to byte-compile manually:

$ python2.7 setup.py build
$ python2.7 -m compileall build/
Listing build/ ...
Listing build/lib ...
Listing build/lib/importlib_resources ...
Compiling build/lib/importlib_resources/__init__.py ...
Compiling build/lib/importlib_resources/_compat.py ...
Compiling build/lib/importlib_resources/_py2.py ...
Compiling build/lib/importlib_resources/_py3.py ...
  File "build/lib/importlib_resources/_py3.py", line 25
    def _get_package(package) -> ModuleType:
                              ^
SyntaxError: invalid syntax

Given that Python 2.7's compileall is unable to process _py3.py, I am not sure this can be considered a bug of the dev-python/importlib_resources ebuild.
Comment 2 Ralph Seichter 2020-02-22 17:40:27 UTC
@mgorny: Can you please change the assignee for this bug? It just keeps getting older, and I am not the right person.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-02-22 18:14:27 UTC
Strip extraneous files in python_compile().  See latest jinja version on how to do it.
Comment 4 Larry the Git Cow gentoo-dev 2020-02-27 11:31:31 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f865890c6c177bf9fc0f2143af671a4a602e6be9

commit f865890c6c177bf9fc0f2143af671a4a602e6be9
Author:     Ralph Seichter <github@seichter.de>
AuthorDate: 2020-02-23 14:13:31 +0000
Commit:     Louis Sautier <sbraz@gentoo.org>
CommitDate: 2020-02-27 11:31:07 +0000

    dev-python/importlib_resources: fix byte-compilation, misc. changes
    
    * Resolve QA warnings regarding Python byte-compilation.
    * Use distutils_enable_* functions for doc and tests.
    
    Closes: https://bugs.gentoo.org/703104
    Package-Manager: Portage-2.3.84, Repoman-2.3.20
    Signed-off-by: Ralph Seichter <gentoo@seichter.de>
    Closes: https://github.com/gentoo/gentoo/pull/14753
    Signed-off-by: Louis Sautier <sbraz@gentoo.org>

 .../importlib_resources-1.0.2-r2.ebuild            | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)