diff options
author | Repository mirror & CI <repomirrorci@gentoo.org> | 2022-04-11 20:05:14 +0000 |
---|---|---|
committer | Repository mirror & CI <repomirrorci@gentoo.org> | 2022-04-11 20:05:14 +0000 |
commit | 0e3e4a6a77c4b8009c81e11e0413712705f9117c (patch) | |
tree | ea7b00567b30564e18c07736a098c45456e8bb78 | |
parent | 2022-04-11 19:34:30 UTC (diff) | |
parent | dev-python/manuel: EAPI 8, PEP517 (diff) | |
download | gentoo-0e3e4a6a77c4b8009c81e11e0413712705f9117c.tar.gz gentoo-0e3e4a6a77c4b8009c81e11e0413712705f9117c.tar.bz2 gentoo-0e3e4a6a77c4b8009c81e11e0413712705f9117c.zip |
Merge updates from master
15 files changed, 139 insertions, 84 deletions
diff --git a/dev-python/manuel/manuel-1.10.1-r1.ebuild b/dev-python/manuel/manuel-1.10.1-r1.ebuild new file mode 100644 index 000000000000..300f45e5df0c --- /dev/null +++ b/dev-python/manuel/manuel-1.10.1-r1.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..10} ) + +inherit distutils-r1 + +DESCRIPTION="Lets you mix and match traditional doctests with custom test syntax" +HOMEPAGE=" + https://github.com/benji-york/manuel/ + https://pypi.org/project/manuel/ +" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86" + +RDEPEND=" + dev-python/six[${PYTHON_USEDEP}] +" +BDEPEND=" + test? ( + dev-python/zope-testing[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests setup.py + +src_prepare() { + # unused rdep + sed -i -e "/'setuptools'/d" setup.py || die + distutils-r1_src_prepare +} diff --git a/dev-python/ruamel-std-pathlib/ruamel-std-pathlib-0.9.2-r1.ebuild b/dev-python/ruamel-std-pathlib/ruamel-std-pathlib-0.9.2-r1.ebuild index 7ebe0572a78b..ada76ed82820 100644 --- a/dev-python/ruamel-std-pathlib/ruamel-std-pathlib-0.9.2-r1.ebuild +++ b/dev-python/ruamel-std-pathlib/ruamel-std-pathlib-0.9.2-r1.ebuild @@ -30,11 +30,6 @@ python_compile() { } python_test() { - # this is needed to keep the tests working while - # dev-python/namespace-ruamel is still installed - cat > "${BUILD_DIR}/install$(python_get_sitedir)"/ruamel/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace ruamel epytest - rm "${BUILD_DIR}/install$(python_get_sitedir)"/ruamel/__init__.py || die } diff --git a/dev-python/ruamel-yaml/ruamel-yaml-0.17.21-r1.ebuild b/dev-python/ruamel-yaml/ruamel-yaml-0.17.21-r1.ebuild index 004d9aa196d3..a5c9a8fbd528 100644 --- a/dev-python/ruamel-yaml/ruamel-yaml-0.17.21-r1.ebuild +++ b/dev-python/ruamel-yaml/ruamel-yaml-0.17.21-r1.ebuild @@ -52,9 +52,6 @@ python_test() { # this is needed to keep the tests working while # dev-python/namespace-ruamel is still installed - cat > "${BUILD_DIR}/install$(python_get_sitedir)"/ruamel/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace ruamel epytest - rm "${BUILD_DIR}/install$(python_get_sitedir)"/ruamel/__init__.py || die } diff --git a/dev-python/sphinxcontrib-bibtex/sphinxcontrib-bibtex-2.4.2.ebuild b/dev-python/sphinxcontrib-bibtex/sphinxcontrib-bibtex-2.4.2.ebuild index 5d8bcffd2fd0..d63be4fb2ab4 100644 --- a/dev-python/sphinxcontrib-bibtex/sphinxcontrib-bibtex-2.4.2.ebuild +++ b/dev-python/sphinxcontrib-bibtex/sphinxcontrib-bibtex-2.4.2.ebuild @@ -37,11 +37,6 @@ python_compile() { } python_test() { - # this is needed to keep the tests working while - # dev-python/namespace-sphinxcontrib is still installed - cat > "${BUILD_DIR}/install$(python_get_sitedir)/sphinxcontrib/__init__.py" <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace sphinxcontrib epytest - rm "${BUILD_DIR}/install$(python_get_sitedir)/sphinxcontrib/__init__.py" || die } diff --git a/dev-python/twisted/twisted-22.4.0.ebuild b/dev-python/twisted/twisted-22.4.0.ebuild index a8f3f14af373..38d5be8138a1 100644 --- a/dev-python/twisted/twisted-22.4.0.ebuild +++ b/dev-python/twisted/twisted-22.4.0.ebuild @@ -19,7 +19,7 @@ S=${WORKDIR}/${PN}-${P} LICENSE="MIT" SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +KEYWORDS="~alpha ~amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" IUSE="conch crypt http2 serial test" RESTRICT="!test? ( test )" diff --git a/dev-python/zope-component/zope-component-4.4.1-r1.ebuild b/dev-python/zope-component/zope-component-4.4.1-r1.ebuild index 6d9231a1bdf8..acb95d8facf8 100644 --- a/dev-python/zope-component/zope-component-4.4.1-r1.ebuild +++ b/dev-python/zope-component/zope-component-4.4.1-r1.ebuild @@ -49,11 +49,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/dev-python/zope-configuration/zope-configuration-4.4.1-r1.ebuild b/dev-python/zope-configuration/zope-configuration-4.4.1-r1.ebuild index 28d09ca112b4..a176c8e70382 100644 --- a/dev-python/zope-configuration/zope-configuration-4.4.1-r1.ebuild +++ b/dev-python/zope-configuration/zope-configuration-4.4.1-r1.ebuild @@ -51,11 +51,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/dev-python/zope-deprecation/zope-deprecation-4.4.0-r1.ebuild b/dev-python/zope-deprecation/zope-deprecation-4.4.0-r1.ebuild index 3aa022b61549..3e1bd14058bd 100644 --- a/dev-python/zope-deprecation/zope-deprecation-4.4.0-r1.ebuild +++ b/dev-python/zope-deprecation/zope-deprecation-4.4.0-r1.ebuild @@ -37,11 +37,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/dev-python/zope-event/zope-event-4.5.0-r2.ebuild b/dev-python/zope-event/zope-event-4.5.0-r2.ebuild index 578489805cb5..c9556f35b783 100644 --- a/dev-python/zope-event/zope-event-4.5.0-r2.ebuild +++ b/dev-python/zope-event/zope-event-4.5.0-r2.ebuild @@ -37,11 +37,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild b/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild index 7e70344cb57e..912c26d00ee7 100644 --- a/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild +++ b/dev-python/zope-exceptions/zope-exceptions-4.5.ebuild @@ -40,11 +40,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/dev-python/zope-i18nmessageid/zope-i18nmessageid-5.0.1-r1.ebuild b/dev-python/zope-i18nmessageid/zope-i18nmessageid-5.0.1-r1.ebuild index d54e7387684c..079692d0987e 100644 --- a/dev-python/zope-i18nmessageid/zope-i18nmessageid-5.0.1-r1.ebuild +++ b/dev-python/zope-i18nmessageid/zope-i18nmessageid-5.0.1-r1.ebuild @@ -41,11 +41,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/dev-python/zope-interface/zope-interface-5.4.0-r1.ebuild b/dev-python/zope-interface/zope-interface-5.4.0-r1.ebuild index 52e20bfda75f..955faef03f65 100644 --- a/dev-python/zope-interface/zope-interface-5.4.0-r1.ebuild +++ b/dev-python/zope-interface/zope-interface-5.4.0-r1.ebuild @@ -46,11 +46,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/dev-python/zope-schema/zope-schema-6.2.0-r1.ebuild b/dev-python/zope-schema/zope-schema-6.2.0-r1.ebuild index b3e6ad9b6e45..3657288c1276 100644 --- a/dev-python/zope-schema/zope-schema-6.2.0-r1.ebuild +++ b/dev-python/zope-schema/zope-schema-6.2.0-r1.ebuild @@ -48,11 +48,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/dev-python/zope-testing/zope-testing-4.10-r1.ebuild b/dev-python/zope-testing/zope-testing-4.10-r1.ebuild index 0ad39021764d..8f8245db3264 100644 --- a/dev-python/zope-testing/zope-testing-4.10-r1.ebuild +++ b/dev-python/zope-testing/zope-testing-4.10-r1.ebuild @@ -38,11 +38,6 @@ python_compile() { python_test() { cd "${BUILD_DIR}/install$(python_get_sitedir)" || die - # this is needed to keep the tests working while - # dev-python/namespace-zope is still installed - cat > zope/__init__.py <<-EOF || die - __path__ = __import__('pkgutil').extend_path(__path__, __name__) - EOF + distutils_write_namespace zope eunittest - rm zope/__init__.py || die } diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index de891215e688..2c3aee011847 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -196,23 +196,23 @@ _distutils_set_globals() { case ${DISTUTILS_USE_PEP517} in flit) bdep+=' - dev-python/flit_core[${PYTHON_USEDEP}]' + >=dev-python/flit_core-3.7.1[${PYTHON_USEDEP}]' ;; hatchling) bdep+=' - dev-python/hatchling[${PYTHON_USEDEP}]' + >=dev-python/hatchling-0.22.0[${PYTHON_USEDEP}]' ;; jupyter) bdep+=' - dev-python/jupyter_packaging[${PYTHON_USEDEP}]' + >=dev-python/jupyter_packaging-0.11.1[${PYTHON_USEDEP}]' ;; pdm) bdep+=' - dev-python/pdm-pep517[${PYTHON_USEDEP}]' + >=dev-python/pdm-pep517-0.12.3[${PYTHON_USEDEP}]' ;; poetry) bdep+=' - dev-python/poetry-core[${PYTHON_USEDEP}]' + >=dev-python/poetry-core-1.0.8[${PYTHON_USEDEP}]' ;; setuptools) bdep+=' @@ -425,7 +425,7 @@ distutils_enable_sphinx() { _DISTUTILS_SPHINX_PLUGINS=( "${@}" ) local deps autodoc=1 d - deps="dev-python/sphinx[\${PYTHON_USEDEP}]" + deps=">=dev-python/sphinx-4.4.0[\${PYTHON_USEDEP}]" for d; do if [[ ${d} == --no-autodoc ]]; then autodoc= @@ -449,13 +449,15 @@ distutils_enable_sphinx() { use doc || return 0 local p - for p in dev-python/sphinx "${_DISTUTILS_SPHINX_PLUGINS[@]}"; do + for p in ">=dev-python/sphinx-4.4.0" \ + "${_DISTUTILS_SPHINX_PLUGINS[@]}" + do python_has_version "${p}[${PYTHON_USEDEP}]" || return 1 done } else - deps="dev-python/sphinx" + deps=">=dev-python/sphinx-4.4.0" fi sphinx_compile_all() { @@ -538,7 +540,7 @@ distutils_enable_tests() { test_pkg=">=dev-python/nose-1.3.7-r4" ;; pytest) - test_pkg=">=dev-python/pytest-6.2.5-r2" + test_pkg=">=dev-python/pytest-7.0.1" ;; setup.py) ;; @@ -750,6 +752,42 @@ distutils_install_for_testing() { esetup.py install "${add_args[@]}" "${@}" } +# @FUNCTION: distutils_write_namespace +# @USAGE: <namespace>... +# @DESCRIPTION: +# Write the __init__.py file for the requested namespace into PEP517 +# install tree, in order to fix running tests when legacy namespace +# packages are installed (dev-python/namespace-*). +# +# This function must only be used in python_test(). The created file +# will automatically be removed upon leaving the test phase. +distutils_write_namespace() { + debug-print-function ${FUNCNAME} "${@}" + + if [[ ! ${DISTUTILS_USE_PEP517} ]]; then + die "${FUNCNAME} is available only in PEP517 mode" + fi + if [[ ${EBUILD_PHASE} != test || ! ${BUILD_DIR} ]]; then + die "${FUNCNAME} should only be used in python_test" + fi + + local namespace + for namespace; do + if [[ ${namespace} == *[./]* ]]; then + die "${FUNCNAME} does not support nested namespaces at the moment" + fi + + local path=${BUILD_DIR}/install$(python_get_sitedir)/${namespace}/__init__.py + if [[ -f ${path} ]]; then + die "Requested namespace ${path} exists already!" + fi + cat > "${path}" <<-EOF || die + __path__ = __import__('pkgutil').extend_path(__path__, __name__) + EOF + _DISTUTILS_POST_PHASE_RM+=( "${path}" ) + done +} + # @FUNCTION: _distutils-r1_disable_ez_setup # @INTERNAL # @DESCRIPTION: @@ -831,6 +869,15 @@ distutils-r1_python_prepare_all() { if [[ ! ${DISTUTILS_USE_PEP517} ]]; then _distutils-r1_disable_ez_setup _distutils-r1_handle_pyproject_toml + + case ${DISTUTILS_USE_SETUPTOOLS} in + no) + eqawarn "Non-PEP517 builds are deprecated for ebuilds using plain distutils." + eqawarn "Please migrate to DISTUTILS_USE_PEP517=setuptools." + eqawarn "Please see Python Guide for more details:" + eqawarn " https://projects.gentoo.org/python/guide/distutils.html" + ;; + esac fi if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]] @@ -1090,7 +1137,11 @@ distutils_pep517_install() { # clean the build tree; otherwise we may end up with PyPy3 # extensions duplicated into CPython dists if [[ ${DISTUTILS_USE_PEP517:-setuptools} == setuptools ]]; then - esetup.py clean -a + if [[ ${GPEP517_TESTING} ]]; then + rm -rf build || die + else + esetup.py clean -a + fi fi } @@ -1111,7 +1162,13 @@ distutils-r1_python_compile() { # call setup.py build when using setuptools (either via PEP517 # or in legacy mode) if [[ ${DISTUTILS_USE_PEP517:-setuptools} == setuptools ]]; then - if [[ ! ${DISTUTILS_USE_PEP517} ]]; then + if [[ ${GPEP517_TESTING} ]]; then + if [[ -d build ]]; then + eqawarn "A 'build' directory exists already. Artifacts from this directory may" + eqawarn "be picked up by setuptools when building for another interpreter." + eqawarn "Please remove this directory prior to building." + fi + else _distutils-r1_copy_egg_info fi @@ -1122,7 +1179,21 @@ distutils-r1_python_compile() { jobs=$(( nproc + 1 )) fi - esetup.py build -j "${jobs}" "${@}" + if [[ ${DISTUTILS_USE_PEP517} && ${GPEP517_TESTING} ]]; then + # issue build_ext only if it looks like we have something + # to build; setuptools is expensive to start + # see extension.py for list of suffixes + # .pyx is added for Cython + if [[ -n $( + find '(' -name '*.c' -o -name '*.cc' -o -name '*.cpp' \ + -o -name '*.cxx' -o -name '*.c++' -o -name '*.m' \ + -o -name '*.mm' -o -name '*.pyx' ')' -print -quit + ) ]]; then + esetup.py build_ext -j "${jobs}" "${@}" + fi + else + esetup.py build -j "${jobs}" "${@}" + fi fi if [[ ${DISTUTILS_USE_PEP517} ]]; then @@ -1453,10 +1524,15 @@ distutils-r1_run_phase() { esac local -x LDSHARED="${CC} ${ldopts}" LDCXXSHARED="${CXX} ${ldopts}" + local _DISTUTILS_POST_PHASE_RM=() "${@}" local ret=${?} + if [[ -n ${_DISTUTILS_POST_PHASE_RM} ]]; then + rm "${_DISTUTILS_POST_PHASE_RM[@]}" || die + fi + cd "${_DISTUTILS_INITIAL_CWD}" || die return "${ret}" } @@ -1627,7 +1703,7 @@ _distutils-r1_check_namespace_pth() { ewarn "read our documentation on reliable handling of namespaces and update" ewarn "the ebuild accordingly:" ewarn - ewarn " https://wiki.gentoo.org/wiki/Project:Python/Namespace_packages" + ewarn " https://projects.gentoo.org/python/guide/concept.html#namespace-packages" fi } |