summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* pypi.eclass: _pypi_translate_version _pre to .devTom Gillespie2023-07-171-0/+1
| | | | | | | | Implement automatic translation _pre to .dev for pypi SRC_URIs. Signed-off-by: Tom Gillespie <tgbugs@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/31861 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Do extglob reset unconditionallyMichał Górny2023-06-171-8/+6
| | | | | | | | | | | | | | | | | Change _pypi_normalize_name() to reset extglob unconditionally. This function is called only in two contexts: - inside a subshell, therefore making it unnecessary to restore the original extglob value, - in global scope, via _pypi_set_globals, where we know that extglob is not supposed to be set. This makes the code simpler. Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/31465 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Avoid subshell for extglob settingMichał Górny2023-06-151-4/+7
| | | | | | | | | | | | Suggested by Eli Schwartz. This gives roughly 5260 ops / s, over 550% speedup. The complete patch series therefore increases the speed from roughly 326 ops / s to 5260 ops / s, making the common case 16 times faster. Closes: https://bugs.gentoo.org/908411 Closes: https://github.com/gentoo/gentoo/pull/31404 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Replace pypi_sdist_url in global scopeMichał Górny2023-06-151-20/+33
| | | | | | | | Introduce an internal helper for _pypi_sdist_url that doesn't require subshell, and therefore eliminate all subshells from global scope. We're nearing 952 ops / s, further 39% speedup. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Translate version without subshell in common caseMichał Górny2023-06-151-11/+22
| | | | | | | | Provide an internal helper to translate versions without a subshell, and use it in the common case. Now the benchmark gives 685 ops / s, which means it's another 28% speedup. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Normalize names without subshellMichał Górny2023-06-151-12/+27
| | | | | | | Provide an internal helper to normalize names without a subshell. This gives 535 ops / s, so a further 44% speedup. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Translate version once in the default scenarioMichał Górny2023-06-151-4/+6
| | | | | | | | Instead of translating version two times, once in pypi_sdist_url and then when setting S, do it once and store the result. This gives roughly 371 ops / s, i.e. a 13% speedup. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Move setting globals to a functionMichał Górny2023-06-151-7/+15
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: fix spellingSam James2023-03-261-1/+1
| | | | | | | Thanks to codespell. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* pypi.eclass: Quote argument of ":" commandUlrich Müller2023-03-261-1/+1
| | | | | | This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* pypi.eclass: Fix typo, thanks to laumann for reportingMichał Górny2023-03-221-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Introduce PYPI_PN to override the default project nameMichał Górny2023-03-211-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Closes: https://github.com/gentoo/gentoo/pull/30210 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Fix @CODE eclassdoc tagMichał Górny2023-02-221-2/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Add PYPI_NO_NORMALIZE control varMichał Górny2023-02-121-3/+16
| | | | | Closes: https://github.com/gentoo/gentoo/pull/29526 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Normalize PN and translate PV for S as wellMichał Górny2023-02-121-5/+14
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Translate ${PV} by defaultMichał Górny2023-02-121-6/+15
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Add a version translation functionMichał Górny2023-02-121-0/+19
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Normalize sdist filenames by defaultMichał Górny2023-02-121-4/+19
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Add `--unpack` to usage error in pypi_wheel_urlMichał Górny2023-02-121-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Normalize wheel filenamesMichał Górny2023-02-121-2/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Add a name normalization functionMichał Górny2023-02-121-0/+20
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Use pypi_sdist_url to generate the default SRC_URIMichał Górny2023-02-121-4/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Support --unpack in pypi_wheel_urlMichał Górny2023-02-071-7/+19
| | | | | | | | | | Add a handy `--unpack` option to pypi_wheel_url, that automatically renames the downloaded distfile to have .zip suffix. This is used e.g. in dev-python/installer and dev-python/tomli to have default_src_unpack unpack the wheels automatically. Closes: https://github.com/gentoo/gentoo/pull/29439 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Permit EAPI 7Michał Górny2023-02-071-2/+2
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: Make package optional as wellMichał Górny2023-02-051-9/+15
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* pypi.eclass: A new eclass to aid creating PyPI SRC_URIsMichał Górny2023-02-051-0/+117
Closes: https://github.com/gentoo/gentoo/pull/29361 Signed-off-by: Michał Górny <mgorny@gentoo.org>