• [gentoo-dev] [PATCH 00/18] distutils-r1.eclass D_U_PEP517=no mode & oth

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Jun 4 11:10:02 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Jun 4 11:10:02 2022
    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
    +"
    +
    +