1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
[tool.pytest.ini_options]
addopts = "--cov=. --cov-context=test --durations=0 --durations-min=3.0"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
[tool.coverage.report]
skip_empty = true
omit = ["*test*", "setup.py", "docs/*", "*/__init__.py"]
exclude_also = [
# TYPE_CHECKING is always False in runtime
# https://docs.python.org/3/library/typing.html#typing.TYPE_CHECKING
"if TYPE_CHECKING:",
]
[tool.pylint]
ignore-paths=["docs/"]
[tool.pylint."messages control"]
disable = [
"C0103", # Argument name "xyz" doesn't conform to snake_case naming style
"C0301", # Line too long. This is handled by black
# # To be removed:
"C0114", # Missing module docstring
"C0115", # Missing class docstring
"C0116", # Missing function or method docstring
"C0302", # Too many lines in module
"R0801", # Similar lines in 2 files
"R0902", # Too many instance attributes
"R0903", # Too few public methods
"R0904", # Too many public methods
"R0913", # Too many arguments
"R0914", # Too many local variables
"W0511", # TODO
"W0621", # redefined-outer-name
"R0917", # too many positional arguments
]
[tool.ruff]
target-version = 'py39'
line-length = 120
exclude = [
"docs/"
]
[tool.ruff.format]
preview = true
[tool.ruff.lint]
# See complete list : https://beta.ruff.rs/docs/rules
select = [
# "F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"C90", # mccabe
"I", # isort
# "N", # pep8-naming
"UP", # pyupgrade
"YTT", # flake8-2020
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"DJ", # flake8-django
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
# "PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
# "SLF", # flake8-self
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"INT", # flake8-gettext
"PD", # pandas-vet
"PLC", # pylint-convention
"PLE", # pylint-errors
"PLW", # pylint-warnings
"FLY", # flynt
"NPY", # numpy-specific rules
"AIR", # airflow
]
fixable = [
"PIE",
"PT",
"C4",
"I",
"SIM",
"SIM",
"UP",
"TCH",
]
# Never enforce some rules
ignore = [
"E501", # line length violations
"ISC001" # Implicitly concatenated string literals on one line (conflict with ruff format)
]
## Ignore some rules for some files
[tool.ruff.lint.per-file-ignores]
"**/*test*.py" = [
"SLF001", # Private member accessed
"T201", # print found
]
[tool.ruff.lint.isort]
case-sensitive = true
force-wrap-aliases = true
combine-as-imports = true
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
[tool.mypy]
# error whenever it encounters a function definition without type annotations
#disallow_untyped_defs = true
# error whenever a function with type annotations calls a function defined without annotations
disallow_untyped_calls = true
# stop treating arguments with a None default value as having an implicit Optional type
no_implicit_optional = true
# error whenever your code uses an unnecessary cast that can safely be removed
warn_redundant_casts = true
# Shows a warning when encountering any code inferred to be unreachable or redundant after performing type analysis.
warn_unreachable = true
# Prohibit equality checks, identity checks, and container checks between non-overlapping types.
strict_equality = true
|