# This file is protected via CODEOWNERS

[build-system]
requires = ["hatchling>=1.6.0,<2"]
build-backend = "hatchling.build"

[project]
name = "urllib3-future"
description = "urllib3.future is a powerful HTTP 1.1, 2, and 3 client with both sync and async interfaces"
readme = "README.md"
license-files = { paths = ["LICENSE.txt"] }
license = "MIT"
keywords = ["urllib", "httplib", "threadsafe", "filepost", "http", "https", "ssl", "pooling", "multiplexed", "concurrent", "dns", "dot", "doq", "doh", "dou", "dns-over-quic", "dns-over-https", "dns-over-tls", "async", "tasksafe", "wasi", "wasm"]
authors = [
  {name = "Andrey Petrov", email = "andrey.petrov@shazow.net"}
]
maintainers = [
  {name = "Ahmed R. TAHRI", email="tahri.ahmed@proton.me"},
]
classifiers = [
  "Environment :: Web Environment",
  "Intended Audience :: Developers",
  "License :: OSI Approved :: MIT License",
  "Operating System :: OS Independent",
  "Programming Language :: Python",
  "Programming Language :: Python :: 3",
  "Programming Language :: Python :: 3.7",
  "Programming Language :: Python :: 3.8",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Programming Language :: Python :: 3.14",
  "Programming Language :: Python :: 3.15",
  "Programming Language :: Python :: 3 :: Only",
  "Programming Language :: Python :: Implementation :: CPython",
  "Programming Language :: Python :: Implementation :: PyPy",
  "Topic :: Internet :: WWW/HTTP",
  "Topic :: Software Development :: Libraries",
  "Programming Language :: Python :: Free Threading :: 4 - Resilient",
  "Environment :: WebAssembly",
  "Environment :: WebAssembly :: WASI",
]
requires-python = ">=3.7"
dynamic = ["version"]
dependencies = [
  "qh3>=1.5.4,<3.0.0; (platform_python_implementation != 'CPython' or python_full_version > '3.7.10') and (platform_system == 'Darwin' or platform_system == 'Windows' or platform_system == 'Linux') and (platform_machine == 'x86_64' or platform_machine == 's390x' or platform_machine == 'armv7l' or platform_machine == 'ppc64le' or platform_machine == 'ppc64' or platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'arm64' or platform_machine == 'ARM64' or platform_machine == 'x86' or platform_machine == 'i686' or platform_machine == 'riscv64' or platform_machine == 'riscv64gc') and (platform_python_implementation == 'CPython' or (platform_python_implementation == 'PyPy' and python_version < '3.12'))",
  "h11>=0.11.0,<1.0.0",
  "jh2>=5.0.3,<6.0.0",
]

[project.optional-dependencies]
brotli = [
  "brotli>=1.0.9; platform_python_implementation == 'CPython'",
  "brotlicffi>=0.8.0; platform_python_implementation != 'CPython'"
]
zstd = [
  "zstandard>=0.18.0; python_version < '3.14'",
]
secure = []
socks = [
  "python-socks>=2,<=2.8.1",
]
qh3 = [
  "qh3>=1.5.4,<3.0.0",
]
ws = [
  "wsproto>=1.2,<2",
]
rtls = [
  "rtls; platform_python_implementation == 'CPython'",
]
utls = [
  "utls; platform_python_implementation == 'CPython'",
  # force zstd, and br to be part of utls group
  # we need them as we force "Accept-Encoding: br, zstd, gzip,...)
  "zstandard>=0.18.0; python_version < '3.14' and platform_python_implementation == 'CPython'",
  "brotli>=1.0.9; platform_python_implementation == 'CPython'",
]

