| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| [tool.black] |
| line-length = 110 |
| target-version = ['py38', 'py39', 'py310', 'py311'] |
| |
| # Editable installs are currently broken using setuptools 64.0.0 and above. The problem is tracked in |
| # https://github.com/pypa/setuptools/issues/3548. We're also discussing how we could potentially fix |
| # this problem on our end in issue https://github.com/apache/airflow/issues/30764. Until then we need |
| # to use one of the following workarounds locally for editable installs: |
| # 1) Pin setuptools <= 63.4.3 below in the [build-system] section. |
| # 2) Include your airflow source code directory in PYTHONPATH. |
| [build-system] |
| requires = ['setuptools==67.2.0'] |
| build-backend = "setuptools.build_meta" |
| |
| [tool.ruff] |
| target-version = "py38" |
| typing-modules = ["airflow.typing_compat"] |
| line-length = 110 |
| extend-exclude = [ |
| ".eggs", |
| "airflow/_vendor/*", |
| "airflow/providers/google/ads/_vendor/*", |
| # The files generated by stubgen aren't 100% valid syntax it turns out, and we don't ship them, so we can |
| # ignore them in ruff |
| "airflow/providers/common/sql/*/*.pyi", |
| "airflow/migrations/versions/*.py", |
| "tests/dags/test_imports.py", |
| ] |
| |
| extend-select = [ |
| "I", # Missing required import (auto-fixable) |
| "UP", # Pyupgrade |
| "RUF100", # Unused noqa (auto-fixable) |
| |
| # implicit single-line string concatenation |
| "ISC001", |
| # We ignore more pydocstyle than we enable, so be more selective at what we enable |
| "D101", |
| "D106", |
| "D2", |
| "D3", |
| "D400", |
| # "D401", # Not enabled by ruff, but we don't want it |
| "D402", |
| "D403", |
| "D412", |
| "D419" |
| ] |
| extend-ignore = [ |
| "D203", |
| "D205", |
| "D212", |
| "D213", |
| "D214", |
| "D215", |
| "E731", |
| ] |
| |
| namespace-packages = ["airflow/providers"] |
| |
| [tool.pytest.ini_options] |
| # * Disable `flaky` plugin for pytest. This plugin conflicts with `rerunfailures` because provide same marker. |
| # * Disable `nose` builtin plugin for pytest. This feature deprecated in 7.2 and will be removed in pytest>=8 |
| # * And we focus on use native pytest capabilities rather than adopt another frameworks. |
| addopts = "-rasl --verbosity=2 -p no:flaky -p no:nose --asyncio-mode=strict" |
| norecursedirs = [ |
| ".eggs", |
| "airflow", |
| "tests/dags_with_system_exit", |
| "tests/test_utils", |
| "tests/dags_corrupted", |
| "tests/dags", |
| "tests/system/providers/google/cloud/dataproc/resources", |
| "tests/system/providers/google/cloud/gcs/resources", |
| ] |
| log_level = "INFO" |
| filterwarnings = [ |
| "error::pytest.PytestCollectionWarning", |
| "ignore::DeprecationWarning:flask_appbuilder.filemanager", |
| "ignore::DeprecationWarning:flask_appbuilder.widgets", |
| # https://github.com/dpgaspar/Flask-AppBuilder/pull/1940 |
| "ignore::DeprecationWarning:flask_sqlalchemy", |
| # https://github.com/dpgaspar/Flask-AppBuilder/pull/1903 |
| "ignore::DeprecationWarning:apispec.utils", |
| ] |
| python_files = [ |
| "test_*.py", |
| "example_*.py", |
| ] |
| testpaths = [ |
| "tests", |
| ] |
| |
| [tool.ruff.isort] |
| required-imports = ["from __future__ import annotations"] |
| combine-as-imports = true |
| |
| [tool.ruff.per-file-ignores] |
| "airflow/models/__init__.py" = ["F401"] |
| "airflow/models/sqla_models.py" = ["F401"] |
| |
| # The test_python.py is needed because adding __future__.annotations breaks runtime checks that are |
| # needed for the test to work |
| "tests/decorators/test_python.py" = ["I002"] |
| |
| # The Pydantic representations of SqlAlchemy Models are not parsed well with Pydantic |
| # when __future__.annotations is used so we need to skip them from upgrading |
| "airflow/serialization/pydantic/*.py" = ["I002"] |
| |
| # Ignore pydoc style from these |
| "*.pyi" = ["D"] |
| "tests/*" = ["D"] |
| "scripts/*" = ["D"] |
| "dev/*" = ["D"] |
| "docs/*" = ["D"] |
| "provider_packages/*" = ["D"] |
| "docker_tests/*" = ["D"] |
| "kubernetes_tests/*" = ["D"] |
| "*/example_dags/*" = ["D"] |
| "chart/*" = ["D"] |
| |
| # All of the modules which have an extra license header (i.e. that we copy from another project) need to |
| # ignore E402 -- module level import not at top level |
| "airflow/api/auth/backend/kerberos_auth.py" = ["E402"] |
| "airflow/security/kerberos.py" = ["E402"] |
| "airflow/security/utils.py" = ["E402"] |
| "tests/providers/elasticsearch/log/elasticmock/__init__.py" = ["E402"] |
| "tests/providers/elasticsearch/log/elasticmock/utilities/__init__.py" = ["E402"] |