Merge ~lvoytek/ubuntu/+source/requests:merge-lp1993439-lunar into ubuntu/+source/requests:debian/sid

Proposed by Lena Voytek
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merge reported by: git-ubuntu bot
Merged at revision: 41366b415f1db8f6853b3295d41e43e56b50329a
Proposed branch: ~lvoytek/ubuntu/+source/requests:merge-lp1993439-lunar
Merge into: ubuntu/+source/requests:debian/sid
Diff against target: 241 lines (+198/-1)
5 files modified
debian/changelog (+24/-0)
debian/control (+2/-1)
debian/patches/0002-Fix-tests-with-HTTP-proxy.patch (+79/-0)
debian/patches/remove-charset-normalizer-dependency.patch (+91/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Sergio Durigan Junior (community) Approve
Canonical Server Reporter Pending
Review via email: mp+433797@code.launchpad.net

Description of the change

PPA: https://launchpad.net/~lvoytek/+archive/ubuntu/requests-merge-lunar

autopkgtest results:

autopkgtest [07:42:42]: @@@@@@@@@@@@@@@@@@@@ summary
python3-requests PASS

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

I'll take this one.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the MP, Lena.

Overall, the merge LGTM. I see you've refreshed the patches we're carrying. You can/should consider squashing those "Refresh" commits with their respective main commits. This is usually done in the "logical" step of the merge.

I think it's worth submitting the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011276 as a Merge Request on salsa instead. Apparently the maintainer is more responsive there.

Package builds fine and autopkgtest is OK. LGTM with the commit squashing done and the colons removed from the changelog entry. Let me know when it's ready and I'll be happy to sponsor.

review: Approve
6d77a86... by Lena Voytek

* Fix autopkgtest when http_proxy, https_proxy or no_proxy variable is set
  (LP: #1974182)

Revision history for this message
git-ubuntu bot (git-ubuntu-bot) wrote :

Approvers: sergiodj, lvoytek
Uploaders: sergiodj
MP auto-approved

review: Approve
ac46098... by Lena Voytek

reconstruct-changelog

Revision history for this message
Lena Voytek (lvoytek) wrote :

Thanks for the review! Fixed the commits and changelog

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Tuesday, November 29 2022, Lena Voytek wrote:

> Thanks for the review! Fixed the commits and changelog

Thanks, Lena.

Uploaded:

$ dput requests_2.28.1+dfsg-1ubuntu1_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/requests/requests_2.28.1+dfsg-1ubuntu1_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/requests/requests_2.28.1+dfsg-1ubuntu1.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading requests_2.28.1+dfsg-1ubuntu1.dsc: done.
  Uploading requests_2.28.1+dfsg.orig.tar.xz: done.
  Uploading requests_2.28.1+dfsg-1ubuntu1.debian.tar.xz: done.
  Uploading requests_2.28.1+dfsg-1ubuntu1_source.buildinfo: done.
  Uploading requests_2.28.1+dfsg-1ubuntu1_source.changes: done.
Successfully uploaded packages.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 56d6991..0f3d24e 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+requests (2.28.1+dfsg-1ubuntu1) lunar; urgency=medium
7+
8+ * Merge with Debian unstable (LP: #1993439). Remaining changes:
9+ - Fix autopkgtest when http_proxy, https_proxy or no_proxy variable is set
10+ (LP #1974182)
11+ - d/p/remove-charset-normalizer-dependency.patch: Remove charset-normalizer
12+ as a dependency of requests (LP #1975541)
13+
14+ -- Lena Voytek <lena.voytek@canonical.com> Mon, 28 Nov 2022 15:18:43 -0700
15+
16 requests (2.28.1+dfsg-1) unstable; urgency=medium
17
18 [ Lena Voytek ]
19@@ -12,6 +22,20 @@ requests (2.28.1+dfsg-1) unstable; urgency=medium
20
21 -- Daniele Tricoli <eriol@debian.org> Thu, 24 Nov 2022 00:23:09 +0100
22
23+requests (2.27.1+dfsg-1ubuntu2) kinetic; urgency=medium
24+
25+ * d/p/remove-charset-normalizer-dependency.patch: Remove charset-normalizer
26+ as a dependency of requests (LP: #1975541)
27+
28+ -- Lena Voytek <lena.voytek@canonical.com> Mon, 23 May 2022 15:06:07 -0700
29+
30+requests (2.27.1+dfsg-1ubuntu1) kinetic; urgency=medium
31+
32+ * Fix autopkgtest when http_proxy, https_proxy or no_proxy variable is set
33+ (LP: #1974182)
34+
35+ -- Olivier Gayot <olivier.gayot@canonical.com> Thu, 19 May 2022 14:14:07 +0200
36+
37 requests (2.27.1+dfsg-1) unstable; urgency=medium
38
39 [ root ]
40diff --git a/debian/control b/debian/control
41index 691d7e1..8141f29 100644
42--- a/debian/control
43+++ b/debian/control
44@@ -1,5 +1,6 @@
45 Source: requests
46-Maintainer: Debian Python Team <team+python@tracker.debian.org>
47+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
48+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
49 Uploaders: Daniele Tricoli <eriol@debian.org>
50 Section: python
51 Priority: optional
52diff --git a/debian/patches/0002-Fix-tests-with-HTTP-proxy.patch b/debian/patches/0002-Fix-tests-with-HTTP-proxy.patch
53new file mode 100644
54index 0000000..253a77f
55--- /dev/null
56+++ b/debian/patches/0002-Fix-tests-with-HTTP-proxy.patch
57@@ -0,0 +1,79 @@
58+Description: Fix autopkgtest when HTTP/HTTPS proxy is set
59+ The pytest suite does not expect the http_proxy, https_proxy and no_proxy
60+ variables to be present in the environment. They make pytest fail and
61+ therefore autopkgtest fail as well.
62+Author: Olivier Gayot <olivier.gayot@canonical.com>
63+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1011276
64+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/requests/+bug/1974182
65+Forwarded: no
66+Last-Update: 2022-11-28
67+---
68+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
69+--- a/tests/test_requests.py
70++++ b/tests/test_requests.py
71+@@ -578,8 +578,9 @@
72+ ),
73+ )
74+ def test_errors(self, url, exception):
75+- with pytest.raises(exception):
76+- requests.get(url, timeout=1)
77++ with override_environ(http_proxy=None, https_proxy=None):
78++ with pytest.raises(exception):
79++ requests.get(url, timeout=1)
80+
81+ def test_proxy_error(self):
82+ # any proxy related error (address resolution, no route to host, etc) should result in a ProxyError
83+@@ -602,14 +603,14 @@
84+ requests.get(httpbin(), proxies={"http": "http:///example.com:8080"})
85+
86+ def test_respect_proxy_env_on_send_self_prepared_request(self, httpbin):
87+- with override_environ(http_proxy=INVALID_PROXY):
88++ with override_environ(no_proxy=None, http_proxy=INVALID_PROXY):
89+ with pytest.raises(ProxyError):
90+ session = requests.Session()
91+ request = requests.Request("GET", httpbin())
92+ session.send(request.prepare())
93+
94+ def test_respect_proxy_env_on_send_session_prepared_request(self, httpbin):
95+- with override_environ(http_proxy=INVALID_PROXY):
96++ with override_environ(no_proxy=None, http_proxy=INVALID_PROXY):
97+ with pytest.raises(ProxyError):
98+ session = requests.Session()
99+ request = requests.Request("GET", httpbin())
100+@@ -617,7 +618,7 @@
101+ session.send(prepared)
102+
103+ def test_respect_proxy_env_on_send_with_redirects(self, httpbin):
104+- with override_environ(http_proxy=INVALID_PROXY):
105++ with override_environ(no_proxy=None, http_proxy=INVALID_PROXY):
106+ with pytest.raises(ProxyError):
107+ session = requests.Session()
108+ url = httpbin("redirect/1")
109+@@ -626,13 +627,13 @@
110+ session.send(request.prepare())
111+
112+ def test_respect_proxy_env_on_get(self, httpbin):
113+- with override_environ(http_proxy=INVALID_PROXY):
114++ with override_environ(no_proxy=None, http_proxy=INVALID_PROXY):
115+ with pytest.raises(ProxyError):
116+ session = requests.Session()
117+ session.get(httpbin())
118+
119+ def test_respect_proxy_env_on_request(self, httpbin):
120+- with override_environ(http_proxy=INVALID_PROXY):
121++ with override_environ(no_proxy=None, http_proxy=INVALID_PROXY):
122+ with pytest.raises(ProxyError):
123+ session = requests.Session()
124+ session.request(method="GET", url=httpbin())
125+--- a/tests/utils.py
126++++ b/tests/utils.py
127+@@ -7,7 +7,8 @@
128+ save_env = dict(os.environ)
129+ for key, value in kwargs.items():
130+ if value is None:
131+- del os.environ[key]
132++ with contextlib.suppress(KeyError):
133++ del os.environ[key]
134+ else:
135+ os.environ[key] = value
136+ try:
137diff --git a/debian/patches/remove-charset-normalizer-dependency.patch b/debian/patches/remove-charset-normalizer-dependency.patch
138new file mode 100644
139index 0000000..cbe58c0
140--- /dev/null
141+++ b/debian/patches/remove-charset-normalizer-dependency.patch
142@@ -0,0 +1,91 @@
143+Description: Remove charset-normalizer package as a backup to chardet
144+ Since requests can use either chardet or charset-normalizer for character set
145+ interpretations, and charset-normalizer is in universe, remove it as a
146+ dependency to keep requests in main without issues.
147+Forwarded: not-needed
148+X-Not-Forwarded-Reason: charset-normalizer being in universe is Ubuntu-specific
149+Author: Lena Voytek <lena.voytek@canonical.com>
150+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/requests/+bug/1975541
151+Last-Update: 2022-11-28
152+---
153+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
154+--- a/requests/compat.py
155++++ b/requests/compat.py
156+@@ -7,11 +7,7 @@
157+ compatibility until the next major version.
158+ """
159+
160+-try:
161+- import chardet
162+-except ImportError:
163+- import charset_normalizer as chardet
164+-
165++import chardet
166+ import sys
167+
168+ # -------
169+--- a/requests/help.py
170++++ b/requests/help.py
171+@@ -10,10 +10,7 @@
172+
173+ from . import __version__ as requests_version
174+
175+-try:
176+- import charset_normalizer
177+-except ImportError:
178+- charset_normalizer = None
179++charset_normalizer = None
180+
181+ try:
182+ import chardet
183+@@ -112,7 +109,7 @@
184+ "implementation": implementation_info,
185+ "system_ssl": system_ssl_info,
186+ "using_pyopenssl": pyopenssl is not None,
187+- "using_charset_normalizer": chardet is None,
188++ "using_charset_normalizer": False,
189+ "pyOpenSSL": pyopenssl_info,
190+ "urllib3": urllib3_info,
191+ "chardet": chardet_info,
192+--- a/requests/__init__.py
193++++ b/requests/__init__.py
194+@@ -44,10 +44,7 @@
195+
196+ from .exceptions import RequestsDependencyWarning
197+
198+-try:
199+- from charset_normalizer import __version__ as charset_normalizer_version
200+-except ImportError:
201+- charset_normalizer_version = None
202++charset_normalizer_version = None
203+
204+ try:
205+ from chardet import __version__ as chardet_version
206+--- a/requests/packages.py
207++++ b/requests/packages.py
208+@@ -1,13 +1,5 @@
209+ import sys
210+-
211+-try:
212+- import chardet
213+-except ImportError:
214+- import warnings
215+-
216+- import charset_normalizer as chardet
217+-
218+- warnings.filterwarnings("ignore", "Trying to detect", module="charset_normalizer")
219++import chardet
220+
221+ # This code exists for backwards compatibility reasons.
222+ # I don't like it either. Just look the other way. :)
223+--- a/setup.py
224++++ b/setup.py
225+@@ -59,7 +59,7 @@
226+ sys.exit()
227+
228+ requires = [
229+- "charset_normalizer>=2,<3",
230++ "chardet>=3.0.2,<5",
231+ "idna>=2.5,<4",
232+ "urllib3>=1.21.1,<1.27",
233+ "certifi>=2017.4.17",
234diff --git a/debian/patches/series b/debian/patches/series
235index db9dfd8..81e1af9 100644
236--- a/debian/patches/series
237+++ b/debian/patches/series
238@@ -1 +1,3 @@
239 0001-Remove-remote-images-traking-code-and-ads.patch
240+0002-Fix-tests-with-HTTP-proxy.patch
241+remove-charset-normalizer-dependency.patch

Subscribers

People subscribed via source and target branches