[dependency-groups]
common = [
  "tornado==6.2; python_version == '3.7'",
  "tornado==6.4.2; python_version == '3.8'",
  "tornado>=6.5.5,<7; python_version >= '3.9'",
  "pytest==7.4.4; python_version == '3.7'",
  "pytest==8.3.5; python_version == '3.8'",
  "pytest==8.4.2; python_version == '3.9'",
  "pytest>=9.0.3,<10; python_version >= '3.10'",
  "trustme==1.0.0; python_version == '3.7'",
  "trustme==1.1.0; python_version == '3.8'",
  "trustme>=1.2.1,<2; python_version >= '3.9'",
  "aiofile==3.8.8; python_version == '3.7'",
  "aiofile>=3.9.0,<4; python_version >= '3.8'",
  "cryptography<40.0.0; python_version <= '3.8'",
  "cryptography<47; python_version > '3.8'",
  "python-socks>=2,<3",
]
mypy = [
  {include-group = "common"},
  "mypy==1.4.1; python_version == '3.7'",
  "mypy==1.14.1; python_version == '3.8'",
  "mypy>=1.19.1; python_version == '3.9'",
  "mypy>=1.20.1,<2; python_version >= '3.10'",
  "idna==3.10; python_version == '3.7'",
  "idna>=3.11,<4; python_version >= '3.8'",
  "types-backports==0.1.3",
  "nox==2024.4.15; python_version == '3.7'",
  "nox==2026.2.9; python_version >= '3.8'",
  "qh3==2.0.3",
  "h11==0.14.0; python_version == '3.7'",
  "h11>=0.16.0,<1; python_version >= '3.8'",
  "jh2==5.0.14",
  "wsproto==1.2.0; python_version >= '3.7' and python_version <= '3.9'",
  "wsproto>=1.3.2,<2; python_version >= '3.10'",
  "zstandard==0.21.0; python_version == '3.7'",
  "zstandard==0.23.0; python_version == '3.8'",
  "zstandard>=0.25.0,<1; python_version >= '3.9'",
  "types-PySocks==1.7.1.20251001; python_version == '3.9'",
  "types-PySocks>=1.7.1.20260408; python_version >= '3.10'",
  "rtls==2026.7.25",
  "utls==2026.7.8",
]
dev = [
  {include-group = "common"},
  "coverage==7.2.7; python_version == '3.7'",
  "coverage==7.6.1; python_version == '3.8'",
  "coverage==7.10.7; python_version == '3.9'",
  "coverage>7.10.7; python_version >= '3.10'",
  "pytest-timeout==2.4.0",
  "backports.zoneinfo==0.2.1; python_version<'3.9'",
  "tzdata==2026.1; python_version<'3.8'",
  "towncrier==23.6.0; python_version == '3.7'",
  "towncrier==24.8.0; python_version == '3.8'",
  "towncrier>=25.8.0,<26; python_version >= '3.9'",
  "pytest-asyncio==0.21.2; python_version == '3.7'",
  "pytest-asyncio==0.24.0; python_version == '3.8'",
  "pytest-asyncio==1.2.0; python_version == '3.9'",
  "pytest-asyncio>=1.2,<2; python_version >= '3.10'",
  "pytest-xdist==3.5.0; python_version == '3.7'",
  "pytest-xdist==3.6.1; python_version == '3.8'",
  "pytest-xdist>=3.8.0,<4; python_version >= '3.9'",
  "pytest-cov==4.1.0; python_version == '3.7'",
  "pytest-cov==5.0.0; python_version == '3.8'",
  "pytest-cov>=7.1.0,<8; python_version >= '3.9'",
  "pytest-rerunfailures==13.0; python_version == '3.7'",
  "pytest-rerunfailures==14.0; python_version == '3.8'",
  "pytest-rerunfailures==16.0.1; python_version == '3.9'",
  "pytest-rerunfailures>=16.1,<17; python_version >= '3.10'",
]
wasi = [
  "componentize-py==0.25.0; python_version >= '3.10'",
  "coverage==7.15.1; python_version >= '3.10'",
  "h11==0.16.0; python_version >= '3.10'",
  "jh2==5.0.14; python_version >= '3.10'",
  "python-socks[asyncio]==2.8.1; python_version >= '3.10'",
  "rtls==2026.7.25; python_version >= '3.10'",
  "tornado==6.5.5; python_version >= '3.10'",
  "trustme==1.2.1; python_version >= '3.10'",
  "wassima==2.1.3; python_version >= '3.10'",
  "wsproto==1.3.2; python_version >= '3.10'",
]

[project.urls]
"Changelog" = "https://github.com/jawah/urllib3.future/blob/main/CHANGES.rst"
"Documentation" = "https://urllib3future.readthedocs.io"
"Code" = "https://github.com/jawah/urllib3.future"
"Issue tracker" = "https://github.com/jawah/urllib3.future/issues"

[tool.hatch.version]
path = "src/urllib3/_version.py"

[tool.hatch.build.targets.sdist]
include = [
  "/docs",
  "/dummyserver",
  "/src",
  "/test",
  "/dev-requirements.txt",
  "/wasi-requirements.txt",
  "/CHANGES.rst",
  "/README.md",
  "/LICENSE.txt",
  "/hatch_build.py",
  "/noxfile.py",
  "/docker-compose.yaml",
  "/docker-compose.win.yaml",
  "/traefik/certificate.toml",
  "/traefik/patched.Dockerfile",
  "/traefik/haproxy.cfg",
  "/urllib3_future.pth",
]

