On Sat, 2023-02-11 at 10:16 +0100, Michał Górny wrote:
> Hi,
>
> Here's a major patchset to the recently committed pypi.eclass (i.e.
> the "change while it's still warm and not used much" kind).
>
> It focuses on two significant changes:
>
> 1. Normalizing filenames according to the current sdist/wheel standards.
>
> 2. Translating Gentoo-specific components in ${PV} to the corresponding
> standard Python versions.
>
> The former change is focused on improving correctness (i.e. sometimes
> the current API didn't allow for getting the correct URI), the latter
> on convenience (i.e. not having to override ${PV} sometimes).
>
> For example, a package called "Test-Package-1.2.3_beta4" that followed
> PEP 625 (e.g. by using Hatchling) would require an ebuild calling
> the equivalent of:
>
> $(pypi_sdist_url "test_package" "${PV/_beta/b}")
>
> while now it will work out of the box.
>
> Unfortunately, PEP 625 is not yet universally followed, so many packages
> will instead need to:
>
> $(pypi_sdist_url --no-normalize)
>
> but I think following the standard immediately and requiring a number
> of `--no-normalize` calls is better than doing it the other way around
> and then switching the defaults, even if the majority of affected
> packages use "legacy" naming right now.
>
> That said, this only affects packages with uppercase letters, "-" or "."
> in their names.
>
A minute after sending this I've realized that we need to apply the same
operations to S as well. In reply, I'm adding two more patches that
respectively:
1) perform normalization and translation in S by default (i.e. make it
match the default SRC_URI),
2) add a more convenient PYPI_NO_NORMALIZE variable that can be used to
control whether SRC_URI and S use normalized or legacy names.
--
Best regards,
Michał Górny