diff options
| author | Michał Górny <mgorny@gentoo.org> | 2024-10-18 15:13:06 +0200 |
|---|---|---|
| committer | Michał Górny <mgorny@gentoo.org> | 2024-10-19 10:53:00 +0200 |
| commit | 6afa196ca0cb1604875847b1b84fa64896a06f6e (patch) | |
| tree | 0b636b2323d1d7363b064759937f45288a55ebb6 /dev-python/python-multipart/python-multipart-0.0.12-r100.ebuild | |
| parent | 6c960e0d20f389a88c6a5044c7c4e3e42d03e254 (diff) | |
| download | gentoo-6afa196ca0cb1604875847b1b84fa64896a06f6e.tar.gz gentoo-6afa196ca0cb1604875847b1b84fa64896a06f6e.tar.bz2 gentoo-6afa196ca0cb1604875847b1b84fa64896a06f6e.zip | |
dev-python/python-multipart: Hard-rename to python_multipart
Hard-rename the Python package to `python_multipart`, to avoid conflicts
with the `multipart` PyPI package.
Both `multipart` and `python-multipart` packages install using
`multipart` import name, therefore both cannot be installed at the same
time. Historically, we have included only the latter in Gentoo, since
it was pulled in as a dependency of dev-python/starlette. However,
the former was recently made the recommended replacement
for the deprecated and removed `cgi` standard library module, therefore
other packages started depending on it.
Given that both packages intend to be maintained throughout
the foreseeable future, it seems that the best workaround is to rename
one of them. In this case, `python-multipart` uses an import name
that does not match the package and seems to be have fewer reverse
dependencies at this time, so rename it. There is already an open pull
request upstream to do exactly that, so reuse parts of it. That said,
since we can simply patch reverse dependencies, we do not need
the compatibility layer (and probably do not want it, as it could yield
confusing errors if the wrong package is installed).
Bug: https://github.com/pypa/packaging-problems/issues/818
Pull-Request: https://github.com/Kludex/python-multipart/pull/166
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/python-multipart/python-multipart-0.0.12-r100.ebuild')
| -rw-r--r-- | dev-python/python-multipart/python-multipart-0.0.12-r100.ebuild | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dev-python/python-multipart/python-multipart-0.0.12-r100.ebuild b/dev-python/python-multipart/python-multipart-0.0.12-r100.ebuild new file mode 100644 index 0000000000000..ea54218ea5645 --- /dev/null +++ b/dev-python/python-multipart/python-multipart-0.0.12-r100.ebuild @@ -0,0 +1,47 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=hatchling +PYTHON_COMPAT=( pypy3 python3_{10..13} ) + +inherit distutils-r1 + +DESCRIPTION="A streaming multipart parser for Python" +HOMEPAGE=" + https://github.com/Kludex/python-multipart/ + https://pypi.org/project/python-multipart/ +" +SRC_URI=" + https://github.com/Kludex/python-multipart/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + +BDEPEND=" + test? ( + dev-python/pyyaml[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +src_prepare() { + local PATCHES=( + # https://github.com/Kludex/python-multipart/pull/166 + "${FILESDIR}/${P}-rename.patch" + ) + + distutils-r1_src_prepare + + mv multipart python_multipart || die +} + +python_test() { + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest +} |
