• [gentoo-dev] [PATCH 1/2] pypi.eclass: Introduce PYPI_PN to override the

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Mar 18 16:30:01 2023
    Introduce a convenience PYPI_PN variable that can be used to override
    the default project name. This is meant to be used primarily when
    upstream project name does not conform to Gentoo package naming rules,
    e.g. contains dots or uppercase letters.

    For example, instead of:

    SRC_URI="$(pypi_sdist_url --no-normalize "${PN/-/.}")"
    S=${WORKDIR}/${P/-/.}

    one can now specify:

    PYPI_NO_NORMALIZE=1
    PYPI_PN=${PN/-/.}

    For PEP 625-conformant packages, instead of:

    SRC_URI="$(pypi_sdist_url "${PN/-/.}")"

    one can use:

    PYPI_PN=${PN/-/.}

    There's not much gain space-wise but it avoids having to specify
    the name twice. This can particularly be helpful for package names
    using PascalCase.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/pypi.eclass | 35 ++++++++++++++++++++++++-----------
    eclass/tests/pypi.sh | 3 ++-
    2 files changed, 26 insertions(+), 12 deletions(-)

    diff --git a/eclass/pypi.eclass b/eclass/pypi.eclass
    index 79007a2ad0ed..ca3b6f67803d 100644
    --- a/eclass/pypi.eclass
    +++ b/eclass/pypi.eclass
    @@ -50,6 +50,19 @@ _PYPI_ECLASS=1
    # When set to a non-empty value, disables project name normalization
    # for the default SRC_URI and S values.

    +# @ECLASS_VARIABLE: PYPI_PN
    +# @PRE_INHERIT
    +# @DESCRIPTION:
    +# The PyPI project name. This should be overriden scarcely, generally
    +# when upstream project name does not conform to Gentoo naming rules,
    +# e.g. when it contains dots or uppercase letters.
    +#
    +# Example use:
    +# @CODE
    +# PYPI_PN=${PN/-/.}
    +# @CODE
    +: ${PYPI_PN:=${PN}}
    +
    # @FUNCTION: pypi_normalize_name
    # @USAGE: <name>
    # @DESCRIPTION:
    @@ -99,9 +112,9 @@ pypi_translate_version() {
    # generated using build systems that did not follow PEP 625
    # (i.e. the sdist name contains upperc
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Mar 18 16:30:01 2023
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    dev-python/zope-interface/zope-interface-6.0.ebuild | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/dev-python/zope-interface/zope-interface-6.0.ebuild b/dev-python/zope-interface/zope-interface-6.0.ebuild
    index 71c1fab1a966..9e89f69efab2 100644
    --- a/dev-python/zope-interface/zope-interface-6.0.ebuild
    +++ b/dev-python/zope-interface/zope-interface-6.0.ebuild
    @@ -4,6 +4,8 @@
    EAPI=8

    DISTUTILS_USE_PEP517=setuptools
    +PYPI_NO_NORMALIZE=1
    +PYPI_PN=${PN/-/.}
    PYTHON_COMPAT=( python3_{9..11} pypy3 )

    inherit distutils-r1 pypi
    @@ -13,8 +15,6 @@ HOMEPAGE="
    https://github.com/zopefoundation/zope.interface/
    https://pypi.org/project/zope.interface/
    "
    -SRC_URI="$(pypi_sdist_url --no-normalize "${PN/-/.}")"
    -S=${WORKDIR}/${P/-/.}

    LICENSE="ZPL"
    SLOT="0"
    --
    2.40.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)