public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Kyle Elbert" <kcelbert@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/cloudflare/
Date: Tue, 18 Mar 2025 06:40:30 +0000 (UTC)	[thread overview]
Message-ID: <1742278983.07a81a47e5fcb9d4b7f8f1ddae4212bd88f5c919.kcelbert@gentoo> (raw)

commit:     07a81a47e5fcb9d4b7f8f1ddae4212bd88f5c919
Author:     Kyle Elbert <kcelbert <AT> gmail <DOT> com>
AuthorDate: Tue Mar 18 05:47:44 2025 +0000
Commit:     Kyle Elbert <kcelbert <AT> gmail <DOT> com>
CommitDate: Tue Mar 18 06:23:03 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=07a81a47

dev-python/cloudflare: add 4.1.0

Signed-off-by: Kyle Elbert <kcelbert <AT> gmail.com>

 dev-python/cloudflare/Manifest                |   2 +
 dev-python/cloudflare/cloudflare-4.1.0.ebuild | 103 ++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)

diff --git a/dev-python/cloudflare/Manifest b/dev-python/cloudflare/Manifest
index f6b85cb49..4a80f432a 100644
--- a/dev-python/cloudflare/Manifest
+++ b/dev-python/cloudflare/Manifest
@@ -1,3 +1,5 @@
 DIST cloudflare-2.19.4.gh.tar.gz 151397 BLAKE2B c91c95f52314c5177d823ef8f827ea2f76f6cc703260449aea12d54c1b77d061feca15d4bb845f84cfb4fd80789e5064e54d7530daf546d54d17054b9e0b4fda SHA512 8ae11e73760c57b610abfe5e2c8fdc83c2e0b9e07340884925ec9ac3bf5b40b4edf39b2b8ce7330538369d7573146a2ddac195efb0efb4ff657f75fdacb31aed
 DIST cloudflare-4.0.0.gh.tar.gz 1715334 BLAKE2B 3ec5ace00c173caec36e75001a7f0fb08e3747902cfbd45a29958c7d4a124b93b24c431ed0967d2100056de7b3063625379723512aee4be7a03dfeb2c4bdbc5a SHA512 ac156af42cadfd1c63568df485c816de0b3720af18ec12b25cb88e06476e817707a29de91bfce8da3b7f7b4e690b6c33aa6c38bc2b485901e81e032dae0d0109
+DIST cloudflare-4.1.0.gh.tar.gz 1919098 BLAKE2B 00282a75357e1b6368b9c36f9abdf52547d42850f74c52d0cd2b1b02b26a717942167db59ba025eb1a6e874697299c79257c8e796874abcc742a9350374e2511 SHA512 bc61518791adc30b472b64407f336f5dd94ad5961c7c1fa474750b8d2579411db78592dd30ac731b05023c29105928bda0005185b07d54cf8b88f100eb1bf5ca
 DIST cloudflare-python-4.0.0-prism.tar.gz 10687934 BLAKE2B d8696ec3f20d56e8ed5578d96ff41e4b90faf8d440b734b76d7217b8127f1c428e523f75f266cd9a677a3501b961844107afb03b2ec06f9940aadbf369a3567e SHA512 0d622922f26f9a6749858f226ff8ac5baee613a771e9cbe16787932304b5c1654c1a6d928ce7fe4734bc0710f3357160dcbe441f9238ae8c33cde02435e169e8
+DIST cloudflare-python-4.1.0-prism.tar.gz 10768260 BLAKE2B baf23e1010417b770a7c26f7e806305a6431c917df527feb7277f72e35220e210b570cc67791fca911b450b0056c9d10824f6f90893abd6bd4b9bef933b4088d SHA512 05742179f53ce22bb9d3318069415bba9e94110ba14ea6a0eda991107c448fe35fb653d2863c4e3421e1062be2c8a963d2cc6bbe1187d9057378d144ce1fb3ac