[tool.hatch.build.targets.wheel]
packages = [
    "src/urllib3",
    "src/urllib3_future",
]

[tool.hatch.build.hooks.custom]

[tool.pytest.ini_options]
xfail_strict = true
python_classes = ["Test", "*TestCase"]
norecursedirs = ["within_wasi"]
markers = ["limit_memory"]
log_level = "DEBUG"
filterwarnings = [
    "error",
    '''ignore:.*iscoroutinefunction.*:DeprecationWarning''',
    '''ignore:.*rsyncdirs.*:DeprecationWarning''',
    '''ignore:.*get_event_loop.*:DeprecationWarning''',
    '''ignore:.*set_event_loop.*:DeprecationWarning''',
    '''ignore:.*EventLoopPolicy.*:DeprecationWarning''',
    '''ignore:.*but not measured.*:coverage.exceptions.CoverageWarning''',
    '''ignore:.*No data was collected.*:coverage.exceptions.CoverageWarning''',
    '''default:ssl\.PROTOCOL_TLS is deprecated:DeprecationWarning''',
    '''default:ssl\.PROTOCOL_TLSv1 is deprecated:DeprecationWarning''',
    '''default:ssl\.TLSVersion\.TLSv1_1 is deprecated:DeprecationWarning''',
    '''default:ssl\.PROTOCOL_TLSv1_1 is deprecated:DeprecationWarning''',
    '''default:ssl\.PROTOCOL_TLSv1_2 is deprecated:DeprecationWarning''',
    '''default:unclosed .*:ResourceWarning''',
    '''default:.*leaks a thread.*:ResourceWarning''',
    '''ignore:No IPv6 support. Falling back to IPv4:Warning''',
    '''ignore:No IPv6 support. skipping:Warning''',
    '''ignore:ssl NPN is deprecated, use ALPN instead:DeprecationWarning''',
    '''default:A conflicting charset has been set in Content-Type:UserWarning''',
    '''ignore:util\.connection\.create_connection\(\) is deprecated and scheduled for removal:DeprecationWarning''',
    '''ignore:RecentlyUsedContainer is deprecated and scheduled for removal:DeprecationWarning''',
    '''ignore:The event_loop fixture provided by:DeprecationWarning''',
    '''ignore:A plugin raised an exception during''',
    '''ignore:Exception ignored:pytest.PytestUnraisableExceptionWarning''',
    '''ignore:Exception in thread:pytest.PytestUnhandledThreadExceptionWarning''',
    '''ignore:function _SSLProtocolTransport\.__del__:pytest.PytestUnraisableExceptionWarning''',
    '''ignore:function _SelectorTransport\.__del__:pytest.PytestUnraisableExceptionWarning''',
    '''ignore:function StreamWriter.__del__:pytest.PytestUnraisableExceptionWarning''',
    '''ignore:An exception occurred during teardown of an asyncio\.Runner:RuntimeWarning''',
    '''ignore:sock:pytest.PytestUnraisableExceptionWarning''',
    '''ignore:.*<socket\.socket.*:pytest.PytestUnraisableExceptionWarning''',
    '''ignore:The `hash` argument is deprecated in favor of `unsafe_hash`:DeprecationWarning''',
    '''ignore:ssl\.TLSVersion\.TLSv1 is deprecated:DeprecationWarning''',
    '''ignore:ssl\.TLSVersion\.TLSv1_1 is deprecated:DeprecationWarning''',
    '''ignore:loop is closed:ResourceWarning''',
    '''ignore:.*SOCKS support in urllib3 requires the installation of optional dependencies.*:Warning''',
    '''ignore:.*is required to prevent decompression bombs.*:Warning''',
    '''ignore:.*module has been removed in urllib3.*:Warning''',
]

[tool.ruff.lint]
ignore = ["E501", "E203", "E721"]

[tool.ruff.lint.per-file-ignores]
"src/urllib3/contrib/socks.py" = ["F811"]

[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]

[tool.mypy]
mypy_path = "src"
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
no_implicit_optional = true
no_implicit_reexport = true
show_error_codes = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

[tool.codespell]
ignore-words-list = "intoto,fo,uE,thex,TE,EDE,wit,WIT"
