source: general/prog/python-modules/requests.xml@ 54d58907

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 54d58907 was 54d58907, checked in by Pierre Labastie <pierre.labastie@…>, 15 months ago

Remove eol spaces

  • Property mode set to 100644
File size: 6.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../../general.ent">
5 %general-entities;
6
7 <!ENTITY requests-download-http "https://files.pythonhosted.org/packages/source/r/requests/requests-&requests-version;.tar.gz">
8 <!ENTITY requests-download-ftp " ">
9 <!ENTITY requests-md5sum "09b752e0b0a672d805ae54455c128d42">
10 <!ENTITY requests-size "106 KB">
11 <!ENTITY requests-buildsize "1.4 MB (add 129 MB for tests)">
12 <!ENTITY requests-time "less than 0.1 SBU (0.8 SBU for tests)">
13]>
14
15 <sect2 id="requests" xreflabel="requests-&requests-version;">
16
17 <title>Requests-&requests-version;</title>
18
19 <indexterm zone="requests">
20 <primary sortas="a-requests">requests</primary>
21 </indexterm>
22
23 <sect3 role="package">
24 <title>Introduction to Requests Module</title>
25
26 <para>
27 The <application>Requests</application> package is an elegant and
28 simple HTTP library for Python, built for human beings. It allows
29 sending HTTP/1.1 requests extremely easily.
30 </para>
31
32 &lfs112_checked;
33
34 <bridgehead renderas="sect4">Package Information</bridgehead>
35 <itemizedlist spacing="compact">
36 <listitem>
37 <para>
38 Download (HTTP): <ulink url="&requests-download-http;"/>
39 </para>
40 </listitem>
41 <listitem>
42 <para>
43 Download (FTP): <ulink url="&requests-download-ftp;"/>
44 </para>
45 </listitem>
46 <listitem>
47 <para>
48 Download MD5 sum: &requests-md5sum;
49 </para>
50 </listitem>
51 <listitem>
52 <para>
53 Download size: &requests-size;
54 </para>
55 </listitem>
56 <listitem>
57 <para>
58 Estimated disk space required: &requests-buildsize;
59 </para>
60 </listitem>
61 <listitem>
62 <para>
63 Estimated build time: &requests-time;
64 </para>
65 </listitem>
66 </itemizedlist>
67
68 <bridgehead renderas="sect4">Additional Download</bridgehead>
69 <itemizedlist spacing="compact">
70 <listitem>
71 <para>
72 Recommended patch: <ulink
73 url="&patch-root;/requests-&requests-version;-use_system_certs-1.patch"/>
74 </para>
75 </listitem>
76 </itemizedlist>
77
78 <bridgehead renderas="sect4">Requests Dependencies</bridgehead>
79
80 <bridgehead renderas="sect5">Required</bridgehead>
81 <para role="required">
82 <xref linkend="charset-normalizer"/>,
83 <xref linkend="idna"/>, and
84 <xref linkend="urllib3"/>
85 </para>
86
87 <bridgehead renderas="sect5">Recommended</bridgehead>
88 <para role="recommended">
89 <xref linkend="make-ca"/>, with
90 <xref linkend="p11-kit"/> (both needed to use system https: certificates,
91 removing an unnecessary dependency on the <application>Certifi</application>
92 module).
93 </para>
94
95 <bridgehead renderas="sect5">Optional</bridgehead>
96 <para role="optional">
97 <ulink url="https://pypi.org/project/PySocks/">PySocks</ulink> (also needed for testing)
98 </para>
99
100 <bridgehead renderas="sect5">Optional (for testing)</bridgehead>
101 <para role="optional">
102 <xref linkend="pytest"/>,
103 <ulink url="https://pypi.org/project/Flask/">Flask</ulink>&lt;2,
104 <ulink url="https://pypi.org/project/httpbin/">httpbin</ulink>,
105 <ulink url="https://pypi.org/project/MarkupSafe/">MarkupSafe</ulink>&lt;2.1,
106 <ulink url="https://pypi.org/project/pytest-mock/">pytest-mock</ulink>,
107 <ulink url="https://pypi.org/project/pytest-httpbin/">pytest-httpbin</ulink>,
108 <ulink url="https://pypi.org/project/sphinx/">sphinx</ulink>&lt;5,
109 <ulink url="https://pypi.org/project/trustme/">trustme</ulink>, and
110 <ulink url="https://pypi.org/project/Werkzeug/">Werkzeug</ulink>&lt;2
111 </para>
112
113 </sect3>
114
115 <sect3 role="installation">
116 <title>Installation of Requests</title>
117
118 <para>
119 First apply a patch so that the same environment variable already used to
120 point to system certificates in <application>Python3</application> following
121 the installation of <application>make-ca</application> can also be used by
122 this module:
123 </para>
124
125<screen><userinput>patch -Np1 -i ../requests-&requests-version;-use_system_certs-1.patch</userinput></screen>
126
127 <para> Build the module: </para>
128
129<screen><userinput>pip3 wheel -w dist --no-build-isolation --no-deps $PWD</userinput></screen>
130
131 <para>
132 Now, as the <systemitem class="username">root</systemitem> user:
133 </para>
134
135<screen role="root"><userinput>pip3 install --no-index --find-links dist --no-cache-dir --no-user requests</userinput></screen>
136
137 <para>
138 Assuming <xref linkend="pytest"/> is installed, but the other optional
139 dependencies are not, the installation can be tested with the following
140 commands:
141 </para>
142
143<screen remap="test"><userinput>python3 -m venv --system-site-packages testenv &amp;&amp;
144source testenv/bin/activate &amp;&amp;
145pip3 install --force-reinstall sphinx\&lt;5 &amp;&amp;
146pip3 install pytest-mock \
147 werkzeug\&lt;2 \
148 flask\&lt;2 \
149 pytest-httpbin \
150 pysocks \
151 trustme &amp;&amp;
152pip3 install --force-reinstall Markupsafe\&lt;2.1 &amp;&amp;
153python3 /usr/bin/pytest tests &amp;&amp;
154deactivate</userinput></screen>
155
156 <note>
157 <para>
158 See <xref linkend="make-ca"/> for how to set the environment variable,
159 and for how local copies of the Certifi and Requests modules installed
160 in a virtual environment <emphasis>will</emphasis> override the system
161 certificates.
162 </para>
163 </note>
164
165 </sect3>
166
167 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
168 href="../../../xincludes/pip3-cmd-explain.xml"/>
169
170 <sect3 role="content">
171 <title>Contents</title>
172
173 <segmentedlist>
174 <segtitle>Installed Programs</segtitle>
175 <segtitle>Installed Libraries</segtitle>
176 <segtitle>Installed Directories</segtitle>
177
178 <seglistitem>
179 <seg>None</seg>
180 <seg>None</seg>
181 <seg>
182 /usr/lib/python&python3-majorver;/site-packages/requests and
183 /usr/lib/python&python3-majorver;/site-packages/requests-&requests-version;.dist-info
184 </seg>
185 </seglistitem>
186 </segmentedlist>
187
188 </sect3>
189
190 </sect2>
Note: See TracBrowser for help on using the repository browser.