代码拉取完成,页面将自动刷新
# 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)
# 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",
"TCH", # Rules around TYPE_CHECKING blocks
"TID251", # Specific modules or module members that may not be imported or accessed
"TID253", # Ban certain modules from being imported at module level
]
extend-ignore = [
"D203",
"D212",
"D213",
"D214",
"D215",
"E731",
"TCH003", # Do not move imports from stdlib to TYPE_CHECKING block
]
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", "TCH004"]
"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
# Pydantic also require models to be imported during execution
"airflow/serialization/pydantic/*.py" = ["I002", "UP007", "TCH001"]
# Ignore pydoc style from these
"*.pyi" = ["D"]
"scripts/*" = ["D"]
"docs/*" = ["D"]
"provider_packages/*" = ["D"]
"*/example_dags/*" = ["D"]
"chart/*" = ["D"]
# In addition ignore top level imports, e.g. pandas, numpy in tests and dev
"dev/*" = ["D", "TID253"]
"tests/*" = ["D", "TID253"]
"docker_tests/*" = ["D", "TID253"]
"kubernetes_tests/*" = ["D", "TID253"]
# 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
"scripts/ci/pre_commit/*.py" = ["E402"]
"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"]
[tool.ruff.flake8-tidy-imports.banned-api]
"airflow.AirflowException".msg = "Use airflow.exceptions.AirflowException instead."
"airflow.Dataset".msg = "Use airflow.datasets.Dataset instead."
"airflow.models.baseoperator.BaseOperatorLink".msg = "Use airflow.models.baseoperatorlink.BaseOperatorLink"
[tool.ruff.flake8-tidy-imports]
# Ban certain modules from being imported at module level, instead requiring
# that they're imported lazily (e.g., within a function definition).
banned-module-level-imports = ["numpy", "pandas"]
[tool.ruff.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions"]
[tool.coverage.run]
branch = true
relative_files = true
source = ["airflow"]
omit = [
"airflow/_vendor/**",
"airflow/contrib/**",
"airflow/example_dags/**",
"airflow/migrations/**",
"airflow/providers/**/example_dags/**",
"airflow/www/node_modules/**",
"airflow/providers/google/ads/_vendor/**",
]
[tool.coverage.report]
skip_empty = true
exclude_also = [
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"@(abc\\.)?abstractmethod",
"@(typing(_extensions)?\\.)?overload",
"if (typing(_extensions)?\\.)?TYPE_CHECKING:"
]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。