summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorClaudia Pellegrino2022-08-22 13:10:42 +0200
committerClaudia Pellegrino2022-08-22 13:10:42 +0200
commitd6b7d273c35d75c3751aa07260c12da41927824a (patch)
tree6d06a3cfdf4281072261a042817bb27cbb839f76 /PKGBUILD
parent217dcb7a7cff2830b070fe85159b1304f235b204 (diff)
downloadaur-d6b7d273c35d75c3751aa07260c12da41927824a.tar.gz
Keep .pyc files
According to the wiki, the preferred way to package a Python artifact is to build a wheel. [1] This basically produces a tree of .py files with a bit of metadata, ready to use. Intermingled with those .py files, it also produces a __pycache__ directory containing .pyc files. The documentation says that those contain Python bytecode, which in turn is tightly coupled to the specific VM that was used to produce them [2]. In other words, Python bytecode is architecture-independent, but effectively tied to a specific version of the Python runtime, for example 3.10. [3] Keep the .pyc files because: 1. According to The Arch Way, things should be simple. The simplest thing to do is to not care about .pyc files, and just leave them in, just like upstream does. 2. Installing a wheel to a `pkgdir` already ties the package to a specific Python version anyway, for example due to the fact that the `site-packages` hierarchy is version-specific. So the .pyc files are safe to use, regardless of architecture. 3. For most AUR users, the target architecture is identical to the build architecture. [1]: https://wiki.archlinux.org/title/Python_package_guidelines#Standards_based_(PEP_517) [2]: https://docs.python.org/3/glossary.html#term-bytecode [3]: https://stackoverflow.com/q/7807541
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD7
1 files changed, 2 insertions, 5 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 17f8b679f3cc..c2a970cae78f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -48,9 +48,6 @@ build() {
package() {
cd "${srcdir}/${_gitpkgname}"
- python -I -X pycache_prefix=pycache -m installer \
- --destdir="${pkgdir}" dist/*.whl
- rm -rf pycache
- install -D -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" \
- LICENSE
+ python -I -m installer --destdir="${pkgdir}" dist/*.whl
+ install -D -m 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
}