[project] name = "mitmproxy" description = "An interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets." readme = "README.md" requires-python = ">=3.10" license = {file="LICENSE"} authors = [{name = "Aldo Cortesi", email = "aldo@corte.si"}] maintainers = [{name = "Maximilian Hils", email = "mitmproxy@maximilianhils.com"}] dynamic = ["version"] classifiers = [ "License :: OSI Approved :: MIT License", "Development Status :: 5 - Production/Stable", "Environment :: Console :: Curses", "Operating System :: MacOS", "Operating System :: POSIX", "Operating System :: Microsoft :: Windows", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Security", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: Proxy Servers", "Topic :: System :: Networking :: Monitoring", "Topic :: Software Development :: Testing", "Typing :: Typed", ] # https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#install-requires # It is not considered best practice to use install_requires to pin dependencies to specific versions. dependencies = [ "aioquic_mitmproxy>=0.9.20,<0.10", "asgiref>=3.2.10,<3.8", "Brotli>=1.0,<1.2", "certifi>=2019.9.11", # no semver here - this should always be on the last release! "cryptography>=38.0,<41.1", "flask>=1.1.1,<3.1", "h11>=0.11,<0.15", "h2>=4.1,<5", "hyperframe>=6.0,<7", "kaitaistruct>=0.10,<0.11", "ldap3>=2.8,<2.10", "mitmproxy_rs>=0.3.6,<0.4", "msgpack>=1.0.0, <1.1.0", "passlib>=1.6.5, <1.8", "protobuf>=3.14,<5", "pydivert>=2.0.3,<2.2; sys_platform == 'win32'", "pyOpenSSL>=22.1,<23.3", "pyparsing>=2.4.2,<3.2", "pyperclip>=1.6.0,<1.9", "ruamel.yaml>=0.16,<0.18", "sortedcontainers>=2.3,<2.5", "tornado>=6.2,<7", "typing-extensions>=4.3,<5; python_version<'3.11'", "urwid-mitmproxy>=2.1.1,<2.2", "wsproto>=1.0,<1.3", "publicsuffix2>=2.20190812,<3", "zstandard>=0.11,<0.22", ] [project.optional-dependencies] dev = [ "click>=7.0,<8.2", "hypothesis>=5.8,<7", "pdoc>=4.0.0", "pyinstaller==6.0.0", "pytest-asyncio>=0.17,<0.22", "pytest-cov>=2.7.1,<4.2", "pytest-timeout>=1.3.3,<2.2", "pytest-xdist>=2.1.0,<3.4", "pytest>=6.1.0,<8", "requests>=2.9.1,<3", "tox>=3.5,<5", "wheel>=0.36.2,<0.42", "build>=0.10.0", ] [project.urls] Homepage = "https://mitmproxy.org" Source = "https://github.com/mitmproxy/mitmproxy/" Documentation = "https://docs.mitmproxy.org/stable/" Issues = "https://github.com/mitmproxy/mitmproxy/issues" [project.scripts] mitmproxy = "mitmproxy.tools.main:mitmproxy" mitmdump = "mitmproxy.tools.main:mitmdump" mitmweb = "mitmproxy.tools.main:mitmweb" [project.entry-points.pyinstaller40] hook-dirs = "mitmproxy.utils.pyinstaller:hook_dirs" [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" [tool.setuptools.dynamic] version = {attr = "mitmproxy.version.VERSION"} [tool.setuptools.packages.find] include = ["mitmproxy*"] [tool.coverage.run] branch = false omit = [ "*contrib*", "*tnetstring*", "*platform*", "*main.py", ] [tool.coverage.report] show_missing = true exclude_lines = [ "pragma: no cover", "raise NotImplementedError", "raise AssertionError", "if typing.TYPE_CHECKING:", "if TYPE_CHECKING:", "@overload", "@abstractmethod", "assert_never", "\\.\\.\\.", ] [tool.pytest.ini_options] asyncio_mode = "auto" testpaths = "test" addopts = "--capture=no --color=yes" filterwarnings = [ "ignore::DeprecationWarning:tornado.*:", ] [tool.mypy] check_untyped_defs = true ignore_missing_imports = true files = [ "mitmproxy", "examples/addons", "release/*.py", ] exclude = [ "^docs/", "^release/build/", "^examples/contrib/", ] [[tool.mypy.overrides]] module = "mitmproxy.contrib.*" ignore_errors = true [[tool.mypy.overrides]] module = "tornado.*" ignore_errors = true [[tool.mypy.overrides]] module = "test.*" ignore_errors = true [tool.ruff] select = ["E", "F", "I"] extend-exclude = ["mitmproxy/contrib/"] ignore = ["F541", "E501"] [tool.ruff.isort] # these rules are a bit weird, but they mimic our existing reorder_python_imports style. # if we break compatibility here, consider removing all customization + enforce absolute imports. force-single-line = true order-by-type = false section-order = ["future", "standard-library", "third-party", "local-folder","first-party"] no-lines-before = ["first-party"] known-first-party = ["test", "mitmproxy"] [tool.tox] legacy_tox_ini = """ [tox] envlist = py, lint, mypy skipsdist = True toxworkdir={env:TOX_WORK_DIR:.tox} [testenv] deps = -e .[dev] setenv = HOME = {envtmpdir} commands = mitmdump --version pytest --timeout 60 -vv --cov-report xml \ --continue-on-collection-errors \ --cov=mitmproxy --cov=release \ --full-cov=mitmproxy/ \ {posargs} [testenv:lint] deps = ruff>=0.1.3,<0.2 commands = ruff . [testenv:filename_matching] deps = commands = python ./test/filename_matching.py [testenv:mypy] deps = mypy==1.4.1 types-certifi==2021.10.8.3 types-Flask==1.1.6 types-Werkzeug==1.0.9 types-requests==2.31.0.2 types-cryptography==3.3.23.2 types-pyOpenSSL==23.2.0.2 -e .[dev] commands = mypy {posargs} [testenv:individual_coverage] commands = python ./test/individual_coverage.py {posargs} [testenv:wheeltest] recreate = True deps = commands = pip install {posargs} mitmproxy --version mitmdump --version mitmweb --version """