2021-01-31 22:40:30 -08:00
|
|
|
[flake8]
|
2022-07-24 23:52:25 -07:00
|
|
|
max-complexity = 20
|
2021-02-18 20:05:39 -08:00
|
|
|
ignore =
|
2021-04-23 23:50:28 -07:00
|
|
|
# Ignore: line length issues, since black's formatter will take care of them.
|
|
|
|
|
E501,
|
2021-02-18 20:05:39 -08:00
|
|
|
# Ignore: 1 blank line required before class docstring.
|
|
|
|
|
D203,
|
|
|
|
|
# See https://stackoverflow.com/a/57074416.
|
2021-11-24 10:19:03 -08:00
|
|
|
W503,
|
|
|
|
|
# See https://github.com/psf/black/issues/315.
|
2023-04-11 02:44:42 +05:30
|
|
|
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.
|
2021-02-11 21:59:54 -08:00
|
|
|
exclude =
|
|
|
|
|
.git,
|
2021-02-15 15:04:21 -08:00
|
|
|
src/datahub/metadata,
|
2021-04-05 19:11:28 -07:00
|
|
|
venv,
|
2021-04-26 16:44:36 -07:00
|
|
|
.tox,
|
2021-02-11 21:59:54 -08:00
|
|
|
__pycache__
|
|
|
|
|
per-file-ignores =
|
|
|
|
|
# imported but unused
|
|
|
|
|
__init__.py: F401
|
2021-08-06 13:25:30 -04:00
|
|
|
ban-relative-imports = true
|
2021-01-31 22:40:30 -08:00
|
|
|
|
|
|
|
|
[mypy]
|
2021-02-23 15:55:31 -08:00
|
|
|
plugins =
|
2022-11-11 15:04:36 -05:00
|
|
|
./tests/test_helpers/sqlalchemy_mypy_plugin.py,
|
2021-02-23 15:55:31 -08:00
|
|
|
pydantic.mypy
|
2023-04-11 02:44:42 +05:30
|
|
|
exclude = ^(venv/|build/|dist/|examples/transforms/setup.py)
|
2021-03-26 21:57:05 -07:00
|
|
|
ignore_missing_imports = yes
|
2022-11-09 02:38:42 -08:00
|
|
|
namespace_packages = no
|
2023-04-11 02:44:42 +05:30
|
|
|
# implicit_optional = no
|
2021-01-31 22:40:30 -08:00
|
|
|
strict_optional = yes
|
2021-03-26 21:57:05 -07:00
|
|
|
check_untyped_defs = yes
|
2021-04-14 13:40:24 -07:00
|
|
|
disallow_incomplete_defs = yes
|
|
|
|
|
disallow_untyped_decorators = yes
|
2021-05-06 07:48:56 -07:00
|
|
|
warn_unused_configs = yes
|
2021-03-26 21:57:05 -07:00
|
|
|
# eventually we'd like to enable these
|
2021-01-31 22:40:30 -08:00
|
|
|
disallow_untyped_defs = no
|
|
|
|
|
|
2021-07-25 21:19:25 -07:00
|
|
|
# try to be a bit more strict in certain areas of the codebase
|
2021-05-06 07:48:56 -07:00
|
|
|
[mypy-datahub.*]
|
|
|
|
|
ignore_missing_imports = no
|
2022-12-02 13:53:28 -05:00
|
|
|
[mypy-datahub_provider.*]
|
|
|
|
|
ignore_missing_imports = no
|
2021-05-17 11:42:12 -07:00
|
|
|
[mypy-tests.*]
|
|
|
|
|
ignore_missing_imports = no
|
2022-12-02 13:53:28 -05:00
|
|
|
[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
|
2021-07-25 21:19:25 -07:00
|
|
|
[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
|
2021-05-06 07:48:56 -07:00
|
|
|
|
2021-01-31 22:40:30 -08:00
|
|
|
[tool:pytest]
|
2022-02-10 20:02:23 -08:00
|
|
|
asyncio_mode = auto
|
2023-03-09 18:22:03 -05:00
|
|
|
addopts = --cov=src --cov-report= --cov-config setup.cfg --strict-markers
|
2021-04-01 12:15:05 -07:00
|
|
|
markers =
|
2023-10-03 23:17:49 -04:00
|
|
|
slow: marks tests that are slow to run, including all docker-based tests (deselect with '-m not slow')
|
|
|
|
|
integration: marks all integration tests, across all batches (deselect with '-m "not integration"')
|
|
|
|
|
integration_batch_0: mark tests to run in batch 0 of integration tests. This is done mainly for parallelisation in CI. Batch 0 is the default batch.
|
|
|
|
|
integration_batch_1: mark tests to run in batch 1 of integration tests
|
|
|
|
|
integration_batch_2: mark tests to run in batch 2 of integration tests
|
2023-04-14 21:09:43 -04:00
|
|
|
testpaths =
|
2021-07-20 19:13:49 -07:00
|
|
|
tests/unit
|
|
|
|
|
tests/integration
|
2023-05-26 04:10:56 +05:30
|
|
|
filterwarnings =
|
|
|
|
|
# Ignore some warnings that come from dependencies.
|
|
|
|
|
ignore:Deprecated call to \`pkg_resources.declare_namespace:DeprecationWarning
|
|
|
|
|
ignore:pkg_resources is deprecated as an API:DeprecationWarning
|
|
|
|
|
ignore:Did not recognize type:sqlalchemy.exc.SAWarning
|
2023-11-10 09:34:08 -08:00
|
|
|
ignore::datahub.configuration.pydantic_migration_helpers.PydanticDeprecatedSince20
|
2021-07-17 20:00:50 -07:00
|
|
|
|
2021-07-26 13:25:58 -07:00
|
|
|
[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
|
|
|
|
|
|
2021-07-17 20:00:50 -07:00
|
|
|
[coverage:paths]
|
2021-07-26 13:25:58 -07:00
|
|
|
# This is necessary for tox-based coverage to be counted properly.
|
2021-07-17 20:00:50 -07:00
|
|
|
source =
|
|
|
|
|
src
|
|
|
|
|
*/site-packages
|
2021-01-31 22:40:30 -08:00
|
|
|
|
|
|
|
|
[coverage:report]
|
|
|
|
|
show_missing = true
|
|
|
|
|
exclude_lines =
|
2021-07-17 20:00:50 -07:00
|
|
|
pragma: no cover
|
|
|
|
|
@abstract
|
|
|
|
|
if TYPE_CHECKING:
|
2021-02-05 21:03:04 -08:00
|
|
|
omit =
|
|
|
|
|
# omit codegen
|
2021-02-15 15:04:21 -08:00
|
|
|
src/datahub/metadata/*
|