112 lines
3.5 KiB
INI

[flake8]
max-complexity = 20
ignore =
# Ignore: line length issues, since black's formatter will take care of them.
E501,
# Ignore: 1 blank line required before class docstring.
D203,
# See https://stackoverflow.com/a/57074416.
W503,
# See https://github.com/psf/black/issues/315.
E203,
# Allow usages of functools.lru_cache.
B019,
# This rule flags the use of function calls in argument defaults.
# There's some good reasons to do this, so we're ok with it.
B008,
# TODO: However, we should enable B006 to catch issues with mutable args.
B006,
# TODO: Enable B007 - unused loop control variable.
B007
# TODO: Enable B902 - require self/cls naming.
# TODO: Enable B904 - use raise from in except clauses.
exclude =
.git,
src/datahub/metadata,
venv,
.tox,
__pycache__
per-file-ignores =
# imported but unused
__init__.py: F401
ban-relative-imports = true
[mypy]
plugins =
./tests/test_helpers/sqlalchemy_mypy_plugin.py,
pydantic.mypy
exclude = ^(venv/|build/|dist/|examples/transforms/setup.py)
ignore_missing_imports = yes
namespace_packages = no
# implicit_optional = no
strict_optional = yes
check_untyped_defs = yes
disallow_incomplete_defs = yes
disallow_untyped_decorators = yes
warn_unused_configs = yes
# eventually we'd like to enable these
disallow_untyped_defs = no
# try to be a bit more strict in certain areas of the codebase
[mypy-datahub.*]
ignore_missing_imports = no
[mypy-datahub_provider.*]
ignore_missing_imports = no
[mypy-tests.*]
ignore_missing_imports = no
[mypy-google.protobuf.*]
# mypy sometimes ignores the above ignore_missing_imports = yes
# See https://github.com/python/mypy/issues/10632 and
# https://github.com/python/mypy/issues/10619#issuecomment-1174208395
# for a discussion of why this happens.
ignore_missing_imports = yes
[mypy-datahub.configuration.*]
disallow_untyped_defs = yes
[mypy-datahub.emitter.*]
disallow_untyped_defs = yes
[mypy-datahub.ingestion.api.*]
disallow_untyped_defs = yes
[mypy-datahub.ingestion.run.*]
disallow_untyped_defs = yes
[mypy-datahub.utilities.*]
disallow_untyped_defs = yes
[tool:pytest]
asyncio_mode = auto
addopts = --cov=src --cov-report= --cov-config setup.cfg --strict-markers
markers =
airflow: marks tests related to airflow (deselect with '-m not airflow')
slow_unit: marks tests to only run slow unit tests (deselect with '-m not slow_unit')
integration: marks tests to only run in integration (deselect with '-m "not integration"')
integration_batch_1: mark tests to only run in batch 1 of integration tests. This is done mainly for parallelisation (deselect with '-m not integration_batch_1')
slow_integration: marks tests that are too slow to even run in integration (deselect with '-m "not slow_integration"')
testpaths =
tests/unit
tests/integration
[coverage:run]
# Because of some quirks in the way setup.cfg, coverage.py, pytest-cov,
# and tox interact, we should not uncomment the following line.
# See https://pytest-cov.readthedocs.io/en/latest/config.html and
# https://coverage.readthedocs.io/en/coverage-5.0/config.html.
# We also have some additional pytest/cov config options in tox.ini.
# source = src
[coverage:paths]
# This is necessary for tox-based coverage to be counted properly.
source =
src
*/site-packages
[coverage:report]
show_missing = true
exclude_lines =
pragma: no cover
@abstract
if TYPE_CHECKING:
omit =
# omit codegen
src/datahub/metadata/*
# omit example dags
src/datahub_provider/example_dags/*