diff --git a/dev-python/cloudflare/cloudflare-4.1.0.ebuild b/dev-python/cloudflare/cloudflare-4.1.0.ebuild
new file mode 100644
index 000000000..dca5b780d
--- /dev/null
+++ b/dev-python/cloudflare/cloudflare-4.1.0.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..13} )
+# upstream doesn't yet officially claim 3.13 support but passes tests and works
+DISTUTILS_USE_PEP517="hatchling"
+inherit distutils-r1
+DESCRIPTION="Python wrapper for the Cloudflare v4 API"
+HOMEPAGE="https://pypi.org/project/cloudflare/"
+if [ "${PV}" == 9999 ]; then
+	EGIT_REPO_URI="https://github.com/cloudflare/cloudflare-python"
+	inherit git-r3
+else
+	MYPV=$(ver_rs 3 -)
+	MYPV=${MYPV/beta/beta.}
+	MYPN="cloudflare-python"
+	SRC_URI="https://github.com/cloudflare/cloudflare-python/archive/refs/tags/v${MYPV}.tar.gz -> ${P}.gh.tar.gz
+		test? ( https://github.com/Phoenix591/${MYPN}/releases/download/${PV}/${MYPN}-${PV}-prism.tar.gz )"
+	#Prism archive generated by workflow
+	# https://github.com/Phoenix591/cloudflare-python/blob/master/.github/workflows/test-tar.yml
+	S="${WORKDIR}/${MYPN}-${MYPV}"
+	KEYWORDS="~amd64 ~arm64"
+fi
+LICENSE="MIT test? ( ISC Apache-2.0 MIT BSD CC0-1.0 0BSD )"
+# nodejs module and deps used to test
+SLOT="0"
+RDEPEND=" ${DEPEND}
+	>=dev-python/httpx-0.23.0[${PYTHON_USEDEP}]
+	>=dev-python/pydantic-2.9.2[${PYTHON_USEDEP}]
+	>=dev-python/typing-extensions-4.7.0[${PYTHON_USEDEP}]
+	>=dev-python/anyio-4.3.0[${PYTHON_USEDEP}]
+	>=dev-python/distro-1.7.0[${PYTHON_USEDEP}]
+	>=dev-python/sniffio-1.3.1[${PYTHON_USEDEP}]
+	 "
+
+BDEPEND="test? (
+	>=net-libs/nodejs-18.20.1
+	 dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+	 dev-python/time-machine[${PYTHON_USEDEP}]
+	 dev-python/dirty-equals[${PYTHON_USEDEP}]
+	 dev-python/respx[${PYTHON_USEDEP}]
+	${RDEPEND}
+)"
+
+distutils_enable_tests pytest
+RESTRICT+=" !test? ( test )"
+
+src_unpack() {
+	unpack "${P}.gh.tar.gz"
+	use test && cd "${S}" && unpack "cloudflare-python-${PV}-prism.tar.gz"
+}
+
+#python_prepare_all() {
+#	# don't install tests or examples
+#	sed -i -e "s/'cli4', 'examples'/'cli4'/" \
+#		-e "s#'CloudFlare/tests',##" \
+#		 setup.py || die
+#	sed -i -e "/def test_ips7_should_fail():/i@pytest.mark.xfail(reason='Now fails upstream')" \
+#		-e "2s/^/import pytest/" \
+#		CloudFlare/tests/test_cloudflare_calls.py || die
+#	distutils-r1_python_prepare_all
+#}
+
+python_test() {
+	# these 2 tests fail in an ebuild environment for some reason
+	# help appreciated
+	local EPYTEST_DESELECT=(
+	tests/test_client.py::TestCloudflare::test_validate_headers
+	tests/test_client.py::TestAsyncCloudflare::test_validate_headers )
+		#intermittently fail for unknown reasons, passed along to upstream
+		EPYTEST_DESELECT+=(
+		tests/test_client.py::TestAsyncCloudflare::test_copy_build_request
+		tests/test_client.py::TestCloudflare::test_copy_build_request
+		tests/test_client.py::TestAsyncCloudflare::test_get_platform
+)
+	epytest
+}
+
+src_test() {
+	start_mock
+	distutils-r1_src_test
+	stop_mock
+}
+start_mock() {
+# Run prism mock api server, this is what needs nodejs
+	node --no-warnings node_modules/@stainless-api/prism-cli/dist/index.js mock \
+		"cloudflare-spec.yml" >prism.log || die "Failed starting prism" &
+	echo $! >"${T}/mock.pid" || die
+	# Wait for server to come online
+	echo -n "Waiting for mockserver"
+	while ! grep -q "✖  fatal\|Prism is listening" "prism.log" ; do
+	    echo -n "." || die
+	    sleep 0.5
+	done
+	if grep -q "✖  fatal" prism.log; then
+		die "Prism mock server failed"
+	fi
+}
+stop_mock() {
+	kill $(cat "${T}/mock.pid") || die
+}


             reply	other threads:[~2025-03-18  6:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  6:40 Kyle Elbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-07-08  8:02 [gentoo-commits] repo/proj/guru:dev commit in: dev-python/cloudflare/ Kyle Elbert
2025-07-08  8:02 Kyle Elbert
2025-05-22  9:35 Kyle Elbert
2025-04-16 23:53 Kyle Elbert
2025-04-16 23:53 Kyle Elbert
2025-04-16 23:53 Kyle Elbert
2025-01-21  6:05 Kyle Elbert
2025-01-21  6:05 Kyle Elbert
2024-11-28  8:16 Kyle Elbert
2024-11-27 10:12 Kyle Elbert
2024-07-17  6:30 Kyle Elbert
2024-06-26 12:59 Kyle Elbert
2024-06-26 10:56 Kyle Elbert
2024-06-26 10:29 Kyle Elbert
2024-06-25 18:44 Kyle Elbert
2024-06-25  0:41 Kyle Elbert
2024-06-25  0:41 Kyle Elbert
2024-06-19  6:20 Kyle Elbert
2024-06-19  5:07 Kyle Elbert
2024-04-30  0:20 Kyle Elbert
2024-04-09 20:39 Kyle Elbert
2024-04-07 22:25 Kyle Elbert
2024-04-06 10:13 Kyle Elbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1742278983.07a81a47e5fcb9d4b7f8f1ddae4212bd88f5c919.kcelbert@gentoo \
    --to=kcelbert@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox