From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D3F6D158094 for ; Sun, 26 Jun 2022 06:47:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 246D9E08BB; Sun, 26 Jun 2022 06:47:57 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 00758E08BB for ; Sun, 26 Jun 2022 06:47:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 12CDB3415D5 for ; Sun, 26 Jun 2022 06:47:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8CC9D480 for ; Sun, 26 Jun 2022 06:47:54 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1656226068.3d1e085725f9968e622a29d985c5e18c1ab25efc.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/requests/, dev-python/requests/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/requests/files/requests-2.28.0-drop-dependency-warnings.patch dev-python/requests/files/requests-2.28.0-unpin-chardet.patch dev-python/requests/requests-2.28.0-r2.ebuild X-VCS-Directories: dev-python/requests/ dev-python/requests/files/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 3d1e085725f9968e622a29d985c5e18c1ab25efc X-VCS-Branch: master Date: Sun, 26 Jun 2022 06:47:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4d5de08e-f614-445a-8c0a-f0728c0346b1 X-Archives-Hash: aba73762a72e9243aad93cc7deff13b6 commit: 3d1e085725f9968e622a29d985c5e18c1ab25efc Author: Sam James gentoo org> AuthorDate: Sun Jun 26 06:47:23 2022 +0000 Commit: Sam James gentoo 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 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 +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 +--- 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/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 +}