Skip to content

Commit

Permalink
style: Enhance mypy configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
playpauseandstop committed Oct 25, 2022
1 parent d91e3e3 commit d8785c9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ repos:
language: "python"
"types": ["python"]
require_serial: true
exclude: ^(docs|migrations|tests)/.*$
exclude: ^(.*/)?(docs|migrations|tests)/.*$

- repo: "https://github.com/shellcheck-py/shellcheck-py"
rev: "v0.8.0.4"
Expand Down
42 changes: 20 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ build-backend = "poetry.core.masonry.api"
[tool.badabump]
version_type = "semver"
version_files = [
"./pyproject.toml",
"./src/aiohttp_middlewares/__init__.py",
"pyproject.toml",
"src/aiohttp_middlewares/__init__.py",
]

[tool.black]
Expand All @@ -18,11 +18,17 @@ branch = true
source = ["aiohttp_middlewares"]

[tool.coverage.paths]
source = ["./src/"]
source = ["src/"]

[tool.coverage.report]
exclude_lines = ["if TYPE_CHECKING:", "@overload"]
omit = ["./src/*/__main__.py", "./src/*/annotations.py"]
exclude_lines = [
"if TYPE_CHECKING:",
"@overload",
]
omit = [
"src/*/__main__.py",
"src/*/annotations.py",
]
fail_under = 95
skip_covered = true
show_missing = true
Expand All @@ -32,8 +38,8 @@ profile = "attrs"
combine_as_imports = true
force_alphabetical_sort_within_sections = true
lines_between_types = 0
src_paths = ["./", "./src/"]
virtual_env = "./.venv/"
src_paths = ["src/"]
virtual_env = ".venv/"

[tool.mypy]
allow_untyped_globals = true
Expand All @@ -44,29 +50,20 @@ disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
exclude = ["docs/", "tests/"]
exclude = ["docs/", "migrations/", "tests/"]
follow_imports = "normal"
follow_imports_for_stubs = true
ignore_missing_imports = false
namespace_packages = true
no_implicit_optional = true
mypy_path = "./src/"
python_executable = "./.venv/bin/python3"
mypy_path = "src/"
python_executable = ".venv/bin/python3"
show_column_numbers = true
show_error_codes = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_ignores = true

[[tool.mypy.overrides]]
module = [
"conftest",
"migrations.*",
"tests.*",
"*.tests",
]
ignore_errors = true

[tool.poetry]
name = "aiohttp-middlewares"
version = "2.1.1"
Expand All @@ -78,7 +75,7 @@ homepage = "https://igordavydenko.com/projects.html#aiohttp-middlewares"
repository = "https://github.com/playpauseandstop/aiohttp-middlewares"
documentation = "https://aiohttp-middlewares.readthedocs.io/"
packages = [
{include = "aiohttp_middlewares", from = "./src/"},
{include = "aiohttp_middlewares", from = "src/"},
]
keywords = ["aiohttp", "aiohttp-server", "middlewares", "aiohttp-middlewares"]
classifiers = [
Expand Down Expand Up @@ -121,10 +118,11 @@ pytest-asyncio = "^0.20.1"
pytest-cov = "^4.0.0"

[tool.pytest.ini_options]
minversion = "7.1.3"
minversion = "7.2.0"
addopts = "--cov --no-cov-on-fail"
testpaths = ["./tests/"]
testpaths = ["tests/"]
log_level = "info"
# Local settings
asyncio_mode = "auto"

[tool.tox]
Expand Down

0 comments on commit d8785c9

Please sign in to comment.