public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/requests/, dev-python/requests/files/
Date: Sun, 26 Jun 2022 06:47:54 +0000 (UTC)	[thread overview]
Message-ID: <1656226068.3d1e085725f9968e622a29d985c5e18c1ab25efc.sam@gentoo> (raw)

commit:     3d1e085725f9968e622a29d985c5e18c1ab25efc
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 26 06:47:23 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 26 06:47:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d1e0857

dev-python/requests: unpin chardet

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../requests-2.28.0-drop-dependency-warnings.patch | 21 ++++++
 .../files/requests-2.28.0-unpin-chardet.patch      | 37 +++++++++++
 dev-python/requests/requests-2.28.0-r2.ebuild      | 74 ++++++++++++++++++++++
 3 files changed, 132 insertions(+)

diff --git a/dev-python/requests/files/requests-2.28.0-drop-dependency-warnings.patch b/dev-python/requests/files/requests-2.28.0-drop-dependency-warnings.patch
new file mode 100644
index 000000000000..ec3634966a07
--- /dev/null
+++ b/dev-python/requests/files/requests-2.28.0-drop-dependency-warnings.patch
@@ -0,0 +1,21 @@
+Minimal patch to avoid often rebasing.
+
+We already have tools to try check for these (`pip check` obviously, but also
+app-portage/gpyutils provides gpy-verify-deps).
+--- a/requests/__init__.py
++++ b/requests/__init__.py
+@@ -106,13 +106,7 @@ try:
+         urllib3.__version__, chardet_version, charset_normalizer_version
+     )
+ except (AssertionError, ValueError):
+-    warnings.warn(
+-        "urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported "
+-        "version!".format(
+-            urllib3.__version__, chardet_version, charset_normalizer_version
+-        ),
+-        RequestsDependencyWarning,
+-    )
++    pass
+ 
+ # Attempt to enable urllib3's fallback for SNI support
+ # if the standard library doesn't support SNI or the

diff --git a/dev-python/requests/files/requests-2.28.0-unpin-chardet.patch b/dev-python/requests/files/requests-2.28.0-unpin-chardet.patch
new file mode 100644
index 000000000000..bd0451daaf13
--- /dev/null
+++ b/dev-python/requests/files/requests-2.28.0-unpin-chardet.patch
@@ -0,0 +1,37 @@
+https://github.com/psf/requests/pull/6179
+
+From 09483bae4f56e4f4c227e2d25ee920c538271feb Mon Sep 17 00:00:00 2001
+From: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
+Date: Sun, 26 Jun 2022 12:18:42 +0800
+Subject: [PATCH] Update Dependency with `chardet>=3.0.2,<6`
+
+https://github.com/chardet/chardet/releases/tag/5.0.0 was released on
+2022-06-25 with remove of Python 3.6 support, which also align with our
+Python > 3.6 requirement.
+
+Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
+--- a/requests/__init__.py
++++ b/requests/__init__.py
+@@ -75,8 +75,8 @@ def check_compatibility(urllib3_version, chardet_version, charset_normalizer_ver
+     if chardet_version:
+         major, minor, patch = chardet_version.split(".")[:3]
+         major, minor, patch = int(major), int(minor), int(patch)
+-        # chardet_version >= 3.0.2, < 5.0.0
+-        assert (3, 0, 2) <= (major, minor, patch) < (5, 0, 0)
++        # chardet_version >= 3.0.2, < 6.0.0
++        assert (3, 0, 2) <= (major, minor, patch) < (6, 0, 0)
+     elif charset_normalizer_version:
+         major, minor, patch = charset_normalizer_version.split(".")[:3]
+         major, minor, patch = int(major), int(minor), int(patch)
+--- a/setup.py
++++ b/setup.py
+@@ -123,7 +123,7 @@ def run_tests(self):
+     extras_require={
+         "security": [],
+         "socks": ["PySocks>=1.5.6, !=1.5.7"],
+-        "use_chardet_on_py3": ["chardet>=3.0.2,<5"],
++        "use_chardet_on_py3": ["chardet>=3.0.2,<6"],
+     },
+     project_urls={
+         "Documentation": "https://requests.readthedocs.io",
+

diff --git a/dev-python/requests/requests-2.28.0-r2.ebuild b/dev-python/requests/requests-2.28.0-r2.ebuild
new file mode 100644
index 000000000000..c3c23c38db26
--- /dev/null
+++ b/dev-python/requests/requests-2.28.0-r2.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# please keep this ebuild at EAPI 7 -- sys-apps/portage dep
+EAPI=7
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..11} pypy3 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1
+
+DESCRIPTION="HTTP library for human beings"
+HOMEPAGE="
+	https://requests.readthedocs.io/
+	https://github.com/psf/requests/
+	https://pypi.org/project/requests/
+"
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="socks5"
+
+RDEPEND="
+	>=dev-python/certifi-2017.4.17[${PYTHON_USEDEP}]
+	dev-python/charset_normalizer[${PYTHON_USEDEP}]
+	<dev-python/idna-4[${PYTHON_USEDEP}]
+	<dev-python/urllib3-1.27[${PYTHON_USEDEP}]
+	socks5? ( >=dev-python/PySocks-1.5.6[${PYTHON_USEDEP}] )
+"
+
+BDEPEND="
+	test? (
+		dev-python/pytest-httpbin[${PYTHON_USEDEP}]
+		dev-python/pytest-mock[${PYTHON_USEDEP}]
+		>=dev-python/PySocks-1.5.6[${PYTHON_USEDEP}]
+		!alpha? ( !hppa? ( !ia64? (
+			dev-python/trustme[${PYTHON_USEDEP}]
+		) ) )
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.28.0-unpin-charset-normalizer.patch
+	"${FILESDIR}"/${PN}-2.28.0-unpin-chardet.patch
+	"${FILESDIR}"/${PN}-2.28.0-drop-dependency-warnings.patch
+)
+
+distutils_enable_tests pytest
+
+python_test() {
+	local EPYTEST_DESELECT=(
+		# Internet (doctests)
+		requests/__init__.py::requests
+		requests/api.py::requests.api.request
+		requests/models.py::requests.models.PreparedRequest
+		requests/sessions.py::requests.sessions.Session
+		# require IPv4 interface in 10.* range
+		tests/test_requests.py::TestTimeout::test_connect_timeout
+		tests/test_requests.py::TestTimeout::test_total_timeout_connect
+		# TODO: openssl?
+		tests/test_requests.py::TestRequests::test_pyopenssl_redirect
+	)
+
+	if ! has_version "dev-python/trustme[${PYTHON_USEDEP}]"; then
+		EPYTEST_DESELECT+=(
+			tests/test_requests.py::TestRequests::test_https_warnings
+		)
+	fi
+
+	epytest
+}


             reply	other threads:[~2022-06-26  6:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-26  6:47 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-21 12:44 [gentoo-commits] repo/gentoo:master commit in: dev-python/requests/, dev-python/requests/files/ Michał Górny
2023-02-16 20:28 Michał Górny
2022-10-23  5:39 Michał Górny
2022-06-21 22:58 Sam James
2021-11-27 10:27 Michał Górny
2021-07-28  9:08 Michał Górny
2019-01-27 17:16 Virgil Dupras
2018-01-06 14:13 Michał Górny
2017-05-15 15:48 Manuel Rüger
2017-05-03 11:48 Manuel Rüger
2016-11-30 13:54 Lars Wendler
2016-01-21 11:43 Justin Lecher

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=1656226068.3d1e085725f9968e622a29d985c5e18c1ab25efc.sam@gentoo \
    --to=sam@gentoo.org \
    --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