mitmproxy/pyproject.toml

233 lines
5.7 KiB
TOML
Raw Normal View History

[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 :: 3.12",
"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.21,<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.4,<0.5",
"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.4",
"pyparsing>=2.4.2,<3.2",
"pyperclip>=1.6.0,<1.9",
"ruamel.yaml>=0.16,<0.19",
"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.23",
]
[project.optional-dependencies]
dev = [
"click>=7.0,<8.2",
"hypothesis>=5.8,<7",
"pdoc>=4.0.0",
"pyinstaller==6.1.0",
"pytest-asyncio>=0.17,<0.22",
"pytest-cov>=2.7.1,<4.2",
"pytest-timeout>=1.3.3,<2.3",
Update pytest-xdist requirement from <3.4,>=2.1.0 to >=2.1.0,<3.6 (#6517) Updates the requirements on [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) to permit the latest version. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst">pytest-xdist's changelog</a>.</em></p> <blockquote> <h1>pytest-xdist 3.5.0 (2023-11-21)</h1> <h2>Features</h2> <ul> <li><code>[#632](https://github.com/pytest-dev/pytest-xdist/issues/632) &lt;https://github.com/pytest-dev/pytest-xdist/issues/632&gt;</code>_: <code>--dist=loadscope</code> now sorts scopes by number of tests to assign largest scopes early -- in many cases this should improve overall test session running time, as there is less chance of a large scope being left to be processed near the end of the session, leaving other workers idle.</li> </ul> <h1>pytest-xdist 3.4.0 (2023-11-11)</h1> <h2>Features</h2> <ul> <li> <p><code>[#963](https://github.com/pytest-dev/pytest-xdist/issues/963) &lt;https://github.com/pytest-dev/pytest-xdist/issues/963&gt;</code>_: Wait for workers to finish reporting when test run stops early.</p> <p>This makes sure that the results of in-progress tests are displayed. Previously these reports were being discarded, losing information about the test run.</p> </li> <li> <p><code>[#965](https://github.com/pytest-dev/pytest-xdist/issues/965) &lt;https://github.com/pytest-dev/pytest-xdist/issues/965&gt;</code>_: Added support for Python 3.12.</p> </li> </ul> <h1>pytest-xdist 3.3.1 (2023-05-19)</h1> <h2>Bug Fixes</h2> <ul> <li> <p><code>[#907](https://github.com/pytest-dev/pytest-xdist/issues/907) &lt;https://github.com/pytest-dev/pytest-xdist/issues/907&gt;</code>_: Avoid remote calls during startup as <code>execnet</code> by default does not ensure remote affinity with the main thread and might accidentally schedule the pytest worker into a non-main thread, which breaks numerous frameworks, for example <code>asyncio</code>, <code>anyio</code>, <code>PyQt/PySide</code>, etc.</p> <p>A more safe correction will require thread affinity in <code>execnet</code> (<code>pytest-dev/execnet#96 &lt;https://github.com/pytest-dev/execnet/issues/96&gt;</code>__).</p> </li> </ul> <h1>pytest-xdist 3.3.0 (2023-05-12)</h1> <h2>Features</h2> <ul> <li><code>[#555](https://github.com/pytest-dev/pytest-xdist/issues/555) &lt;https://github.com/pytest-dev/pytest-xdist/issues/555&gt;</code>_: Improved progress output when collecting nodes to be less verbose.</li> </ul> <h1>pytest-xdist 3.2.1 (2023-03-12)</h1> <p>Bug Fixes</p> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/95b309e980796a261045d770f69c016ca741473d"><code>95b309e</code></a> Release 3.5.0</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/3fe877bc6d7211f31e55d2d561803f76ea95b935"><code>3fe877b</code></a> LoadScope scheduler: Sort scopes by number of tests to assign biggest scopes ...</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/f36ea25cb53cb960037f4a8510816b81fa313035"><code>f36ea25</code></a> Create GitHub release after deploy (<a href="https://redirect.github.com/pytest-dev/pytest-xdist/issues/973">#973</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/d81f57508d064915fc16ace5dea4d43406db2ba0"><code>d81f575</code></a> Merge pull request <a href="https://redirect.github.com/pytest-dev/pytest-xdist/issues/969">#969</a> from pytest-dev/pre-commit-ci-update-config</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/1d2616418c046d0e6f059b8f76e35a0627409616"><code>1d26164</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/5f43575b42d6d4c0078de807880b8b0791b75823"><code>5f43575</code></a> Merge pull request <a href="https://redirect.github.com/pytest-dev/pytest-xdist/issues/966">#966</a> from pytest-dev/release-3.4.0</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/a6b56112f9b686aed7a354e0d50ecc26ad2d9dfe"><code>a6b5611</code></a> Update CHANGELOG</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/64f9388f4164e9f64d98a7580933e958ea4a09d5"><code>64f9388</code></a> Add support for Python 3.12</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/230ba6ad1057574c9f3d42a97f890788cd9ec6c3"><code>230ba6a</code></a> Properly wait for workers when test run terminates early (<a href="https://redirect.github.com/pytest-dev/pytest-xdist/issues/963">#963</a>)</li> <li><a href="https://github.com/pytest-dev/pytest-xdist/commit/93ca202b400eecc62919bcd9b0bab001e3f3f7ef"><code>93ca202</code></a> fix typo index -&gt; instead</li> <li>Additional commits viewable in <a href="https://github.com/pytest-dev/pytest-xdist/compare/v2.1.0...v3.5.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-02 00:02:36 +00:00
"pytest-xdist>=2.1.0,<3.6",
"pytest>=6.1.0,<8",
"requests>=2.9.1,<3",
"tox>=3.5,<5",
Update wheel requirement from <0.42,>=0.36.2 to >=0.36.2,<0.43 (#6518) Updates the requirements on [wheel](https://github.com/pypa/wheel) to permit the latest version. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/pypa/wheel/releases">wheel's releases</a>.</em></p> <blockquote> <h2>0.42.0</h2> <ul> <li>Allowed removing build tag with <code>wheel tags --build &quot;&quot;</code></li> <li>Fixed <code>wheel pack</code> and <code>wheel tags</code> writing updated <code>WHEEL</code> fields after a blank line, causing other tools to ignore them</li> <li>Fixed <code>wheel pack</code> and <code>wheel tags</code> writing <code>WHEEL</code> with CRLF line endings or a mix of CRLF and LF</li> <li>Fixed <code>wheel pack --build-number &quot;&quot;</code> not removing build tag from <code>WHEEL</code> (above changes by Benjamin Gilbert)</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/wheel/blob/main/docs/news.rst">wheel's changelog</a>.</em></p> <blockquote> <h1>Release Notes</h1> <p><strong>0.42.0 (2023-11-26)</strong></p> <ul> <li>Allowed removing build tag with <code>wheel tags --build &quot;&quot;</code></li> <li>Fixed <code>wheel pack</code> and <code>wheel tags</code> writing updated <code>WHEEL</code> fields after a blank line, causing other tools to ignore them</li> <li>Fixed <code>wheel pack</code> and <code>wheel tags</code> writing <code>WHEEL</code> with CRLF line endings or a mix of CRLF and LF</li> <li>Fixed <code>wheel pack --build-number &quot;&quot;</code> not removing build tag from <code>WHEEL</code> (above changes by Benjamin Gilbert)</li> </ul> <p><strong>0.41.3 (2023-10-30)</strong></p> <ul> <li>Updated vendored <code>packaging</code> to 23.2</li> <li>Fixed ABI tag generation for CPython 3.13a1 on Windows (PR by Sam Gross)</li> </ul> <p><strong>0.41.2 (2023-08-22)</strong></p> <ul> <li>Fixed platform tag detection for GraalPy and 32-bit python running on an aarch64 kernel (PR by Matthieu Darbois)</li> <li>Fixed <code>wheel tags</code> to not list directories in <code>RECORD</code> files (PR by Mike Taves)</li> <li>Fixed ABI tag generation for GraalPy (PR by Michael Simacek)</li> </ul> <p><strong>0.41.1 (2023-08-05)</strong></p> <ul> <li>Fixed naming of the <code>data_dir</code> directory in the presence of local version segment given via <code>egg_info.tag_build</code> (PR by Anderson Bravalheri)</li> <li>Fixed version specifiers in <code>Requires-Dist</code> being wrapped in parentheses</li> </ul> <p><strong>0.41.0 (2023-07-22)</strong></p> <ul> <li>Added full support of the build tag syntax to <code>wheel tags</code> (you can now set a build tag like <code>123mytag</code>)</li> <li>Fixed warning on Python 3.12 about <code>onerror</code> deprecation. (PR by Henry Schreiner)</li> <li>Support testing on Python 3.12 betas (PR by Ewout ter Hoeven)</li> </ul> <p><strong>0.40.0 (2023-03-14)</strong></p> <ul> <li>Added a <code>wheel tags</code> command to modify tags on an existing wheel (PR by Henry Schreiner)</li> <li>Updated vendored <code>packaging</code> to 23.0</li> <li><code>wheel unpack</code> now preserves the executable attribute of extracted files</li> <li>Fixed spaces in platform names not being converted to underscores (PR by David Tucker)</li> <li>Fixed <code>RECORD</code> files in generated wheels missing the regular file attribute</li> <li>Fixed <code>DeprecationWarning</code> about the use of the deprecated <code>pkg_resources</code> API (PR by Thomas Grainger)</li> <li>Wheel now uses flit-core as a build backend (PR by Henry Schreiner)</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/pypa/wheel/commit/63a09bb3d92630c1d35f4fcc6f79250256aeeb5c"><code>63a09bb</code></a> Created a new release</li> <li><a href="https://github.com/pypa/wheel/commit/f4b8e488dfe3da3ced0bc36aa7dcf21631e7489d"><code>f4b8e48</code></a> Several fixes to <code>WHEEL</code> metadata handling (<a href="https://redirect.github.com/pypa/wheel/issues/588">#588</a>)</li> <li><a href="https://github.com/pypa/wheel/commit/11e573283181493f7aec55146ab2862bccd4dc4d"><code>11e5732</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/pypa/wheel/issues/586">#586</a>)</li> <li><a href="https://github.com/pypa/wheel/commit/fe6bb8268d5f9e98ceec83c67d03b06c1c8862db"><code>fe6bb82</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/pypa/wheel/issues/584">#584</a>)</li> <li><a href="https://github.com/pypa/wheel/commit/b90a4bc408ce621818b3e92bb55955431a7fa22a"><code>b90a4bc</code></a> [pre-commit.ci] pre-commit autoupdate (<a href="https://redirect.github.com/pypa/wheel/issues/581">#581</a>)</li> <li><a href="https://github.com/pypa/wheel/commit/56de2ebd4bffa706a60ee0f7785a33c62be737f3"><code>56de2eb</code></a> Added a link to the GitHub repository to pyproject.toml (<a href="https://redirect.github.com/pypa/wheel/issues/563">#563</a>)</li> <li><a href="https://github.com/pypa/wheel/commit/a899f1c69ffddf564b904a5de974457c213dc36a"><code>a899f1c</code></a> Fixed parameter for release-notes</li> <li><a href="https://github.com/pypa/wheel/commit/254ba4658aa0bf1c5be536ccc02ed44e051468fd"><code>254ba46</code></a> Created a new release</li> <li><a href="https://github.com/pypa/wheel/commit/6f33736b6f252506df8e574deced5d5667d05bf6"><code>6f33736</code></a> Updated actions and added GitHub release automation</li> <li><a href="https://github.com/pypa/wheel/commit/83b77e591e6f593470f8daddf3bcfd6ca64e81bc"><code>83b77e5</code></a> Replaced <code>black</code> with <code>ruff-format</code></li> <li>Additional commits viewable in <a href="https://github.com/pypa/wheel/compare/0.36.2...0.42.0">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-02 00:02:54 +00:00
"wheel>=0.36.2,<0.43",
"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"]
[tool.tox]
legacy_tox_ini = """
[tox]
2023-10-31 15:03:53 +00:00
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}
2023-10-31 15:03:53 +00:00
[testenv:lint]
deps =
2023-10-31 15:03:53 +00:00
ruff>=0.1.3,<0.2
commands =
2023-10-31 15:03:53 +00:00
ruff .
[testenv:filename_matching]
deps =
commands =
python ./test/filename_matching.py
[testenv:mypy]
deps =
mypy==1.6.1
types-certifi==2021.10.8.3
types-Flask==1.1.6
types-Werkzeug==1.0.9
types-requests==2.31.0.10
types-cryptography==3.3.23.2
types-pyOpenSSL==23.3.0.0
-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
"""