From b6a82e6a6010c1ec9f983c95af6a625b6eb6c23a Mon Sep 17 00:00:00 2001 From: Tibbs Date: Sep 08 2018 17:04:19 +0000 Subject: Writeup of https://pagure.io/packaging-committee/issue/782 --- diff --git a/Packaging:Python.mw b/Packaging:Python.mw index 987c2c1..1647264 100644 --- a/Packaging:Python.mw +++ b/Packaging:Python.mw @@ -205,12 +205,20 @@ Use of the macros has several benefits: == Files to include == When packaging python modules, several types of files are included: * *.py source files because they are used when generating tracebacks. -* *.pyc and *.pyo byte compiled files (and, if present, the enclosing __pycache__ directory in most cases). +* *.pyc and *.pyo byte compiled files. ** Python will try to create them at runtime if they don't exist which leads to spurious SELinux AVC denials in the logs. ** If the system administrator invokes python with -OO, .pyos will be created with no docstrings. This can break some programs. * *.egg-info files or directories. If these are generated by the module's build scripts they must be included in the package because they might be needed by other applications and modules at runtime. -The source files must be included in the same package as the byte compiled versions. +The source files MUST be included in the same package as the byte compiled versions. + +Packagers SHOULD NOT simply glob everything under the sitelib or sitearch directories. The following SHOULD NOT be used: +* %{python2_sitelib}/* +* %{python2_sitearch}/* +* %{python3_sitelib}/* + +And packages MUST NOT include the __pycache__ directory (see below), so the following MUST NOT be used: +* %{python3_sitearch}/* == Byte compiling ==