datahub/metadata-ingestion/pyproject.toml
Sergio Gómez Villamor f1c95c79d1
chore: Remove Pydantic V1 deprecation warnings (#15057)
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-05 14:31:43 +00:00

67 lines
2.2 KiB
TOML

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=78.1.1", "wheel"]
[tool.ruff.lint.isort]
section-order = ["future", "patch", "standard-library", "third-party", "first-party", "local-folder"]
sections = { "patch" = ["datahub.utilities._markupsafe_compat", "datahub.sql_parsing._sqlglot_patch"] }
combine-as-imports = true
[tool.ruff]
target-version = "py39"
# Same as Black.
line-length = 88
# Exclude directories matching these patterns.
exclude = [
".git",
"src/datahub/metadata",
"venv",
".tox",
"__pycache__",
]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C90", # mccabe complexity
"E", # pycodestyle errors
"F", # pyflakes
"G010", # logging.warn -> logging.warning
"I", # isort
"TID", # flake8-tidy-imports
"RUF100", # unused-noqa
"SIM", # flake8-simplify
]
extend-ignore = [
"E501", # Handled by formatter
"E111", # Handled by formatter
"E114", # Handled by formatter
"E117", # Handled by formatter
"B019", # Allow usages of functools.lru_cache
"B008", # Allow function call in argument defaults
"RUF012", # mutable-class-default; incompatible with pydantic
"RUF015", # unnecessary-iterable-allocation-for-first-element
# Can be enabled later if someone wants to fix existing cases or an auto-fix becomes available
"SIM102", # Use a single `if` statement instead of nested `if` statements
"SIM103", # Return the condition directly
"SIM105", # Use `contextlib.suppress(...)` instead of `try`-`except`-`pass`
"SIM115", # Use a context manager for opening files
"SIM116", # Use a dictionary instead of consecutive `if` statements
]
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-tidy-imports.banned-api]
# pytandic v2 deprecations
"pydantic.validator" = { msg = "Use pydantic.field_validator instead of deprecated validator" }
"pydantic.root_validator" = { msg = "Use pydantic.model_validator instead of deprecated root_validator" }
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"src/datahub/configuration/pydantic_migration_helpers.py" = ["TID251"] # Intentional V1 imports for backward compatibility