* [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches
@ 2022-06-04 9:03 Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 01/18] python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest Michał Górny
` (17 more replies)
0 siblings, 18 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Hi,
Here's another large-ish patchset for the Python eclass. The primary
highlight is DISTUTILS_USE_PEP517=no mode explained below. In addition
to that, some refactoring, bug fixes and other changes collected
to avoid updating the metadata cache twice.
D_U_PEP517=no mode basically gives you the best of distutils-r1 features
without default python_* phases or build system-specific dependencies.
This means to cover 3 use cases:
1) packages that can't use PEP517 to avoid cyclic deps in bootstrap,
2) trivial packages without a build system,
3) Python-ish packages without a PEP517 build system (e.g. using plain
meson).
Before, these either required legacy mode (that I'd like to eventually
remove, many years from now) or using python-r1 directly. Thanks to
the new mode, they can benefit from convenient python_* phases, default
Python deps (unless you're using DISTUTILS_OPTIONAL), the test-scope
venv logic, distutils_enable_tests, etc.
There are two main methods of using it: either declare phases up to
python_install() and install files straight to ${D}, or install them
to ${BUILD_DIR}/install during python_compile() and the eclass will pick
it up. The latter method gives you working venv for python_test() too.
I've included a few example ebuilds in the middle of patch set. tomli
and installer ebuilds demonstrate using python_compile() to install
Python modules and use them in tests. gpep517 uses python_install().
gnome-abrt demonstrates working with meson (yes, I know it's the old
version).
Other changes are:
- removing incidental install of temporary cache files (*-pytest-*.pyc)
from epytest
- internal refactoring to make post-python_install() QA checks,
${BUILD_DIR}/install merging and post-python_compile() test venv setup
(in PEP517 mode) work independently of python_compile()
and python_install() overrides
- *-nspkg.pth warning will become an error in EAPI 9
- python_domodule() now works outside src_install(), by installing
into ${BUILD_DIR}/install (and therefore fits part with distutils-r1)
- other python_do*() and python_new*() functions now fail if called
outside src_install()
- add `_trial_temp` to disallowed top-level packages
- minor doc fixes
--
Best regards,
Michał Górny
Arthur Zamarin (2):
python-any-r1.eclass: use python_has_version in examples
distutils-r1.eclass: small docs format fixes
Michał Górny (16):
python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest
distutils-r1.eclass: Support internal post-python_* phase functions
distutils-r1.eclass: Call egg-info cleanup via post-test phase
distutils-r1.eclass: Move install QA checks to post-phase function
distutils-r1.eclass: Remove the obsolete pypy/share check
distutils-r1.eclass: Make *-nspkg.pth warning fatal for EAPI 9+
distutils-r1.eclass: Move venv/merge-root logic to post-phases
distutils-r1.eclass: Introduce DISTUTILS_USE_PEP517=no mode
python-utils-r1.eclass: Fix typo in python_moduleinto doc
python-utils-r1.eclass: Support python_domodule outside src_install
python-utils-r1.eclass: Add explicit checks for incorrect phase
dev-python/tomli: Use DISTUTILS_USE_PEP517=no
dev-python/installer: Use DISTUTILS_USE_PEP517=no
dev-python/gpep517: Use DISTUTILS_USE_PEP517=no
app-admin/gnome-abrt: Use DISTUTILS_USE_PEP517=no
distutils-r1.eclass: Add "_trial_temp" to forbidden package names
.../gnome-abrt/gnome-abrt-1.4.1-r1.ebuild | 57 +++++
dev-python/gpep517/gpep517-6-r1.ebuild | 41 ++++
.../installer/installer-0.5.1-r1.ebuild | 37 +++
dev-python/tomli/tomli-2.0.1-r1.ebuild | 36 +++
eclass/distutils-r1.eclass | 230 ++++++++++++------
eclass/python-any-r1.eclass | 10 +-
eclass/python-utils-r1.eclass | 55 ++++-
7 files changed, 369 insertions(+), 97 deletions(-)
create mode 100644 app-admin/gnome-abrt/gnome-abrt-1.4.1-r1.ebuild
create mode 100644 dev-python/gpep517/gpep517-6-r1.ebuild
create mode 100644 dev-python/installer/installer-0.5.1-r1.ebuild
create mode 100644 dev-python/tomli/tomli-2.0.1-r1.ebuild
--
2.35.1
^ permalink raw reply [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 01/18] python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 02/18] distutils-r1.eclass: Support internal post-python_* phase functions Michał Górny
` (16 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
The test suites of pytest plugins cause additional *-pytest-*.pyc files
to be created. Remove them in order to prevent them from being
installed alongside the package.
Closes: https://bugs.gentoo.org/847235
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 67dc5bf754d6..9eb068d3b13f 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1318,6 +1318,11 @@ epytest() {
# remove common temporary directories left over by pytest plugins
rm -rf .hypothesis .pytest_cache || die
+ # pytest plugins create additional .pyc files while testing
+ # see e.g. https://bugs.gentoo.org/847235
+ if [[ -n ${BUILD_DIR} && -d ${BUILD_DIR} ]]; then
+ find "${BUILD_DIR}" -name '*-pytest-*.pyc' -delete || die
+ fi
return ${ret}
}
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 02/18] distutils-r1.eclass: Support internal post-python_* phase functions
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 01/18] python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 03/18] distutils-r1.eclass: Call egg-info cleanup via post-test phase Michał Górny
` (15 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Support running additional post-python_* phase functions for internal
usage. The goal is to replace some of the inline logic
in distutils-r1_python_* functions that relies on the user calling them
and additional calls to python_foreach_impl.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index ed368da79896..d6fd176192de 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1687,6 +1687,11 @@ distutils-r1_run_phase() {
fi
cd "${_DISTUTILS_INITIAL_CWD}" || die
+ if [[ ! ${_DISTUTILS_IN_COMMON_IMPL} ]] &&
+ declare -f "_distutils-r1_post_python_${EBUILD_PHASE}" >/dev/null
+ then
+ "_distutils-r1_post_python_${EBUILD_PHASE}"
+ fi
return "${ret}"
}
@@ -1701,6 +1706,7 @@ distutils-r1_run_phase() {
# of sources made for the selected Python interpreter.
_distutils-r1_run_common_phase() {
local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
+ local _DISTUTILS_IN_COMMON_IMPL=1
if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
# reuse the dedicated code branch
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 03/18] distutils-r1.eclass: Call egg-info cleanup via post-test phase
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 01/18] python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 02/18] distutils-r1.eclass: Support internal post-python_* phase functions Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 04/18] distutils-r1.eclass: Move install QA checks to post-phase function Michał Górny
` (14 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index d6fd176192de..b690f21f9159 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1818,15 +1818,24 @@ _distutils-r1_clean_egg_info() {
rm -rf "${BUILD_DIR}"/lib/*.egg-info || die
}
+# @FUNCTION: _distutils-r1_post_python_test
+# @INTERNAL
+# @DESCRIPTION:
+# Post-phase function called after python_test.
+_distutils-r1_post_python_test() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ if [[ ! ${DISTUTILS_USE_PEP517} ]]; then
+ _distutils-r1_clean_egg_info
+ fi
+}
+
distutils-r1_src_test() {
debug-print-function ${FUNCNAME} "${@}"
local ret=0
if declare -f python_test >/dev/null; then
_distutils-r1_run_foreach_impl python_test || ret=${?}
- if [[ ! ${DISTUTILS_USE_PEP517} ]]; then
- _distutils-r1_run_foreach_impl _distutils-r1_clean_egg_info
- fi
fi
if declare -f python_test_all >/dev/null; then
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 04/18] distutils-r1.eclass: Move install QA checks to post-phase function
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (2 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 03/18] distutils-r1.eclass: Call egg-info cleanup via post-test phase Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 05/18] distutils-r1.eclass: Remove the obsolete pypy/share check Michał Górny
` (13 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Perform the install QA check (the invalid package name check) in a post-
phase function. This enables it to be performed even when
distutils-r1_python_install is not used.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 54 ++++++++++++++++++++++----------------
1 file changed, 31 insertions(+), 23 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index b690f21f9159..30391ad67f3a 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1566,29 +1566,6 @@ distutils-r1_python_install() {
esetup.py "${args[@]}"
fi
- local forbidden_package_names=(
- examples test tests
- .pytest_cache .hypothesis
- )
- local p
- for p in "${forbidden_package_names[@]}"; do
- if [[ -d ${root}$(python_get_sitedir)/${p} ]]; then
- die "Package installs '${p}' package which is forbidden and likely a bug in the build system."
- fi
- done
-
- local shopt_save=$(shopt -p nullglob)
- shopt -s nullglob
- local pypy_dirs=(
- "${root}${EPREFIX}/usr/$(get_libdir)"/pypy*/share
- "${root}${EPREFIX}/usr/lib"/pypy*/share
- )
- ${shopt_save}
-
- if [[ -n ${pypy_dirs} ]]; then
- die "Package installs 'share' in PyPy prefix, see bug #465546."
- fi
-
if [[ ! ${DISTUTILS_SINGLE_IMPL} || ${DISTUTILS_USE_PEP517} ]]; then
multibuild_merge_root "${root}" "${D%/}"
if [[ ${DISTUTILS_USE_PEP517} ]]; then
@@ -1845,6 +1822,37 @@ distutils-r1_src_test() {
return ${ret}
}
+# @FUNCTION: _distutils-r1_post_python_install
+# @INTERNAL
+# @DESCRIPTION:
+# Post-phase function called after python_install.
+_distutils-r1_post_python_install() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ local forbidden_package_names=(
+ examples test tests
+ .pytest_cache .hypothesis
+ )
+ local p
+ for p in "${forbidden_package_names[@]}"; do
+ if [[ -d ${D}$(python_get_sitedir)/${p} ]]; then
+ die "Package installs '${p}' package which is forbidden and likely a bug in the build system."
+ fi
+ done
+
+ local shopt_save=$(shopt -p nullglob)
+ shopt -s nullglob
+ local pypy_dirs=(
+ "${D}${EPREFIX}/usr/$(get_libdir)"/pypy*/share
+ "${D}${EPREFIX}/usr/lib"/pypy*/share
+ )
+ ${shopt_save}
+
+ if [[ -n ${pypy_dirs} ]]; then
+ die "Package installs 'share' in PyPy prefix, see bug #465546."
+ fi
+}
+
# @FUNCTION: _distutils-r1_check_namespace_pth
# @INTERNAL
# @DESCRIPTION:
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 05/18] distutils-r1.eclass: Remove the obsolete pypy/share check
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (3 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 04/18] distutils-r1.eclass: Move install QA checks to post-phase function Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 06/18] distutils-r1.eclass: Make *-nspkg.pth warning fatal for EAPI 9+ Michał Górny
` (12 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
The PyPy 'share' directory check was necessary because of the historical
prefix logic that we patched in Gentoo. All modern versions of PyPy
use '/usr' as sys.prefix natively, so the check is no longer needed.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 30391ad67f3a..b0318410b100 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1839,18 +1839,6 @@ _distutils-r1_post_python_install() {
die "Package installs '${p}' package which is forbidden and likely a bug in the build system."
fi
done
-
- local shopt_save=$(shopt -p nullglob)
- shopt -s nullglob
- local pypy_dirs=(
- "${D}${EPREFIX}/usr/$(get_libdir)"/pypy*/share
- "${D}${EPREFIX}/usr/lib"/pypy*/share
- )
- ${shopt_save}
-
- if [[ -n ${pypy_dirs} ]]; then
- die "Package installs 'share' in PyPy prefix, see bug #465546."
- fi
}
# @FUNCTION: _distutils-r1_check_namespace_pth
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 06/18] distutils-r1.eclass: Make *-nspkg.pth warning fatal for EAPI 9+
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (4 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 05/18] distutils-r1.eclass: Remove the obsolete pypy/share check Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 07/18] distutils-r1.eclass: Move venv/merge-root logic to post-phases Michał Górny
` (11 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Now that we've essentially removed non-implicit namespace packages
from Gentoo and setuptools upstream has deprecated their old solution,
it's time to make this check fatal. Unfortunately, I did not think
of it when adding PEP517 mode, so let's do that in EAPI 9.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index b0318410b100..1d7bea6d8cab 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1865,6 +1865,10 @@ _distutils-r1_check_namespace_pth() {
ewarn "the ebuild accordingly:"
ewarn
ewarn " https://projects.gentoo.org/python/guide/concept.html#namespace-packages"
+
+ if ! has "${EAPI}" 6 7 8; then
+ die "*-nspkg.pth files are banned in EAPI ${EAPI}"
+ fi
fi
}
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 07/18] distutils-r1.eclass: Move venv/merge-root logic to post-phases
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (5 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 06/18] distutils-r1.eclass: Make *-nspkg.pth warning fatal for EAPI 9+ Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 08/18] distutils-r1.eclass: Introduce DISTUTILS_USE_PEP517=no mode Michał Górny
` (10 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Move the PEP517 venv logic, install executable wrapping and root-merging
logic all into post-phases. This will enable the ebuilds that do not
use the standard phase implementations to use them.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 124 ++++++++++++++++++++++---------------
1 file changed, 73 insertions(+), 51 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 1d7bea6d8cab..208bd2718cb8 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1361,33 +1361,7 @@ distutils-r1_python_compile() {
addpredict /usr/lib/portage/pym
addpredict /usr/local # bug 498232
- local root=${BUILD_DIR}/install
- distutils_pep517_install "${root}"
-
- # copy executables to python-exec directory
- # we do it early so that we can alter bindir recklessly
- local bindir=${root}${EPREFIX}/usr/bin
- local rscriptdir=${root}$(python_get_scriptdir)
- [[ -d ${rscriptdir} ]] &&
- die "${rscriptdir} should not exist!"
- if [[ -d ${bindir} ]]; then
- mkdir -p "${rscriptdir}" || die
- cp -a --reflink=auto "${bindir}"/. "${rscriptdir}"/ || die
- fi
-
- # enable venv magic inside the install tree
- mkdir -p "${bindir}" || die
- ln -s "${PYTHON}" "${bindir}/${EPYTHON}" || die
- ln -s "${EPYTHON}" "${bindir}/python3" || die
- ln -s "${EPYTHON}" "${bindir}/python" || die
- cat > "${bindir}"/pyvenv.cfg <<-EOF || die
- include-system-site-packages = true
- EOF
-
- # we need to change shebangs to point to the venv-python
- find "${bindir}" -type f -exec sed -i \
- -e "1s@^#!\(${EPREFIX}/usr/bin/\(python\|pypy\)\)@#!${root}\1@" \
- {} + || die
+ distutils_pep517_install "${BUILD_DIR}/install"
fi
}
@@ -1501,18 +1475,7 @@ distutils-r1_python_install() {
_python_check_EPYTHON
local scriptdir=${EPREFIX}/usr/bin
- if [[ ${DISTUTILS_USE_PEP517} ]]; then
- local root=${BUILD_DIR}/install
- # remove the altered bindir, executables from the package
- # are already in scriptdir
- rm -r "${root}${scriptdir}" || die
- if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
- local wrapped_scriptdir=${root}$(python_get_scriptdir)
- if [[ -d ${wrapped_scriptdir} ]]; then
- mv "${wrapped_scriptdir}" "${root}${scriptdir}" || die
- fi
- fi
- else
+ if [[ ! ${DISTUTILS_USE_PEP517} ]]; then
local root=${D%/}/_${EPYTHON}
[[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/}
@@ -1565,18 +1528,6 @@ distutils-r1_python_install() {
esetup.py "${args[@]}"
fi
-
- if [[ ! ${DISTUTILS_SINGLE_IMPL} || ${DISTUTILS_USE_PEP517} ]]; then
- multibuild_merge_root "${root}" "${D%/}"
- if [[ ${DISTUTILS_USE_PEP517} ]]; then
- # we need to recompile everything here in order to embed
- # the correct paths
- python_optimize "${D%/}$(python_get_sitedir)"
- fi
- fi
- if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
- _distutils-r1_wrap_scripts "${scriptdir}"
- fi
}
# @FUNCTION: distutils-r1_python_install_all
@@ -1764,6 +1715,43 @@ distutils-r1_src_configure() {
return ${ret}
}
+# @FUNCTION: _distutils-r1_post_python_compile
+# @INTERNAL
+# @DESCRIPTION:
+# Post-phase function called after python_compile. In PEP517 mode,
+# it adjusts the install tree for venv-style usage.
+_distutils-r1_post_python_compile() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ local root=${BUILD_DIR}/install
+ if [[ ${DISTUTILS_USE_PEP517} && -d ${root} ]]; then
+ # copy executables to python-exec directory
+ # we do it early so that we can alter bindir recklessly
+ local bindir=${root}${EPREFIX}/usr/bin
+ local rscriptdir=${root}$(python_get_scriptdir)
+ [[ -d ${rscriptdir} ]] &&
+ die "${rscriptdir} should not exist!"
+ if [[ -d ${bindir} ]]; then
+ mkdir -p "${rscriptdir}" || die
+ cp -a --reflink=auto "${bindir}"/. "${rscriptdir}"/ || die
+ fi
+
+ # enable venv magic inside the install tree
+ mkdir -p "${bindir}" || die
+ ln -s "${PYTHON}" "${bindir}/${EPYTHON}" || die
+ ln -s "${EPYTHON}" "${bindir}/python3" || die
+ ln -s "${EPYTHON}" "${bindir}/python" || die
+ cat > "${bindir}"/pyvenv.cfg <<-EOF || die
+ include-system-site-packages = true
+ EOF
+
+ # we need to change shebangs to point to the venv-python
+ find "${bindir}" -type f -exec sed -i \
+ -e "1s@^#!\(${EPREFIX}/usr/bin/\(python\|pypy\)\)@#!${root}\1@" \
+ {} + || die
+ fi
+}
+
distutils-r1_src_compile() {
debug-print-function ${FUNCNAME} "${@}"
local ret=0
@@ -1829,6 +1817,40 @@ distutils-r1_src_test() {
_distutils-r1_post_python_install() {
debug-print-function ${FUNCNAME} "${@}"
+ local root=${D%/}/_${EPYTHON}
+ [[ ${DISTUTILS_USE_PEP517} ]] && root=${BUILD_DIR}/install
+ local scriptdir=${EPREFIX}/usr/bin
+ if [[ -d ${root} && ${DISTUTILS_USE_PEP517} ]]; then
+ # remove the altered bindir, executables from the package
+ # are already in scriptdir
+ rm -r "${root}${scriptdir}" || die
+ if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
+ local wrapped_scriptdir=${root}$(python_get_scriptdir)
+ if [[ -d ${wrapped_scriptdir} ]]; then
+ mv "${wrapped_scriptdir}" "${root}${scriptdir}" || die
+ fi
+ fi
+
+ # prune empty directories to see if ${root} contains anything
+ # to merge
+ find "${BUILD_DIR}"/install -type d -empty -delete || die
+ fi
+
+ if [[ -d ${root} ]]; then
+ if [[ ! ${DISTUTILS_SINGLE_IMPL} || ${DISTUTILS_USE_PEP517} ]]; then
+ multibuild_merge_root "${root}" "${D%/}"
+ fi
+ fi
+ local pypath=${D%/}$(python_get_sitedir)
+ if [[ ${DISTUTILS_USE_PEP517} && -d ${pypath} ]]; then
+ # we need to recompile everything here in order to embed
+ # the correct paths
+ python_optimize "${pypath}"
+ fi
+ if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
+ _distutils-r1_wrap_scripts "${scriptdir}"
+ fi
+
local forbidden_package_names=(
examples test tests
.pytest_cache .hypothesis
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 08/18] distutils-r1.eclass: Introduce DISTUTILS_USE_PEP517=no mode
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (6 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 07/18] distutils-r1.eclass: Move venv/merge-root logic to post-phases Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 09/18] python-utils-r1.eclass: Fix typo in python_moduleinto doc Michał Górny
` (9 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Introduce a new DISTUTILS_USE_PEP517 value "no" that stands for
"no build system". This is primarily meant to replace the legacy
distutils-r1 logic used for bootstrapping baseline PEP 517 packages.
At the same time, it provides a convenient replacement for some
of the uses of python-r1.
In this mode, the eclass does not add PEP517-specific dependencies
and does not export default python_compile() and python_install()
implementations. However, it does set dependencies, REQUIRED_USE
and enables sub-phase usage (with respect to DISTUTILS_OPTIONAL).
It also permits using distutils_enable_{sphinx,tests}.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 208bd2718cb8..30f7d941f0d4 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -106,6 +106,8 @@ esac
#
# - maturin - maturin backend
#
+# - no - no PEP517 build system (see below)
+#
# - pbr - pbr backend
#
# - pdm - pdm.pep517 backend
@@ -121,6 +123,17 @@ esac
#
# The variable needs to be set before the inherit line. The eclass
# adds appropriate build-time dependencies and verifies the value.
+#
+# The special value "no" indicates that the package has no build system.
+# This is not equivalent to unset DISTUTILS_USE_PEP517 (legacy mode).
+# It causes the eclass not to include any build system dependencies
+# and to disable default python_compile() and python_install()
+# implementations. Baseline Python deps and phase functions will still
+# be set (depending on the value of DISTUTILS_OPTIONAL). Most of
+# the other eclass functions will work. Testing venv will be provided
+# in ${BUILD_DIR}/install after python_compile(), and if any (other)
+# files are found in ${BUILD_DIR}/install after python_install(), they
+# will be merged into ${D}.
# @ECLASS_VARIABLE: DISTUTILS_USE_SETUPTOOLS
# @DEFAULT_UNSET
@@ -212,6 +225,10 @@ _distutils_set_globals() {
bdep+='
>=dev-util/maturin-0.12.7[${PYTHON_USEDEP}]'
;;
+ no)
+ # undo the generic deps added above
+ bdep=
+ ;;
pbr)
bdep+='
>=dev-python/pbr-5.8.0-r1[${PYTHON_USEDEP}]'
@@ -789,7 +806,7 @@ distutils_install_for_testing() {
distutils_write_namespace() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ! ${DISTUTILS_USE_PEP517} ]]; then
+ if [[ ! ${DISTUTILS_USE_PEP517:-no} != no ]]; then
die "${FUNCNAME} is available only in PEP517 mode"
fi
if [[ ${EBUILD_PHASE} != test || ! ${BUILD_DIR} ]]; then
@@ -912,6 +929,9 @@ _distutils-r1_print_package_versions() {
dev-util/maturin
)
;;
+ no)
+ return
+ ;;
pbr)
packages+=(
dev-python/pbr
@@ -1207,6 +1227,10 @@ distutils_pep517_install() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: root"
+ if [[ ! ${DISTUTILS_USE_PEP517:-no} != no ]]; then
+ die "${FUNCNAME} is available only in PEP517 mode"
+ fi
+
local root=${1}
local -x WHEEL_BUILD_DIR=${BUILD_DIR}/wheel
mkdir -p "${WHEEL_BUILD_DIR}" || die
@@ -1351,6 +1375,9 @@ distutils-r1_python_compile() {
in_iuse debug && use debug &&
MATURIN_PEP517_ARGS+=" --cargo-extra-args=--profile=dev"
;;
+ no)
+ return
+ ;;
esac
if [[ ${DISTUTILS_USE_PEP517} ]]; then
@@ -1472,6 +1499,7 @@ distutils-r1_python_test() {
distutils-r1_python_install() {
debug-print-function ${FUNCNAME} "${@}"
+ [[ ${DISTUTILS_USE_PEP517} == no ]] && return
_python_check_EPYTHON
local scriptdir=${EPREFIX}/usr/bin
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 09/18] python-utils-r1.eclass: Fix typo in python_moduleinto doc
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (7 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 08/18] distutils-r1.eclass: Introduce DISTUTILS_USE_PEP517=no mode Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 10/18] python-utils-r1.eclass: Support python_domodule outside src_install Michał Górny
` (8 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Fix python_moduleinto doc to mention python_domodule rather than
python_doscript (copy-paste error, probably).
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 9eb068d3b13f..b3c249dfa694 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -805,10 +805,10 @@ python_newscript() {
# site-packages directory.
#
# In the relative case, the exact path is determined directly
-# by each python_doscript/python_newscript function. Therefore,
-# python_moduleinto can be safely called before establishing the Python
-# interpreter and/or a single call can be used to set the path correctly
-# for multiple implementations, as can be seen in the following example.
+# by each python_domodule invocation. Therefore, python_moduleinto
+# can be safely called before establishing the Python interpreter and/or
+# a single call can be used to set the path correctly for multiple
+# implementations, as can be seen in the following example.
#
# Example:
# @CODE
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 10/18] python-utils-r1.eclass: Support python_domodule outside src_install
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (8 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 09/18] python-utils-r1.eclass: Fix typo in python_moduleinto doc Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 11/18] python-utils-r1.eclass: Add explicit checks for incorrect phase Michał Górny
` (7 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Make it possible to use python_domodule() outside src_install(),
in order to install files into the ${BUILD_DIR}/install tree used
by distutils-r1.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index b3c249dfa694..fd04cf374ce4 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -832,6 +832,10 @@ python_moduleinto() {
# and packages (directories). All listed files will be installed
# for all enabled implementations, and compiled afterwards.
#
+# The files are installed into ${D} when run in src_install() phase.
+# Otherwise, they are installed into ${BUILD_DIR}/install location
+# that is suitable for picking up by distutils-r1 in PEP517 mode.
+#
# Example:
# @CODE
# src_install() {
@@ -854,13 +858,24 @@ python_domodule() {
d=${sitedir#${EPREFIX}}/${_PYTHON_MODULEROOT//.//}
fi
- (
- insopts -m 0644
- insinto "${d}"
- doins -r "${@}" || return ${?}
- )
-
- python_optimize "${ED%/}/${d}"
+ if [[ ${EBUILD_PHASE} == install ]]; then
+ (
+ insopts -m 0644
+ insinto "${d}"
+ doins -r "${@}" || return ${?}
+ )
+ python_optimize "${ED%/}/${d}"
+ elif [[ -n ${BUILD_DIR} ]]; then
+ local dest=${BUILD_DIR}/install${EPREFIX}/${d}
+ mkdir -p "${dest}" || die
+ cp -pR "${@}" "${dest}/" || die
+ (
+ cd "${dest}" &&
+ chmod -R a+rX "${@##*/}"
+ ) || die
+ else
+ die "${FUNCNAME} can only be used in src_install or with BUILD_DIR set"
+ fi
}
# @FUNCTION: python_doheader
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 11/18] python-utils-r1.eclass: Add explicit checks for incorrect phase
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (9 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 10/18] python-utils-r1.eclass: Support python_domodule outside src_install Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 12/18] dev-python/tomli: Use DISTUTILS_USE_PEP517=no Michał Górny
` (6 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/python-utils-r1.eclass | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index fd04cf374ce4..b9cf9c03caeb 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -696,6 +696,9 @@ python_scriptinto() {
python_doexe() {
debug-print-function ${FUNCNAME} "${@}"
+ [[ ${EBUILD_PHASE} != install ]] &&
+ die "${FUNCNAME} can only be used in src_install"
+
local f
for f; do
python_newexe "${f}" "${f##*/}"
@@ -714,6 +717,8 @@ python_doexe() {
python_newexe() {
debug-print-function ${FUNCNAME} "${@}"
+ [[ ${EBUILD_PHASE} != install ]] &&
+ die "${FUNCNAME} can only be used in src_install"
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
[[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <path> <new-name>"
@@ -762,6 +767,9 @@ python_newexe() {
python_doscript() {
debug-print-function ${FUNCNAME} "${@}"
+ [[ ${EBUILD_PHASE} != install ]] &&
+ die "${FUNCNAME} can only be used in src_install"
+
local _PYTHON_REWRITE_SHEBANG=1
python_doexe "${@}"
}
@@ -786,6 +794,9 @@ python_doscript() {
python_newscript() {
debug-print-function ${FUNCNAME} "${@}"
+ [[ ${EBUILD_PHASE} != install ]] &&
+ die "${FUNCNAME} can only be used in src_install"
+
local _PYTHON_REWRITE_SHEBANG=1
python_newexe "${@}"
}
@@ -894,6 +905,8 @@ python_domodule() {
python_doheader() {
debug-print-function ${FUNCNAME} "${@}"
+ [[ ${EBUILD_PHASE} != install ]] &&
+ die "${FUNCNAME} can only be used in src_install"
[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
local includedir=$(python_get_includedir)
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 12/18] dev-python/tomli: Use DISTUTILS_USE_PEP517=no
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (10 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 11/18] python-utils-r1.eclass: Add explicit checks for incorrect phase Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 13/18] dev-python/installer: " Michał Górny
` (5 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
dev-python/tomli/tomli-2.0.1-r1.ebuild | 36 ++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
create mode 100644 dev-python/tomli/tomli-2.0.1-r1.ebuild
diff --git a/dev-python/tomli/tomli-2.0.1-r1.ebuild b/dev-python/tomli/tomli-2.0.1-r1.ebuild
new file mode 100644
index 000000000000..338d877a350d
--- /dev/null
+++ b/dev-python/tomli/tomli-2.0.1-r1.ebuild
@@ -0,0 +1,36 @@
+# Copyright 2021-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# please keep this ebuild at EAPI 7 -- sys-apps/portage dep
+EAPI=7
+
+DISTUTILS_USE_PEP517=no
+PYTHON_COMPAT=( python3_{8..11} pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="A lil' TOML parser"
+HOMEPAGE="
+ https://pypi.org/project/tomli/
+ https://github.com/hukkin/tomli/
+"
+SRC_URI="
+ https://github.com/hukkin/tomli/archive/${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+ https://files.pythonhosted.org/packages/py3/${PN::1}/${PN}/${P}-py3-none-any.whl
+ -> ${P}-py3-none-any.whl.zip
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-macos ~x64-macos ~x64-solaris"
+
+BDEPEND="
+ app-arch/unzip
+"
+
+distutils_enable_tests unittest
+
+python_compile() {
+ python_domodule src/tomli "${WORKDIR}"/*.dist-info
+}
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 13/18] dev-python/installer: Use DISTUTILS_USE_PEP517=no
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (11 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 12/18] dev-python/tomli: Use DISTUTILS_USE_PEP517=no Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 14/18] dev-python/gpep517: " Michał Górny
` (4 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
.../installer/installer-0.5.1-r1.ebuild | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 dev-python/installer/installer-0.5.1-r1.ebuild
diff --git a/dev-python/installer/installer-0.5.1-r1.ebuild b/dev-python/installer/installer-0.5.1-r1.ebuild
new file mode 100644
index 000000000000..4f89e7433018
--- /dev/null
+++ b/dev-python/installer/installer-0.5.1-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# please keep this ebuild at EAPI 7 -- sys-apps/portage dep
+EAPI=7
+
+DISTUTILS_USE_PEP517=no
+PYTHON_COMPAT=( python3_{8..11} pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="A library for installing Python wheels"
+HOMEPAGE="
+ https://pypi.org/project/installer/
+ https://github.com/pypa/installer/
+ https://installer.readthedocs.io/en/latest/
+"
+SRC_URI="
+ https://github.com/pypa/installer/archive/${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+ https://files.pythonhosted.org/packages/py3/${PN::1}/${PN}/${P%_p*}-py3-none-any.whl
+ -> ${P%_p*}-py3-none-any.whl.zip
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+BDEPEND="
+ app-arch/unzip
+"
+
+distutils_enable_tests pytest
+
+python_compile() {
+ python_domodule src/installer "${WORKDIR}"/*.dist-info
+}
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 14/18] dev-python/gpep517: Use DISTUTILS_USE_PEP517=no
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (12 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 13/18] dev-python/installer: " Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 15/18] app-admin/gnome-abrt: " Michał Górny
` (3 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
dev-python/gpep517/gpep517-6-r1.ebuild | 41 ++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
create mode 100644 dev-python/gpep517/gpep517-6-r1.ebuild
diff --git a/dev-python/gpep517/gpep517-6-r1.ebuild b/dev-python/gpep517/gpep517-6-r1.ebuild
new file mode 100644
index 000000000000..ee64cb1d660f
--- /dev/null
+++ b/dev-python/gpep517/gpep517-6-r1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# please keep this ebuild at EAPI 7 -- sys-apps/portage dep
+EAPI=7
+
+DISTUTILS_USE_PEP517=no
+PYTHON_COMPAT=( pypy3 python3_{8..11} )
+
+inherit distutils-r1
+
+DESCRIPTION="A backend script to aid installing Python packages in Gentoo"
+HOMEPAGE="
+ https://pypi.org/project/gpep517/
+ https://github.com/mgorny/gpep517/
+"
+SRC_URI="
+ https://github.com/mgorny/gpep517/archive/v${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+RDEPEND="
+ >=dev-python/installer-0.5.0[${PYTHON_USEDEP}]
+ >=dev-python/tomli-1.2.3[${PYTHON_USEDEP}]
+"
+
+distutils_enable_tests pytest
+
+python_install() {
+ python_domodule gpep517
+ python_newscript - gpep517 <<-EOF
+ #!${EPREFIX}/usr/bin/python
+ import sys
+ from gpep517.__main__ import main
+ sys.exit(main())
+ EOF
+}
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 15/18] app-admin/gnome-abrt: Use DISTUTILS_USE_PEP517=no
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (13 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 14/18] dev-python/gpep517: " Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 16/18] python-any-r1.eclass: use python_has_version in examples Michał Górny
` (2 subsequent siblings)
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
.../gnome-abrt/gnome-abrt-1.4.1-r1.ebuild | 57 +++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 app-admin/gnome-abrt/gnome-abrt-1.4.1-r1.ebuild
diff --git a/app-admin/gnome-abrt/gnome-abrt-1.4.1-r1.ebuild b/app-admin/gnome-abrt/gnome-abrt-1.4.1-r1.ebuild
new file mode 100644
index 000000000000..2df18e86b873
--- /dev/null
+++ b/app-admin/gnome-abrt/gnome-abrt-1.4.1-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=no
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit meson distutils-r1
+
+DESCRIPTION="A utility for viewing problems that have occurred with the system"
+HOMEPAGE="https://github.com/abrt/gnome-abrt"
+SRC_URI="https://github.com/abrt/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="doc"
+
+RDEPEND="
+ >=x11-libs/gtk+-3.10.0:3
+ >=dev-libs/libreport-2.14.0:0=[python,${PYTHON_USEDEP}]
+ >=app-admin/abrt-2.14.0
+ >=dev-python/pygobject-3.29.1:3[${PYTHON_USEDEP}]
+ >=dev-python/pyxdg-0.19[${PYTHON_USEDEP}]
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? (
+ app-text/asciidoc
+ app-text/xmlto
+ )
+ virtual/pkgconfig
+ >=sys-devel/gettext-0.17
+"
+
+python_configure() {
+ local emesonargs=(
+ $(meson_use doc docs)
+ -Dlint=false
+ )
+
+ meson_src_configure
+}
+
+python_compile() {
+ meson_src_compile
+}
+
+python_test() {
+ meson_src_test
+}
+
+python_install() {
+ meson_src_install
+}
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 16/18] python-any-r1.eclass: use python_has_version in examples
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (14 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 15/18] app-admin/gnome-abrt: " Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 17/18] distutils-r1.eclass: small docs format fixes Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 18/18] distutils-r1.eclass: Add "_trial_temp" to forbidden package names Michał Górny
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Arthur Zamarin
From: Arthur Zamarin <arthurzam@gentoo.org>
python_has_version is preferred as it gives nicer output and safer
defaults, instead of has_version.
---
eclass/python-any-r1.eclass | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 2051b5e89b81..fc66434cc6bf 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -139,7 +139,7 @@ EXPORT_FUNCTIONS pkg_setup
# Example use:
# @CODE
# python_check_deps() {
-# has_version "dev-python/foo[${PYTHON_USEDEP}]"
+# python_has_version "dev-python/foo[${PYTHON_USEDEP}]"
# }
# @CODE
#
@@ -161,7 +161,7 @@ EXPORT_FUNCTIONS pkg_setup
# Example use:
# @CODE
# python_check_deps() {
-# has_version "dev-python/bar[${PYTHON_SINGLE_USEDEP}]"
+# python_has_version "dev-python/bar[${PYTHON_SINGLE_USEDEP}]"
# }
# @CODE
#
@@ -228,9 +228,9 @@ if [[ ! ${_PYTHON_ANY_R1} ]]; then
# dev-python/baz[${PYTHON_USEDEP}] )')"
#
# python_check_deps() {
-# has_version "dev-python/foo[${PYTHON_SINGLE_USEDEP}]" \
-# && { has_version "dev-python/bar[${PYTHON_USEDEP}]" \
-# || has_version "dev-python/baz[${PYTHON_USEDEP}]"; }
+# python_has_version "dev-python/foo[${PYTHON_SINGLE_USEDEP}]" \
+# && { python_has_version "dev-python/bar[${PYTHON_USEDEP}]" \
+# || python_has_version "dev-python/baz[${PYTHON_USEDEP}]"; }
# }
# @CODE
#
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 17/18] distutils-r1.eclass: small docs format fixes
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (15 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 16/18] python-any-r1.eclass: use python_has_version in examples Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 18/18] distutils-r1.eclass: Add "_trial_temp" to forbidden package names Michał Górny
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Arthur Zamarin
From: Arthur Zamarin <arthurzam@gentoo.org>
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
---
eclass/distutils-r1.eclass | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 30f7d941f0d4..9536e5c466be 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -119,7 +119,7 @@ esac
# - sip - sipbuild backend
#
# - standalone - standalone build systems without external deps
-# (used for bootstrapping).
+# (used for bootstrapping).
#
# The variable needs to be set before the inherit line. The eclass
# adds appropriate build-time dependencies and verifies the value.
@@ -149,10 +149,10 @@ esac
# - rdepend -- add it to BDEPEND+RDEPEND (e.g. when using pkg_resources)
#
# - pyproject.toml -- use pyproject2setuptools to install a project
-# using pyproject.toml (flit, poetry...)
+# using pyproject.toml (flit, poetry...)
#
# - manual -- do not add the dependency and suppress the checks
-# (assumes you will take care of doing it correctly)
+# (assumes you will take care of doing it correctly)
#
# This variable is effective only if DISTUTILS_OPTIONAL is disabled.
# It is available only in non-PEP517 mode. It needs to be set before
@@ -628,8 +628,11 @@ distutils_enable_tests() {
# (if ${EPYTHON} is set; fallback 'python' otherwise).
#
# setup.py will be passed the following, in order:
+#
# 1. ${DISTUTILS_ARGS[@]}
+#
# 2. ${mydistutilsargs[@]} (deprecated)
+#
# 3. additional arguments passed to the esetup.py function.
#
# Please note that setup.py will respect defaults (unless overridden
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-dev] [PATCH 18/18] distutils-r1.eclass: Add "_trial_temp" to forbidden package names
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
` (16 preceding siblings ...)
2022-06-04 9:03 ` [gentoo-dev] [PATCH 17/18] distutils-r1.eclass: small docs format fixes Michał Górny
@ 2022-06-04 9:03 ` Michał Górny
17 siblings, 0 replies; 19+ messages in thread
From: Michał Górny @ 2022-06-04 9:03 UTC (permalink / raw
To: gentoo-dev; +Cc: Michał Górny
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
eclass/distutils-r1.eclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 9536e5c466be..db5cced50952 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1884,7 +1884,7 @@ _distutils-r1_post_python_install() {
local forbidden_package_names=(
examples test tests
- .pytest_cache .hypothesis
+ .pytest_cache .hypothesis _trial_temp
)
local p
for p in "${forbidden_package_names[@]}"; do
--
2.35.1
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2022-06-04 9:09 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-04 9:03 [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & other patches Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 01/18] python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 02/18] distutils-r1.eclass: Support internal post-python_* phase functions Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 03/18] distutils-r1.eclass: Call egg-info cleanup via post-test phase Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 04/18] distutils-r1.eclass: Move install QA checks to post-phase function Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 05/18] distutils-r1.eclass: Remove the obsolete pypy/share check Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 06/18] distutils-r1.eclass: Make *-nspkg.pth warning fatal for EAPI 9+ Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 07/18] distutils-r1.eclass: Move venv/merge-root logic to post-phases Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 08/18] distutils-r1.eclass: Introduce DISTUTILS_USE_PEP517=no mode Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 09/18] python-utils-r1.eclass: Fix typo in python_moduleinto doc Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 10/18] python-utils-r1.eclass: Support python_domodule outside src_install Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 11/18] python-utils-r1.eclass: Add explicit checks for incorrect phase Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 12/18] dev-python/tomli: Use DISTUTILS_USE_PEP517=no Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 13/18] dev-python/installer: " Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 14/18] dev-python/gpep517: " Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 15/18] app-admin/gnome-abrt: " Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 16/18] python-any-r1.eclass: use python_has_version in examples Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 17/18] distutils-r1.eclass: small docs format fixes Michał Górny
2022-06-04 9:03 ` [gentoo-dev] [PATCH 18/18] distutils-r1.eclass: Add "_trial_temp" to forbidden package names Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox