Debian Codegraph @

pyproject.toml

raw
1 # This file is protected via CODEOWNERS
2
3 [build-system]
4 requires = ["hatchling>=1.27.0,<2", "hatch-vcs>=0.4.0,<0.6.0", "setuptools-scm>=8,<11"]
5 build-backend = "hatchling.build"
6
7 [project]
8 name = "urllib3"
9 description = "HTTP library with thread-safe connection pooling, file post, and more."
10 readme = "README.md"
11 license = "MIT"
12 license-files = ["LICENSE.txt"]
13 keywords = ["urllib", "httplib", "threadsafe", "filepost", "http", "https", "ssl", "pooling"]
14 authors = [
15 {name = "Andrey Petrov", email = "[email protected]"}
16 ]
17 maintainers = [
18 {name = "Seth Michael Larson", email="[email protected]"},
19 {name = "Quentin Pradet", email="[email protected]"},
20 {name = "Illia Volochii", email = "[email protected]"},
21 ]
22 classifiers = [
23 "Environment :: Web Environment",
24 "Intended Audience :: Developers",
25 "Operating System :: OS Independent",
26 "Programming Language :: Python",
27 "Programming Language :: Python :: 3",
28 "Programming Language :: Python :: 3.10",
29 "Programming Language :: Python :: 3.11",
30 "Programming Language :: Python :: 3.12",
31 "Programming Language :: Python :: 3.13",
32 "Programming Language :: Python :: 3.14",
33 "Programming Language :: Python :: 3.15",
34 "Programming Language :: Python :: 3 :: Only",
35 "Programming Language :: Python :: Implementation :: CPython",
36 "Programming Language :: Python :: Implementation :: PyPy",
37 "Programming Language :: Python :: Free Threading :: 2 - Beta",
38 "Topic :: Internet :: WWW/HTTP",
39 "Topic :: Software Development :: Libraries",
40 ]
41 requires-python = ">=3.10"
42 dynamic = ["version"]
43
44 [project.optional-dependencies]
45 brotli = [
46 "brotli>=1.2.0; platform_python_implementation == 'CPython'",
47 "brotlicffi>=1.2.0.0; platform_python_implementation != 'CPython'"
48 ]
49 zstd = [
50 "backports.zstd>=1.0.0; python_version<'3.14'",
51 ]
52 socks = [
53 "PySocks>=1.5.6,<2.0,!=1.5.7",
54 ]
55 h2 = [
56 "h2>=4,<5"
57 ]
58
59 [dependency-groups]
60 # Bare dependencies needed to run the test suite. Kept free of profiling
61 # (`coverage`, `pytest-memray`) and maintainer tooling (`build`, `towncrier`)
62 # so downstream packagers can install just this group when generating
63 # build-time test requirements (see issue #3594).
64 test = [
65 "anyio[trio]>=4.8.0",
66 "h2>=4.1.0",
67 "httpx>=0.28.1",
68 "hypercorn>=0.15.0",
69 "pysocks>=1.7.1",
70 "pytest>=8.3.4",
71 "pytest-socket>=0.7.0",
72 "pytest-timeout>=2.3.1",
73 "quart>=0.20.0",
74 "quart-trio>=0.12.0",
75 "trio>=0.27.0",
76 ]
77 dev-base = [
78 {include-group = "test"},
79 "build>=1.2.2.post1",
80 "coverage>=7.8.0",
81 "pytest-memray==1.8.0 ; python_full_version < '3.15' and implementation_name == 'cpython' and sys_platform != 'win32'",
82 "towncrier>=24.8.0",
83 ]
84 dev = [
85 {include-group = "dev-base"},
86 "cryptography>=44.0.2",
87 "idna>=3.10",
88 "pyopenssl>=25.0.0",
89 "trustme>=1.2.1",
90 ]
91 dev-min-pyopenssl = [
92 {include-group = "dev-base"},
93 # 19.0.0 (2019-01-21) was the first version to support OpenSSL 1.1.1.
94 # The following versions of pyOpenSSL and cryptography are documented
95 # as the minimum supported ones in our docs.
96 "pyopenssl==19.0.0",
97 "cryptography==2.3",
98 # We document 2.1 as the minimum supported version of idna from
99 # cryptography, but 2.8 is the minimum needed for tests because of anyio.
100 "idna==2.8",
101 # The last version of trustme to support cryptography < 3.1.
102 "trustme==0.9.0",
103 ]
104 mypy = [
105 {include-group = "test"},
106 "backports.zstd>=1.0.0; python_version<'3.14'",
107 "cryptography>=44.0.2",
108 "idna>=3.10",
109 "mypy>=1.18.2",
110 "trustme>=1.2.1",
111 "types-requests>=2.32.0.20241016",
112 "nox>=2024.10.9",
113 "types-pysocks>=1.7.1.20251001",
114 "pyopenssl>=25.3.0",
115 ]
116 emscripten = [
117 "build>=1.2.2.post1",
118 "pytest-pyodide>=0.58.4",
119 "selenium>=4.27.1",
120 ]
121 docs = [
122 "furo>=2024.8.6",
123 "myst-parser>=5.1.0",
124 "requests>=2.32.3",
125 "sphinx>=7.2.6",
126 "sphinx-copybutton>=0.5.2",
127 "sphinxext-opengraph>=0.9.1",
128 ]
129
130 [project.urls]
131 "Changelog" = "https://github.com/urllib3/urllib3/blob/main/CHANGES.rst"
132 "Documentation" = "https://urllib3.readthedocs.io"
133 "Code" = "https://github.com/urllib3/urllib3"
134 "Issue tracker" = "https://github.com/urllib3/urllib3/issues"
135 "Security policy" = "https://urllib3.readthedocs.io/en/latest/security.html"
136
137 [tool.hatch.version]
138 source = "vcs"
139 [tool.hatch.version.raw-options]
140 local_scheme = "no-local-version"
141 [tool.hatch.build.hooks.vcs]
142 version-file = "src/urllib3/_version.py"
143
144 [tool.hatch.build.targets.sdist]
145 include = [
146 "/docs",
147 "/dummyserver",
148 "/src",
149 "/test",
150 "/uv.lock",
151 "/CHANGES.rst",
152 "/README.md",
153 "/SECURITY.md",
154 "/LICENSE.txt",
155 ]
156
157 [tool.pytest.ini_options]
158 xfail_strict = true
159 python_classes = ["Test", "*TestCase"]
160 markers = [
161 "limit_memory: Limit memory with memray",
162 "requires_network: This test needs access to the Internet",
163 "integration: Slow integrations tests not run by default",
164 "in_webbrowser: Emscripten - run only in browser (not in Node.js)",
165 "with_jspi: Emscripten - run only if WebAssembly JavaScript Promise Integration is supported",
166 "without_jspi: Emscripten - run only if this platform works without WebAssembly JavaScript Promise Integration",
167 "webworkers: Emscripten - run only if this platform can test web workers",
168 "node_without_jspi: Emscripten - run in node with jspi enabled (for failure testing only)",
169 ]
170 log_level = "DEBUG"
171 filterwarnings = [
172 "error",
173 '''default:urllib3 v2 only supports OpenSSL 1.1.1+.*''',
174 '''default:No IPv6 support. Falling back to IPv4:urllib3.exceptions.HTTPWarning''',
175 '''default:No IPv6 support. skipping:urllib3.exceptions.HTTPWarning''',
176 '''default:ssl\.TLSVersion\.TLSv1 is deprecated:DeprecationWarning''',
177 '''default:ssl\.PROTOCOL_TLS is deprecated:DeprecationWarning''',
178 '''default:ssl\.PROTOCOL_TLSv1 is deprecated:DeprecationWarning''',
179 '''default:ssl\.TLSVersion\.TLSv1_1 is deprecated:DeprecationWarning''',
180 '''default:ssl\.PROTOCOL_TLSv1_1 is deprecated:DeprecationWarning''',
181 '''default:ssl\.PROTOCOL_TLSv1_2 is deprecated:DeprecationWarning''',
182 '''default:ssl NPN is deprecated, use ALPN instead:DeprecationWarning''',
183 '''default:Brotli >= 1.2.0 is required to prevent decompression bombs\.:urllib3.exceptions.DependencyWarning''',
184 # https://github.com/SeleniumHQ/selenium/issues/13328
185 '''default:unclosed file <_io\.BufferedWriter name='/dev/null'>:ResourceWarning''',
186 # https://github.com/SeleniumHQ/selenium/issues/14686
187 '''default:setting remote_server_addr in RemoteConnection\(\) is deprecated, set in ClientConfig instance instead:FutureWarning'''
188 ]
189
190 [tool.isort]
191 profile = "black"
192 add_imports = "from __future__ import annotations"
193
194 [tool.mypy]
195 mypy_path = "src"
196 check_untyped_defs = true
197 disallow_any_generics = true
198 disallow_incomplete_defs = true
199 disallow_subclassing_any = true
200 disallow_untyped_calls = true
201 disallow_untyped_decorators = true
202 disallow_untyped_defs = true
203 no_implicit_optional = true
204 no_implicit_reexport = true
205 show_error_codes = true
206 strict_equality = true
207 warn_redundant_casts = true
208 warn_return_any = true
209 warn_unused_configs = true
210 warn_unused_ignores = true
211 enable_error_code = [
212 "ignore-without-code",
213 ]
214
215 [tool.uv]
216 package = true
217 conflicts = [
218 [
219 {group = "dev"},
220 {group = "dev-min-pyopenssl"},
221 ],
222 [
223 {group = "dev-min-pyopenssl"},
224 {group = "mypy"},
225 ],
226 ]
227
228 [tool.uv.dependency-groups]
229 # MyST 5.1+ supports GitHub-style alerts in the shared security policy and
230 # requires Python 3.11+.
231 docs = { requires-python = ">=3.11" }
232
233 [tool.uv.sources]
234 hypercorn = { git = "https://github.com/urllib3/hypercorn", rev = "urllib3-changes" }