Merge ~lvoytek/ubuntu/+source/requests:remove-charset-normalizer-pybuild into ubuntu/+source/requests:ubuntu/devel

Proposed by Lena Voytek
Status: Merged
Approved by: git-ubuntu bot
Approved revision: not available
Merge reported by: Lena Voytek
Merged at revision: 69f695c3d2ee90618aaea6fcb4f6714daff5cf44
Proposed branch: ~lvoytek/ubuntu/+source/requests:remove-charset-normalizer-pybuild
Merge into: ubuntu/+source/requests:ubuntu/devel
Diff against target: 76 lines (+45/-1)
4 files modified
debian/changelog (+7/-0)
debian/control (+2/-1)
debian/patches/remove-charset-normalizer-dependency.patch (+35/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
git-ubuntu bot Approve
Bryce Harrington (community) Approve
Canonical Server Reporter Pending
Review via email: mp+468280@code.launchpad.net

Description of the change

With the latest requests sync, pybuild automatically extracts the charset_normalizer dependency and attempts to install it for building. Since requests is in main, it can't use this universe dependency. This update readds and cleans up the charset_normalizer removal patch in favor of chardet

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

The latest build shows that python3-charset-normalizer is not installed

test results:
  - requests/2.32.3+dfsg-1ubuntu1~ppa8
    + ✅ requests on oracular for amd64 @ 26.06.24 19:02:18

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Confirmed charset-normalizer is in universe, and makes sense that this delta will be ubuntu-specific.

I wonder if the reason chardet is in main is due to security concerns for charset-normalizer; if that is the case then it might be relevant to suggest Debian shift as well. But if the choice is just to keep duplicative code out of main, then yeah this can just live as delta from here. Thanks for annotating the change!

### Debian ###
python-charset-normalizer | 3.0.1-2 | bookworm
python-charset-normalizer | 3.3.2-1 | trixie
python-charset-normalizer | 3.3.2-1 | sid

### Ubuntu ###
python-charset-normalizer | 2.0.6-2 | jammy/universe
python-charset-normalizer | 3.2.0-1 | mantic/universe
python-charset-normalizer | 3.3.2-1 | noble/universe
python-charset-normalizer | 3.3.2-1 | oracular/universe

Test results, packaging and change itself LGTM, +1.

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

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

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

Thanks Bryce! Uploaded

dput ubuntu ../requests_2.32.3+dfsg-1ubuntu1_source.changes
D: Setting host argument.
Checking signature on .changes
gpg: ../requests_2.32.3+dfsg-1ubuntu1_source.changes: Valid signature from 34B8AD7D9529E793
Checking signature on .dsc
gpg: ../requests_2.32.3+dfsg-1ubuntu1.dsc: Valid signature from 34B8AD7D9529E793
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading requests_2.32.3+dfsg-1ubuntu1.dsc: done.
  Uploading requests_2.32.3+dfsg-1ubuntu1.debian.tar.xz: done.
  Uploading requests_2.32.3+dfsg-1ubuntu1_source.buildinfo: done.
  Uploading requests_2.32.3+dfsg-1ubuntu1_source.changes: done.
Successfully uploaded packages.

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

Also for reference, yeah the MIR was rejected due to duplication of chardet's functionality:
https://bugs.launchpad.net/ubuntu/+source/python-charset-normalizer/+bug/1977475

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 3e85756..406d8c7 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+requests (2.32.3+dfsg-1ubuntu1) oracular; urgency=medium
7+
8+ * d/p/remove-charset-normalizer-dependency.patch: Remove charset-normalizer
9+ as a build dependency of requests (LP: #1975541)
10+
11+ -- Lena Voytek <lena.voytek@canonical.com> Wed, 26 Jun 2024 08:56:02 -0700
12+
13 requests (2.32.3+dfsg-1) unstable; urgency=medium
14
15 * Team upload.
16diff --git a/debian/control b/debian/control
17index edcf283..f075eea 100644
18--- a/debian/control
19+++ b/debian/control
20@@ -1,5 +1,6 @@
21 Source: requests
22-Maintainer: Debian Python Team <team+python@tracker.debian.org>
23+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
24+XSBC-Original-Maintainer: Debian Python Team <team+python@tracker.debian.org>
25 Uploaders: Daniele Tricoli <eriol@debian.org>
26 Section: python
27 Priority: optional
28diff --git a/debian/patches/remove-charset-normalizer-dependency.patch b/debian/patches/remove-charset-normalizer-dependency.patch
29new file mode 100644
30index 0000000..293c84e
31--- /dev/null
32+++ b/debian/patches/remove-charset-normalizer-dependency.patch
33@@ -0,0 +1,35 @@
34+Description: Remove charset-normalizer package in favor of chardet
35+ By default requests upstream uses charset_normalizer for character detection,
36+ but supports the use of chardet instead. Since python-charset-normalizer is in
37+ universe, requests in Ubuntu cannot depend on it. This patch removes the
38+ dependency from setup.py and forces using_charset_normalizer to false so it is
39+ not automatically included by pybuild.
40+Forwarded: not-needed
41+X-Not-Forwarded-Reason: charset-normalizer being in universe is Ubuntu-specific
42+Author: Lena Voytek <lena.voytek@canonical.com>
43+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/requests/+bug/1975541
44+Last-Update: 2024-06-26
45+---
46+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
47+--- a/setup.py
48++++ b/setup.py
49+@@ -59,7 +59,7 @@
50+ sys.exit()
51+
52+ requires = [
53+- "charset_normalizer>=2,<4",
54++ "chardet>=3.0.2",
55+ "idna>=2.5,<4",
56+ "urllib3>=1.21.1,<3",
57+ "certifi>=2017.4.17",
58+--- a/src/requests/help.py
59++++ b/src/requests/help.py
60+@@ -112,7 +109,7 @@
61+ "implementation": implementation_info,
62+ "system_ssl": system_ssl_info,
63+ "using_pyopenssl": pyopenssl is not None,
64+- "using_charset_normalizer": chardet is None,
65++ "using_charset_normalizer": False,
66+ "pyOpenSSL": pyopenssl_info,
67+ "urllib3": urllib3_info,
68+ "chardet": chardet_info,
69diff --git a/debian/patches/series b/debian/patches/series
70index 5bde12d..81e1af9 100644
71--- a/debian/patches/series
72+++ b/debian/patches/series
73@@ -1,2 +1,3 @@
74 0001-Remove-remote-images-traking-code-and-ads.patch
75 0002-Fix-tests-with-HTTP-proxy.patch
76+remove-charset-normalizer-dependency.patch

Subscribers

People subscribed via source and target branches