This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 2a8452d059 Update ruff to v0.2.1 (#37188)
2a8452d059 is described below
commit 2a8452d059018800e3104cba7282bd9a9b2213ab
Author: Hussein Awala <[email protected]>
AuthorDate: Tue Feb 6 06:09:27 2024 +0100
Update ruff to v0.2.1 (#37188)
---
.pre-commit-config.yaml | 4 ++--
docs/conf.py | 2 +-
pyproject.toml | 16 +++++++++-------
tests/www/views/test_views_rendered.py | 2 +-
4 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 92954698b4..8be555de3a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -343,7 +343,7 @@ repos:
types_or: [python, pyi]
args: [--fix]
require_serial: true
- additional_dependencies: ["ruff==0.1.11"]
+ additional_dependencies: ["ruff==0.2.1"]
exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py
- id: ruff-format
name: Run 'ruff format' for extremely fast Python formatting
@@ -353,7 +353,7 @@ repos:
types_or: [python, pyi]
args: []
require_serial: true
- additional_dependencies: ["ruff==0.1.11"]
+ additional_dependencies: ["ruff==0.2.1"]
exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py|^airflow/contrib/
- id: replace-bad-characters
name: Replace bad characters
diff --git a/docs/conf.py b/docs/conf.py
index 52fc0390c2..10dd8cee42 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -47,7 +47,7 @@ from airflow.configuration import AirflowConfigParser,
retrieve_configuration_de
sys.path.append(str(Path(__file__).parent / "exts"))
-from docs_build.third_party_inventories import THIRD_PARTY_INDEXES # noqa:
E402
+from docs_build.third_party_inventories import THIRD_PARTY_INDEXES
CONF_DIR = pathlib.Path(__file__).parent.absolute()
INVENTORY_CACHE_DIR = CONF_DIR / "_inventory_cache"
diff --git a/pyproject.toml b/pyproject.toml
index a8384e675f..d8fc129708 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -322,7 +322,7 @@ devel-sentry = [
devel-static-checks = [
"black>=23.12.0",
"pre-commit>=3.5.0",
- "ruff==0.1.11",
+ "ruff==0.2.1",
"yamllint>=1.33.0",
]
devel-tests = [
@@ -1250,7 +1250,6 @@ target-version = ['py38', 'py39', 'py310', 'py311']
[tool.ruff]
target-version = "py38"
-typing-modules = ["airflow.typing_compat"]
line-length = 110
extend-exclude = [
".eggs",
@@ -1263,6 +1262,10 @@ extend-exclude = [
"tests/dags/test_imports.py",
]
+namespace-packages = ["airflow/providers"]
+
+[tool.ruff.lint]
+typing-modules = ["airflow.typing_compat"]
extend-select = [
"I", # Missing required import (auto-fixable)
"UP", # Pyupgrade
@@ -1294,7 +1297,6 @@ ignore = [
"TCH003", # Do not move imports from stdlib to TYPE_CHECKING block
]
-namespace-packages = ["airflow/providers"]
[tool.ruff.format]
docstring-code-format = true
@@ -1332,11 +1334,11 @@ testpaths = [
"tests",
]
-[tool.ruff.isort]
+[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
combine-as-imports = true
-[tool.ruff.per-file-ignores]
+[tool.ruff.lint.per-file-ignores]
"airflow/models/__init__.py" = ["F401", "TCH004"]
"airflow/models/sqla_models.py" = ["F401"]
@@ -1371,7 +1373,7 @@ combine-as-imports = true
"tests/providers/elasticsearch/log/elasticmock/__init__.py" = ["E402"]
"tests/providers/elasticsearch/log/elasticmock/utilities/__init__.py" =
["E402"]
-[tool.ruff.flake8-tidy-imports.banned-api]
+[tool.ruff.lint.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"
@@ -1383,7 +1385,7 @@ combine-as-imports = true
# that they're imported lazily (e.g., within a function definition).
banned-module-level-imports = ["numpy", "pandas"]
-[tool.ruff.flake8-type-checking]
+[tool.ruff.lint.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions"]
[tool.coverage.run]
diff --git a/tests/www/views/test_views_rendered.py
b/tests/www/views/test_views_rendered.py
index 7aabec7ef6..7621c2561e 100644
--- a/tests/www/views/test_views_rendered.py
+++ b/tests/www/views/test_views_rendered.py
@@ -256,7 +256,7 @@ def test_rendered_template_secret(admin_client,
create_dag_run, task_secret):
if os.environ.get("_AIRFLOW_SKIP_DB_TESTS") == "true":
# Handle collection of the test by non-db case
- Variable = mock.MagicMock() # type: ignore[misc] # noqa: F811
+ Variable = mock.MagicMock() # type: ignore[misc]
else:
initial_db_init()