| 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 :: Only", |
| 34 |
"Programming Language :: Python :: Implementation :: CPython", |
| 35 |
"Programming Language :: Python :: Implementation :: PyPy", |
| 36 |
"Programming Language :: Python :: Free Threading :: 2 - Beta", |
| 37 |
"Topic :: Internet :: WWW/HTTP", |
| 38 |
"Topic :: Software Development :: Libraries", |
| 39 |
] |
| 40 |
requires-python = ">=3.10" |
| 41 |
dynamic = ["version"] |
| 42 |
|
| 43 |
[project.optional-dependencies] |
| 44 |
brotli = [ |
| 45 |
"brotli>=1.2.0; platform_python_implementation == 'CPython'", |
| 46 |
"brotlicffi>=1.2.0.0; platform_python_implementation != 'CPython'" |
| 47 |
] |
| 48 |
zstd = [ |
| 49 |
"backports.zstd>=1.0.0; python_version<'3.14'", |
| 50 |
] |
| 51 |
socks = [ |
| 52 |
"PySocks>=1.5.6,<2.0,!=1.5.7", |
| 53 |
] |
| 54 |
h2 = [ |
| 55 |
"h2>=4,<5" |
| 56 |
] |
| 57 |
|
| 58 |
[dependency-groups] |
| 59 |
dev-base = [ |
| 60 |
"anyio[trio]>=4.8.0", |
| 61 |
"build>=1.2.2.post1", |
| 62 |
"coverage>=7.8.0", |
| 63 |
"h2>=4.1.0", |
| 64 |
"httpx>=0.28.1", |
| 65 |
"hypercorn", |
| 66 |
"pysocks>=1.7.1", |
| 67 |
"pytest>=8.3.4", |
| 68 |
"pytest-memray==1.8.0 ; python_full_version < '3.15' and implementation_name == 'cpython' and sys_platform != 'win32'", |
| 69 |
"pytest-socket>=0.7.0", |
| 70 |
"pytest-timeout>=2.3.1", |
| 71 |
"quart>=0.20.0", |
| 72 |
"quart-trio>=0.12.0", |
| 73 |
"towncrier>=24.8.0", |
| 74 |
"trio>=0.27.0", |
| 75 |
] |
| 76 |
dev = [ |
| 77 |
{include-group = "dev-base"}, |
| 78 |
"cryptography>=44.0.2", |
| 79 |
"idna>=3.10", |
| 80 |
"pyopenssl>=25.0.0", |
| 81 |
"trustme>=1.2.1", |
| 82 |
] |
| 83 |
dev-min-pyopenssl = [ |
| 84 |
{include-group = "dev-base"}, |
| 85 |
# 19.0.0 (2019-01-21) was the first version to support OpenSSL 1.1.1. |
| 86 |
# The following versions of pyOpenSSL and cryptography are documented |
| 87 |
# as the minimum supported ones in our docs. |
| 88 |
"pyopenssl==19.0.0", |
| 89 |
"cryptography==2.3", |
| 90 |
# We document 2.1 as the minimum supported version of idna from |
| 91 |
# cryptography, but 2.8 is the minimum needed for tests because of anyio. |
| 92 |
"idna==2.8", |
| 93 |
# The last version of trustme to support cryptography < 3.1. |
| 94 |
"trustme==0.9.0", |
| 95 |
] |
| 96 |
mypy = [ |
| 97 |
"anyio[trio]>=4.8.0", |
| 98 |
"backports.zstd>=1.0.0; python_version<'3.14'", |
| 99 |
"cryptography>=44.0.2", |
| 100 |
"httpx>=0.28.1", |
| 101 |
"hypercorn>=0.15.0", |
| 102 |
"idna>=3.10", |
| 103 |
"mypy>=1.14.1", |
| 104 |
"pytest>=8.3.4", |
| 105 |
"quart>=0.20.0", |
| 106 |
"quart-trio>=0.12.0", |
| 107 |
"trio>=0.27.0", |
| 108 |
"trustme>=1.2.1", |
| 109 |
"types-requests>=2.32.0.20241016", |
| 110 |
"nox>=2024.10.9", |
| 111 |
] |
| 112 |
emscripten = [ |
| 113 |
"build>=1.2.2.post1", |
| 114 |
"pytest-pyodide>=0.58.4", |
| 115 |
"selenium>=4.27.1", |
| 116 |
] |
| 117 |
docs = [ |
| 118 |
"furo>=2024.8.6", |
| 119 |
"requests>=2.32.3", |
| 120 |
"sphinx>=7.2.6", |
| 121 |
"sphinx-copybutton>=0.5.2", |
| 122 |
"sphinxext-opengraph>=0.9.1", |
| 123 |
] |
| 124 |
|
| 125 |
[project.urls] |
| 126 |
"Changelog" = "https://github.com/urllib3/urllib3/blob/main/CHANGES.rst" |
| 127 |
"Documentation" = "https://urllib3.readthedocs.io" |
| 128 |
"Code" = "https://github.com/urllib3/urllib3" |
| 129 |
"Issue tracker" = "https://github.com/urllib3/urllib3/issues" |
| 130 |
|
| 131 |
[tool.hatch.version] |
| 132 |
source = "vcs" |
| 133 |
[tool.hatch.version.raw-options] |
| 134 |
local_scheme = "no-local-version" |
| 135 |
[tool.hatch.build.hooks.vcs] |
| 136 |
version-file = "src/urllib3/_version.py" |
| 137 |
|
| 138 |
[tool.hatch.build.targets.sdist] |
| 139 |
include = [ |
| 140 |
"/docs", |
| 141 |
"/dummyserver", |
| 142 |
"/src", |
| 143 |
"/test", |
| 144 |
"/uv.lock", |
| 145 |
"/CHANGES.rst", |
| 146 |
"/README.md", |
| 147 |
"/LICENSE.txt", |
| 148 |
] |
| 149 |
|
| 150 |
[tool.pytest.ini_options] |
| 151 |
xfail_strict = true |
| 152 |
python_classes = ["Test", "*TestCase"] |
| 153 |
markers = [ |
| 154 |
"limit_memory: Limit memory with memray", |
| 155 |
"requires_network: This test needs access to the Internet", |
| 156 |
"integration: Slow integrations tests not run by default", |
| 157 |
"in_webbrowser: Emscripten - run only in browser (not in Node.js)", |
| 158 |
"with_jspi: Emscripten - run only if WebAssembly JavaScript Promise Integration is supported", |
| 159 |
"without_jspi: Emscripten - run only if this platform works without WebAssembly JavaScript Promise Integration", |
| 160 |
"webworkers: Emscripten - run only if this platform can test web workers", |
| 161 |
"node_without_jspi: Emscripten - run in node with jspi enabled (for failure testing only)", |
| 162 |
] |
| 163 |
log_level = "DEBUG" |
| 164 |
filterwarnings = [ |
| 165 |
"error", |
| 166 |
'''default:urllib3 v2 only supports OpenSSL 1.1.1+.*''', |
| 167 |
'''default:No IPv6 support. Falling back to IPv4:urllib3.exceptions.HTTPWarning''', |
| 168 |
'''default:No IPv6 support. skipping:urllib3.exceptions.HTTPWarning''', |
| 169 |
'''default:ssl\.TLSVersion\.TLSv1 is deprecated:DeprecationWarning''', |
| 170 |
'''default:ssl\.PROTOCOL_TLS is deprecated:DeprecationWarning''', |
| 171 |
'''default:ssl\.PROTOCOL_TLSv1 is deprecated:DeprecationWarning''', |
| 172 |
'''default:ssl\.TLSVersion\.TLSv1_1 is deprecated:DeprecationWarning''', |
| 173 |
'''default:ssl\.PROTOCOL_TLSv1_1 is deprecated:DeprecationWarning''', |
| 174 |
'''default:ssl\.PROTOCOL_TLSv1_2 is deprecated:DeprecationWarning''', |
| 175 |
'''default:ssl NPN is deprecated, use ALPN instead:DeprecationWarning''', |
| 176 |
'''default:Brotli >= 1.2.0 is required to prevent decompression bombs\.:urllib3.exceptions.DependencyWarning''', |
| 177 |
# https://github.com/SeleniumHQ/selenium/issues/13328 |
| 178 |
'''default:unclosed file <_io\.BufferedWriter name='/dev/null'>:ResourceWarning''', |
| 179 |
# https://github.com/SeleniumHQ/selenium/issues/14686 |
| 180 |
'''default:setting remote_server_addr in RemoteConnection\(\) is deprecated, set in ClientConfig instance instead:FutureWarning''' |
| 181 |
] |
| 182 |
|
| 183 |
[tool.isort] |
| 184 |
profile = "black" |
| 185 |
add_imports = "from __future__ import annotations" |
| 186 |
|
| 187 |
[tool.mypy] |
| 188 |
mypy_path = "src" |
| 189 |
check_untyped_defs = true |
| 190 |
disallow_any_generics = true |
| 191 |
disallow_incomplete_defs = true |
| 192 |
disallow_subclassing_any = true |
| 193 |
disallow_untyped_calls = true |
| 194 |
disallow_untyped_decorators = true |
| 195 |
disallow_untyped_defs = true |
| 196 |
no_implicit_optional = true |
| 197 |
no_implicit_reexport = true |
| 198 |
show_error_codes = true |
| 199 |
strict_equality = true |
| 200 |
warn_redundant_casts = true |
| 201 |
warn_return_any = true |
| 202 |
warn_unused_configs = true |
| 203 |
warn_unused_ignores = true |
| 204 |
enable_error_code = [ |
| 205 |
"ignore-without-code", |
| 206 |
] |
| 207 |
|
| 208 |
[tool.uv] |
| 209 |
package = true |
| 210 |
conflicts = [ |
| 211 |
[ |
| 212 |
{group = "dev"}, |
| 213 |
{group = "dev-min-pyopenssl"}, |
| 214 |
], |
| 215 |
[ |
| 216 |
{group = "dev-min-pyopenssl"}, |
| 217 |
{group = "mypy"}, |
| 218 |
], |
| 219 |
] |
| 220 |
|
| 221 |
[tool.uv.sources] |
| 222 |
hypercorn = { git = "https://github.com/urllib3/hypercorn", rev = "urllib3-changes" } |