This repository has been archived by the owner on Nov 24, 2023. It is now read-only.
forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
168 lines (154 loc) · 5.3 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# 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 = ['py37', 'py38', 'py39', 'py310']
# 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"
[project]
requires-python = ">=3.8"
[tool.ruff]
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"
]
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",
]
[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 = [
"*.py",
]
testpaths = [
"tests",
]
[tool.ruff.isort]
known-first-party = ["airflow", "airflow_breeze", "docker_tests", "docs", "kubernetes_tests", "tests"]
required-imports = ["from __future__ import annotations"]
combine-as-imports = true
# TODO: for now, https://github.com/charliermarsh/ruff/issues/1817
known-third-party = [
"asana",
"atlassian",
"celery",
"cloudant",
"databricks",
"datadog",
"docker",
"elasticsearch",
"github",
"google",
"grpc",
"jenkins",
"mysql",
"neo4j",
"papermill",
"redis",
"sendgrid",
"snowflake",
"telegram",
"trino",
]
[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"]