2023-03-26 17:40:32 +00:00
|
|
|
[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",
|
2023-06-02 10:07:01 +00:00
|
|
|
"asgiref>=3.2.10,<3.8",
|
2023-10-01 22:34:40 +00:00
|
|
|
"Brotli>=1.0,<1.2",
|
2023-03-26 17:40:32 +00:00
|
|
|
"certifi>=2019.9.11", # no semver here - this should always be on the last release!
|
2023-06-02 10:06:30 +00:00
|
|
|
"cryptography>=38.0,<41.1",
|
2023-10-01 22:26:28 +00:00
|
|
|
"flask>=1.1.1,<3.1",
|
2023-03-26 17:40:32 +00:00
|
|
|
"h11>=0.11,<0.15",
|
|
|
|
"h2>=4.1,<5",
|
|
|
|
"hyperframe>=6.0,<7",
|
|
|
|
"kaitaistruct>=0.10,<0.11",
|
|
|
|
"ldap3>=2.8,<2.10",
|
2023-09-24 14:30:52 +00:00
|
|
|
"mitmproxy_rs>=0.3.6,<0.4",
|
2023-03-26 17:40:32 +00:00
|
|
|
"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'",
|
2023-06-02 10:07:09 +00:00
|
|
|
"pyOpenSSL>=22.1,<23.3",
|
2023-07-01 22:27:07 +00:00
|
|
|
"pyparsing>=2.4.2,<3.2",
|
2023-03-26 17:40:32 +00:00
|
|
|
"pyperclip>=1.6.0,<1.9",
|
|
|
|
"ruamel.yaml>=0.16,<0.18",
|
|
|
|
"sortedcontainers>=2.3,<2.5",
|
|
|
|
"tornado>=6.2,<7",
|
2023-08-09 08:34:26 +00:00
|
|
|
"typing-extensions>=4.3,<5; python_version<'3.11'",
|
2023-03-26 17:40:32 +00:00
|
|
|
"urwid-mitmproxy>=2.1.1,<2.2",
|
|
|
|
"wsproto>=1.0,<1.3",
|
|
|
|
"publicsuffix2>=2.20190812,<3",
|
2023-05-01 23:12:31 +00:00
|
|
|
"zstandard>=0.11,<0.22",
|
2023-03-26 17:40:32 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
[project.optional-dependencies]
|
|
|
|
dev = [
|
|
|
|
"click>=7.0,<8.2",
|
|
|
|
"hypothesis>=5.8,<7",
|
|
|
|
"pdoc>=4.0.0",
|
2023-10-01 23:36:58 +00:00
|
|
|
"pyinstaller==6.0.0",
|
2023-03-26 17:56:41 +00:00
|
|
|
"pytest-asyncio>=0.17,<0.22",
|
2023-06-02 10:06:45 +00:00
|
|
|
"pytest-cov>=2.7.1,<4.2",
|
2023-03-26 17:40:32 +00:00
|
|
|
"pytest-timeout>=1.3.3,<2.2",
|
2023-06-02 10:06:37 +00:00
|
|
|
"pytest-xdist>=2.1.0,<3.4",
|
2023-03-26 17:40:32 +00:00
|
|
|
"pytest>=6.1.0,<8",
|
|
|
|
"requests>=2.9.1,<3",
|
|
|
|
"tox>=3.5,<5",
|
2023-08-01 23:05:03 +00:00
|
|
|
"wheel>=0.36.2,<0.42",
|
2023-03-26 17:40:32 +00:00
|
|
|
"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
|
|
|
|
|
2023-10-31 15:03:53 +00:00
|
|
|
[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"]
|
2023-06-25 23:26:21 +00:00
|
|
|
|
2023-03-26 17:40:32 +00:00
|
|
|
[tool.tox]
|
|
|
|
legacy_tox_ini = """
|
|
|
|
[tox]
|
2023-10-31 15:03:53 +00:00
|
|
|
envlist = py, lint, mypy
|
2023-03-26 17:40:32 +00:00
|
|
|
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}
|
|
|
|
|
2023-10-31 15:03:53 +00:00
|
|
|
[testenv:lint]
|
2023-03-26 17:40:32 +00:00
|
|
|
deps =
|
2023-10-31 15:03:53 +00:00
|
|
|
ruff>=0.1.3,<0.2
|
2023-03-26 17:40:32 +00:00
|
|
|
commands =
|
2023-10-31 15:03:53 +00:00
|
|
|
ruff .
|
2023-03-26 17:40:32 +00:00
|
|
|
|
|
|
|
[testenv:filename_matching]
|
|
|
|
deps =
|
|
|
|
commands =
|
|
|
|
python ./test/filename_matching.py
|
|
|
|
|
|
|
|
[testenv:mypy]
|
|
|
|
deps =
|
2023-08-03 16:07:56 +00:00
|
|
|
mypy==1.4.1
|
2023-03-26 17:40:32 +00:00
|
|
|
types-certifi==2021.10.8.3
|
|
|
|
types-Flask==1.1.6
|
|
|
|
types-Werkzeug==1.0.9
|
2023-08-03 16:07:56 +00:00
|
|
|
types-requests==2.31.0.2
|
2023-03-26 17:40:32 +00:00
|
|
|
types-cryptography==3.3.23.2
|
2023-08-03 16:07:56 +00:00
|
|
|
types-pyOpenSSL==23.2.0.2
|
2023-03-26 17:40:32 +00:00
|
|
|
-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
|
|
|
|
"""
|