diff --git a/pyproject.toml b/pyproject.toml index d74fe7bf96..d5313c64cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,3 +99,29 @@ line-length = 120 [tool.ruff.isort] combine-as-imports = true + +[tool.mypy] +ignore_missing_imports = true +strict = true + +[[tool.mypy.overrides]] +module = "tests.*" +disallow_untyped_defs = false +check_untyped_defs = true + +[tool.pytest.ini_options] +addopts = "-rxXs" +filterwarnings = [ + "error", + "ignore: You seem to already have a custom sys.excepthook handler installed. I'll skip installing Trio's custom handler, but this means MultiErrors will not show full tracebacks.:RuntimeWarning", + # See: https://github.com/agronholm/anyio/issues/508 + "ignore: trio.MultiError is deprecated since Trio 0.22.0:trio.TrioDeprecationWarning" +] +markers = [ + "copied_from(source, changes=None): mark test as copied from somewhere else, along with a description of changes made to accodomate e.g. our test setup", + "network: marks tests which require network connection. Used in 3rd-party build environments that have network disabled." +] + +[tool.coverage.run] +omit = ["venv/*", "httpx/_compat.py"] +include = ["httpx/*", "tests/*"] diff --git a/requirements.txt b/requirements.txt index b2ac31891f..840ecd0cf2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ twine==4.0.2 # Tests & Linting black==23.3.0 -coverage==7.2.2 +coverage[toml]==7.2.2 cryptography==40.0.2 mypy==1.0.1 types-certifi==2021.10.8.2 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 728160bf86..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,22 +0,0 @@ -[mypy] -ignore_missing_imports = True -strict = True - -[mypy-tests.*] -disallow_untyped_defs = False -check_untyped_defs = True - -[tool:pytest] -addopts = -rxXs -filterwarnings = - error - ignore: You seem to already have a custom sys.excepthook handler installed. I'll skip installing Trio's custom handler, but this means MultiErrors will not show full tracebacks.:RuntimeWarning - # See: https://github.com/agronholm/anyio/issues/508 - ignore: trio\.MultiError is deprecated since Trio 0\.22\.0:trio.TrioDeprecationWarning -markers = - copied_from(source, changes=None): mark test as copied from somewhere else, along with a description of changes made to accodomate e.g. our test setup - network: marks tests which require network connection. Used in 3rd-party build environments that have network disabled. - -[coverage:run] -omit = venv/*, httpx/_compat.py -include = httpx/*, tests/*