diff options
-rw-r--r-- | app-portage/pycargoebuild/Manifest | 1 | ||||
-rw-r--r-- | app-portage/pycargoebuild/pycargoebuild-0.13.1.ebuild | 32 | ||||
-rw-r--r-- | dev-python/pythran/Manifest | 1 | ||||
-rw-r--r-- | dev-python/pythran/pythran-0.15.0.ebuild | 72 | ||||
-rw-r--r-- | eclass/verify-sig.eclass | 18 | ||||
-rw-r--r-- | metadata/install-qa-check.d/60python-pyc | 125 | ||||
-rw-r--r-- | metadata/install-qa-check.d/60python-site | 253 |
7 files changed, 365 insertions, 137 deletions
diff --git a/app-portage/pycargoebuild/Manifest b/app-portage/pycargoebuild/Manifest index 7ba66dc0fdf6..cd3547c9bb99 100644 --- a/app-portage/pycargoebuild/Manifest +++ b/app-portage/pycargoebuild/Manifest @@ -1,2 +1,3 @@ DIST pycargoebuild-0.12.1.gh.tar.gz 38957 BLAKE2B e20d739ec1e413acef66b50d959dd7b72abcbb3d729381961415004f529e602ac0c4964747aa13e80759f959068bd01af73fbf5953e51ae54dd8d40d6c4f97af SHA512 52e1cca03e3862339629af3688f8d2cf29ad7caf4dc5acf58360db8755ec4844e664425156f3ebd93e2fb1c4b1d4d1ee4a3b2ee41d1766290986a2a3f992fa38 DIST pycargoebuild-0.13.0.gh.tar.gz 39250 BLAKE2B de03ab08cd4288f86e87b8e910fcfb24312cecf5d3642c74c2fa4ad8a5699d988e0046c95d5ff3da02eb503f88ded376cf20d0808f46b9b7aceb7d6ce359a98a SHA512 00e5dee77a02384b861a7455e9c6ecd0a546a0a8a61f5e56ad665fee582a2c772410607995c679bff92bd92704118631c0f89feeb2a3b661b7a07d94be1b4711 +DIST pycargoebuild-0.13.1.gh.tar.gz 40724 BLAKE2B 8332def693da15fa5bf76e36defc92d6be9ebb78f5f58763f1df0a3f5d03d24bcd3d467ef8e23fbbedf6cadffbdc61898d7d9d9a455f30a820b261398868f2cf SHA512 4a3eb0c703008a3ba226de24c7c5f444b1c9dee08def473b03e03112ad8f5d8d620f1d12e528c73c98fa46d2a18658a1f3862ac547ca1121e7834cd1c4ab65d0 diff --git a/app-portage/pycargoebuild/pycargoebuild-0.13.1.ebuild b/app-portage/pycargoebuild/pycargoebuild-0.13.1.ebuild new file mode 100644 index 000000000000..a9cae3c559fb --- /dev/null +++ b/app-portage/pycargoebuild/pycargoebuild-0.13.1.ebuild @@ -0,0 +1,32 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=flit +PYTHON_COMPAT=( python3_{10..12} pypy3 ) + +inherit distutils-r1 + +DESCRIPTION="A generator for Rust/Cargo ebuilds written in Python" +HOMEPAGE=" + https://github.com/projg2/pycargoebuild/ + https://pypi.org/project/pycargoebuild/ +" +SRC_URI=" + https://github.com/projg2/pycargoebuild/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~loong ~ppc64" + +RDEPEND=" + dev-python/license-expression[${PYTHON_USEDEP}] + $(python_gen_cond_dep ' + dev-python/tomli[${PYTHON_USEDEP}] + ' 3.9 3.10) +" + +distutils_enable_tests pytest diff --git a/dev-python/pythran/Manifest b/dev-python/pythran/Manifest index aaf6b8fdadef..0fa5dbdcbe7c 100644 --- a/dev-python/pythran/Manifest +++ b/dev-python/pythran/Manifest @@ -1,2 +1,3 @@ DIST pythran-0.13.1.gh.tar.gz 3639196 BLAKE2B 8aba73c68542d69dd2287d7081226161ecade9e49fe6ea69d034f9116becbc148614212cbcff0056291809d2994caf43ee374393939e44635c6bed69220b29b8 SHA512 2497fa49d78ff64e577816f4b48bd424c03f04b7605c92d359f0f8514aaa67b30b7e68248db475c215deafaf7e55f7b4b74ab37c9dbef2a27e813878bf350e77 DIST pythran-0.14.0.gh.tar.gz 3642431 BLAKE2B cd5eeca0c52b0c3d17862b38c176b435a63a1f399e66979b8ac2682625cd0b0e074265e79bfdb6e57db989633954266132752e9b50c601ff43ae5c17c3e34bf5 SHA512 2a485c00b015abafc9ded28bfea8d8a7ae3ce87b5b654c318d5514fe12fd9374b599c05e3c4a2ff911fbae84df2efaa3cec2019c91e82ac1f36e0cc5ddeb2d8e +DIST pythran-0.15.0.gh.tar.gz 3676474 BLAKE2B 2b9c08d773f7848cf43c804ffa9a84eb19d20dbc40668657daea9698fb468e62ec86226f39aa3b8ff07b48a3120604b44a9d6a6c9e7f2b5f0f41ba2e9a201231 SHA512 2abba0ab5328e60d622512aa6c5442fcc28edb4da4209db50ede64961b58c91c2109b7bb90e5872c5c0d487542f669dc2ca3e721c28229e283f6e0130f95aee0 diff --git a/dev-python/pythran/pythran-0.15.0.ebuild b/dev-python/pythran/pythran-0.15.0.ebuild new file mode 100644 index 000000000000..fcab910cab02 --- /dev/null +++ b/dev-python/pythran/pythran-0.15.0.ebuild @@ -0,0 +1,72 @@ +# Copyright 2021-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_TESTED=( pypy3 python3_{10..12} ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" ) + +inherit distutils-r1 + +MY_P=${P/_p/.post} +DESCRIPTION="Ahead of Time compiler for numeric kernels" +HOMEPAGE=" + https://pypi.org/project/pythran/ + https://github.com/serge-sans-paille/pythran/ +" +SRC_URI=" + https://github.com/serge-sans-paille/pythran/archive/${PV/_p/.post}.tar.gz + -> ${MY_P}.gh.tar.gz +" +S=${WORKDIR}/${MY_P} + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + +RDEPEND=" + dev-libs/boost + =dev-python/beniget-0.4*[${PYTHON_USEDEP}] + =dev-python/gast-0.5*[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] + >=dev-python/ply-3.4[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] +" +DEPEND=" + dev-libs/boost + dev-cpp/xsimd +" +BDEPEND=" + test? ( + $(python_gen_cond_dep ' + dev-python/ipython[${PYTHON_USEDEP}] + dev-python/pip[${PYTHON_USEDEP}] + dev-python/scipy[${PYTHON_USEDEP}] + ' "${PYTHON_TESTED[@]}") + dev-python/wheel[${PYTHON_USEDEP}] + virtual/cblas + !!dev-python/setuptools-declarative-requirements + ) +" + +EPYTEST_XDIST=1 +distutils_enable_tests pytest + +src_configure() { + # sigh + rm -r pythran/{boost,xsimd} || die + + if use test ; then + sed -i \ + -e 's|blas=blas|blas=cblas|' \ + -e 's|libs=|libs=cblas|' \ + pythran/pythran-*.cfg || die + fi +} + +python_test() { + local -x COLUMNS=80 + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest +} diff --git a/eclass/verify-sig.eclass b/eclass/verify-sig.eclass index d5f71669538e..b74ed78290aa 100644 --- a/eclass/verify-sig.eclass +++ b/eclass/verify-sig.eclass @@ -1,4 +1,4 @@ -# Copyright 2020-2023 Gentoo Authors +# Copyright 2020-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: verify-sig.eclass @@ -68,7 +68,7 @@ case ${VERIFY_SIG_METHOD} in BDEPEND=" verify-sig? ( app-crypt/gnupg - >=app-portage/gemato-16 + >=app-portage/gemato-20 ) " ;; @@ -159,16 +159,10 @@ verify-sig_verify_detached() { # gpg can't handle very long TMPDIR # https://bugs.gentoo.org/854492 local -x TMPDIR=/tmp - if has_version ">=app-portage/gemato-20"; then - gemato openpgp-verify-detached -K "${key}" \ - "${extra_args[@]}" \ - "${sig}" "${file}" || - die "PGP signature verification failed" - else - gemato gpg-wrap -K "${key}" "${extra_args[@]}" -- \ - gpg --verify "${sig}" "${file}" || - die "PGP signature verification failed" - fi + gemato openpgp-verify-detached -K "${key}" \ + "${extra_args[@]}" --no-require-all-good \ + "${sig}" "${file}" || + die "PGP signature verification failed" ;; signify) signify -V -p "${key}" -m "${file}" -x "${sig}" || diff --git a/metadata/install-qa-check.d/60python-pyc b/metadata/install-qa-check.d/60python-pyc deleted file mode 100644 index fe4f3f62c4ef..000000000000 --- a/metadata/install-qa-check.d/60python-pyc +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright 2019-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# QA check: ensure that Python modules are compiled after installing -# Maintainer: Python project <python@gentoo.org> - -python_pyc_check() { - local save=$(shopt -p nullglob) - shopt -s nullglob - local progs=( "${EPREFIX}"/usr/lib/python-exec/*/gpep517 ) - ${save} - - local invalid=() - local mismatched_timestamp=() - local mismatched_data=() - local missing=() - local stray=() - - # Avoid running the check if sufficiently new gpep517 is not installed - # yet. It's valid to schedule (for merge order) >=gpep517-8 after - # packages which have this check run if they don't use distutils-r1. - if [[ ${EAPI} == [0123] ]] || ! nonfatal has_version ">=dev-python/gpep517-8" ; then - return - fi - - for prog in "${progs[@]}"; do - local impl=${prog%/*} - impl=${impl##*/} - - # NB: using ${impl}* to catch pypy3.* for pypy3 - [[ -d "${ED}"/usr/lib/${impl}*/site-packages ]] || continue - - einfo "Verifying compiled files for ${impl}" - local kind pyc py - while IFS=: read -r kind pyc py extra; do - case ${kind} in - invalid) - invalid+=( "${pyc}" ) - ;; - mismatched) - case ${extra} in - timestamp) - mismatched_timestamp+=( "${pyc}" ) - ;; - *) - mismatched_data+=( "${pyc}" ) - ;; - esac - ;; - missing) - missing+=( "${pyc}" ) - ;; - older) - # older warnings were produced by earlier version - # of gpep517 but the check was incorrect, so we just - # ignore them - ;; - stray) - stray+=( "${pyc}" ) - ;; - esac - done < <("${prog}" verify-pyc --destdir "${D}" --prefix "${EPREFIX}"/usr) - done - - local found= - if [[ ${missing[@]} ]]; then - eqawarn - eqawarn "QA Notice: This package installs one or more Python modules that are" - eqawarn "not byte-compiled." - eqawarn "The following files are missing:" - eqawarn - eqatag -v python-pyc.missing "${missing[@]}" - found=1 - fi - - if [[ ${invalid[@]} ]]; then - eqawarn - eqawarn "QA Notice: This package installs one or more compiled Python modules" - eqawarn "that seem to be invalid (do not have the correct header)." - eqawarn "The following files are invalid:" - eqawarn - eqatag -v python-pyc.invalid "${invalid[@]}" - found=1 - fi - - if [[ ${mismatched_data[@]} ]]; then - eqawarn - eqawarn "QA Notice: This package installs one or more compiled Python modules whose" - eqawarn ".py files have different content (size or hash) than recorded:" - eqawarn - eqatag -v python-pyc.mismatched.data "${mismatched_data[@]}" - found=1 - fi - - if [[ ${mismatched_timestamp[@]} ]]; then - eqawarn - eqawarn "QA Notice: This package installs one or more compiled Python modules whose" - eqawarn ".py files have different timestamps than recorded:" - eqawarn - eqatag -v python-pyc.mismatched.timestamp "${mismatched_timestamp[@]}" - found=1 - fi - - if [[ ${stray[@]} ]]; then - eqawarn - eqawarn "QA Notice: This package installs one or more compiled Python modules" - eqawarn "that do not match installed modules (or their implementation)." - eqawarn "The following files are stray:" - eqawarn - eqatag -v python-pyc.stray "${stray[@]}" - found=1 - fi - - if [[ ${found} ]]; then - eqawarn - eqawarn "For more information on bytecode files and related issues, please see:" - eqawarn " https://projects.gentoo.org/python/guide/qawarn.html#compiled-bytecode-related-warnings" - fi -} - -python_pyc_check - -: # guarantee successful exit - -# vim:ft=ebuild diff --git a/metadata/install-qa-check.d/60python-site b/metadata/install-qa-check.d/60python-site new file mode 100644 index 000000000000..a0a0f4370db2 --- /dev/null +++ b/metadata/install-qa-check.d/60python-site @@ -0,0 +1,253 @@ +# Copyright 2019-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# QA checks related to site-packages directory: +# - missing, mismatched or stray .pyc files +# Maintainer: Python project <python@gentoo.org> + +python_site_check() { + local save=$(shopt -p nullglob) + shopt -s nullglob + local progs=( "${EPREFIX}"/usr/lib/python-exec/*/gpep517 ) + local bad_libdirs=() + [[ $(get_libdir) != lib ]] && bad_libdirs=( + "${ED}/usr/$(get_libdir)"/{python3,pypy}* + ) + ${save} + + local forbidden_package_names=( + # NB: setuptools/discovery.py is a good source of ideas + benchmark benchmarks dist doc docs examples scripts tasks + test tests tools util utils + # catch double-prefix installs, e.g. https://bugs.gentoo.org/618134 + lib $(get_libdir) usr + .pytest_cache .hypothesis _trial_temp + ) + + local invalid=() + local mismatched_timestamp=() + local mismatched_data=() + local missing=() + local stray=() + + local bad_versions=() + local eggs=() + local outside_site=() + local stray_packages=() + + # Avoid running the check if sufficiently new gpep517 is not installed + # yet. It's valid to schedule (for merge order) >=gpep517-8 after + # packages which have this check run if they don't use distutils-r1. + if [[ ${EAPI} == [0123] ]] || ! nonfatal has_version ">=dev-python/gpep517-8" ; then + return + fi + + local f prog + for prog in "${progs[@]}"; do + local impl=${prog%/*} + impl=${impl##*/} + + # NB: using ${impl}* to catch pypy3.* for pypy3 + local pydir=( "${ED}"/usr/lib/${impl}* ) + [[ -d ${pydir} ]] || continue + + # check for packages installing outside site-packages + case ${CATEGORY}/${PN} in + dev-lang/python|dev-python/pypy*) + ;; + *) + while IFS= read -d $'\0' -r f; do + outside_site+=( "${f}" ) + done < <( + find "${pydir}" -mindepth 1 -maxdepth 1 \ + '!' -name site-packages -print0 + ) + ;; + esac + + local sitedir=( "${pydir}"/site-packages ) + [[ -d ${sitedir} ]] || continue + + # check for bad package versions + while IFS= read -d $'\0' -r f; do + bad_versions+=( "${f#${ED}}" ) + done < <( + find "${sitedir}" -maxdepth 1 '(' \ + -name '*-0.0.0.dist-info' -o \ + -name '*UNKNOWN*.dist-info' -o \ + -name '*-0.0.0.egg-info' -o \ + -name '*UNKNOWN*.egg-info' \ + ')' -print0 + ) + + # check for deprecated egg format + while IFS= read -d $'\0' -r f; do + eggs+=( "${f#${ED}}" ) + done < <( + find "${sitedir}" -maxdepth 1 '(' \ + -name '*.egg-info' -o \ + -name '*.egg' \ + ')' -print0 + ) + + # check for stray files in site-packages + while IFS= read -d $'\0' -r f; do + stray_packages+=( "${f#${ED}}" ) + done < <( + find "${sitedir}" -maxdepth 1 -type f '!' '(' \ + -name '*.egg' -o \ + -name '*.egg-info' -o \ + -name '*.pth' -o \ + -name '*.py' -o \ + -name '*.pyi' -o \ + -name "*$(get_modname)" -o \ + -name 'README.txt' \ + ')' -print0 + ) + # check for forbidden packages + for f in "${forbidden_package_names[@]}"; do + [[ -d ${sitedir}/${f} ]] && stray_packages+=( + "${sitedir#${ED}}/${f}" + ) + done + + einfo "Verifying compiled files for ${impl}" + local kind pyc py + while IFS=: read -r kind pyc py extra; do + case ${kind} in + invalid) + invalid+=( "${pyc}" ) + ;; + mismatched) + case ${extra} in + timestamp) + mismatched_timestamp+=( "${pyc}" ) + ;; + *) + mismatched_data+=( "${pyc}" ) + ;; + esac + ;; + missing) + missing+=( "${pyc}" ) + ;; + older) + # older warnings were produced by earlier version + # of gpep517 but the check was incorrect, so we just + # ignore them + ;; + stray) + stray+=( "${pyc}" ) + ;; + esac + done < <("${prog}" verify-pyc --destdir "${D}" --prefix "${EPREFIX}"/usr) + done + + local found= + if [[ ${missing[@]} ]]; then + eqawarn + eqawarn "QA Notice: This package installs one or more Python modules that are" + eqawarn "not byte-compiled." + eqawarn "The following files are missing:" + eqawarn + eqatag -v python-site.pyc.missing "${missing[@]}" + found=1 + fi + + if [[ ${invalid[@]} ]]; then + eqawarn + eqawarn "QA Notice: This package installs one or more compiled Python modules" + eqawarn "that seem to be invalid (do not have the correct header)." + eqawarn "The following files are invalid:" + eqawarn + eqatag -v python-site.pyc.invalid "${invalid[@]}" + found=1 + fi + + if [[ ${mismatched_data[@]} ]]; then + eqawarn + eqawarn "QA Notice: This package installs one or more compiled Python modules whose" + eqawarn ".py files have different content (size or hash) than recorded:" + eqawarn + eqatag -v python-site.pyc.mismatched.data "${mismatched_data[@]}" + found=1 + fi + + if [[ ${mismatched_timestamp[@]} ]]; then + eqawarn + eqawarn "QA Notice: This package installs one or more compiled Python modules whose" + eqawarn ".py files have different timestamps than recorded:" + eqawarn + eqatag -v python-site.pyc.mismatched.timestamp "${mismatched_timestamp[@]}" + found=1 + fi + + if [[ ${stray[@]} ]]; then + eqawarn + eqawarn "QA Notice: This package installs one or more compiled Python modules" + eqawarn "that do not match installed modules (or their implementation)." + eqawarn "The following files are stray:" + eqawarn + eqatag -v python-site.pyc.stray "${stray[@]}" + found=1 + fi + + if [[ ${found} ]]; then + eqawarn + eqawarn "For more information on bytecode files and related issues, please see:" + eqawarn " https://projects.gentoo.org/python/guide/qawarn.html#compiled-bytecode-related-warnings" + fi + + if [[ ${bad_versions[@]} ]]; then + eqawarn + eqawarn "QA Notice: The following Python packages were installed with" + eqawarn "invalid/suspicious names or versions in the site-packages directory:" + eqawarn + eqatag -v python-site.bad_version "${bad_versions[@]}" + fi + + if [[ ${eggs[@]} ]]; then + eqawarn + eqawarn "QA Notice: The following deprecated .egg or .egg-info files were found." + eqawarn "Please migrate the ebuild to use the PEP517 build." + eqawarn + eqatag -v python-site.egg "${eggs[@]}" + fi + + if [[ ${stray_packages[@]} ]]; then + eqawarn + eqawarn "QA Notice: The following unexpected files/directories were found" + eqawarn "top-level in the site-packages directory:" + eqawarn + eqatag -v python-site.stray "${stray_packages[@]}" + eqawarn + eqawarn "This is most likely a bug in the build system. More information" + eqawarn "can be found in the Python Guide:" + eqawarn "https://projects.gentoo.org/python/guide/qawarn.html#stray-top-level-files-in-site-packages" + # TODO: make this fatal once we fix the existing issues, and remove + # the previous version from distutils-r1 + #die "Failing install because of stray top-level files in site-packages" + fi + + if [[ ${bad_libdirs[@]} ]]; then + eqawarn + eqawarn "QA Notice: Package installs Python files to /usr/$(get_libdir)" + eqawarn "instead of /usr/lib (use \$(python_get_sitedir)):" + eqawarn + eqatag -v python-site.libdir "${bad_libdirs[@]#${ED}}" + fi + + if [[ ${outside_site[@]} ]]; then + eqawarn + eqawarn "QA Notice: Files found installed directly into Python stdlib," + eqawarn "instead of site-packages (use \$(python_get_sitedir)):" + eqawarn + eqatag -v python-site.stdlib "${outside_site[@]}" + fi +} + +python_site_check + +: # guarantee successful exit + +# vim:ft=ebuild |