From fef2d116194c91dca9e0632b8126ae61d446dc16 Mon Sep 17 00:00:00 2001 From: Andrey Anshin Date: Tue, 6 Feb 2024 13:37:52 +0400 Subject: [PATCH] Reorder settings in pyproject.toml --- pyproject.toml | 86 +++++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 40 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d8fc12970830c..a260458aebce5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1243,11 +1243,13 @@ artifacts = [ "/airflow/git_version" ] - +## black settings ## [tool.black] line-length = 110 target-version = ['py38', 'py39', 'py310', 'py311'] + +## ruff settings ## [tool.ruff] target-version = "py38" line-length = 110 @@ -1297,43 +1299,9 @@ ignore = [ "TCH003", # Do not move imports from stdlib to TYPE_CHECKING block ] - [tool.ruff.format] docstring-code-format = true -[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.lint.isort] required-imports = ["from __future__ import annotations"] combine-as-imports = true @@ -1373,6 +1341,11 @@ combine-as-imports = true "tests/providers/elasticsearch/log/elasticmock/__init__.py" = ["E402"] "tests/providers/elasticsearch/log/elasticmock/utilities/__init__.py" = ["E402"] +[tool.ruff.lint.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.lint.flake8-tidy-imports.banned-api] "airflow.AirflowException".msg = "Use airflow.exceptions.AirflowException instead." "airflow.Dataset".msg = "Use airflow.datasets.Dataset instead." @@ -1380,14 +1353,45 @@ combine-as-imports = true # Uses deprecated in Python 3.12 `datetime.datetime.utcfromtimestamp` "pendulum.from_timestamp".msg = "Use airflow.utils.timezone.from_timestamp" -[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.lint.flake8-type-checking] exempt-modules = ["typing", "typing_extensions"] +## pytest settings ## +[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", +] + + +## coverage.py settings ## [tool.coverage.run] branch = true relative_files = true @@ -1414,6 +1418,8 @@ exclude_also = [ "if (typing(_extensions)?\\.)?TYPE_CHECKING:" ] + +## mypy settings ## [tool.mypy] ignore_missing_imports = true no_implicit_optional = true