commit:     6fc4d18834527570d23b61f4d79c8e802f0fda09
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 21 12:19:30 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Oct 21 12:19:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6fc4d188

dev-python/treq: Unbundle dev-python/multipart

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/treq/treq-24.9.1-r1.ebuild | 55 +++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/dev-python/treq/treq-24.9.1-r1.ebuild 
b/dev-python/treq/treq-24.9.1-r1.ebuild
new file mode 100644
index 000000000000..b38122a47ab8
--- /dev/null
+++ b/dev-python/treq/treq-24.9.1-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+
+inherit distutils-r1 pypi
+
+DESCRIPTION="A requests-like API built on top of twisted.web's Agent"
+HOMEPAGE="
+       https://github.com/twisted/treq/
+       https://pypi.org/project/treq/
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       dev-python/attrs[${PYTHON_USEDEP}]
+       >=dev-python/hyperlink-21.0.0[${PYTHON_USEDEP}]
+       dev-python/incremental[${PYTHON_USEDEP}]
+       dev-python/multipart[${PYTHON_USEDEP}]
+       >=dev-python/requests-2.1.0[${PYTHON_USEDEP}]
+       >=dev-python/twisted-18.7.0[ssl(-),${PYTHON_USEDEP}]
+       >=dev-python/typing-extensions-3.10.0[${PYTHON_USEDEP}]
+"
+BDEPEND="
+       dev-python/incremental[${PYTHON_USEDEP}]
+       test? (
+               dev-python/httpbin[${PYTHON_USEDEP}]
+       )
+"
+
+distutils_enable_sphinx docs
+
+src_prepare() {
+       distutils-r1_src_prepare
+
+       # fix relative path for docs generation
+       sed -e 's@("..")@("../src")@' -i docs/conf.py || die
+
+       # unbundle multipart
+       rm src/treq/_multipart.py || die
+       find -name '*.py' -exec \
+               sed -i -e 's:from [.]\+_multipart:from multipart:' {} + || die
+}
+
+python_test() {
+       "${EPYTHON}" -m twisted.trial treq || die "Tests failed with ${EPYTHON}"
+}

Reply via email to