This is an automated email from the ASF dual-hosted git repository.

jedcunningham 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 770228e4c0 Move `.coveragerc` content to `pyproject.toml` (#33589)
770228e4c0 is described below

commit 770228e4c01dd0a36857a2e06689c9105119b2e2
Author: Andrey Anshin <[email protected]>
AuthorDate: Tue Aug 22 01:51:26 2023 +0400

    Move `.coveragerc` content to `pyproject.toml` (#33589)
---
 .coveragerc                                        | 41 ----------------------
 .dockerignore                                      |  1 -
 .gitattributes                                     |  1 -
 .rat-excludes                                      |  1 -
 Dockerfile.ci                                      |  4 ++-
 README.md                                          |  2 +-
 codecov.yml                                        |  2 +-
 .../airflow_breeze/utils/docker_command_utils.py   |  1 -
 pyproject.toml                                     | 26 ++++++++++++++
 scripts/ci/docker-compose/local.yml                |  3 --
 scripts/docker/entrypoint_ci.sh                    |  6 ++--
 setup.py                                           |  2 +-
 12 files changed, 36 insertions(+), 54 deletions(-)

diff --git a/.coveragerc b/.coveragerc
deleted file mode 100644
index 2ae5fc763b..0000000000
--- a/.coveragerc
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# 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.
-
-[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/**
-
-[report]
-skip_empty = True
-exclude_lines =
-    pragma: no cover
-    @abstractmethod
-    @abstractproperty
-    def __repr__
-    raise NotImplementedError
-    if __name__ == .__main__.:
-    if TYPE_CHECKING:
diff --git a/.dockerignore b/.dockerignore
index 3a6fd4e2f1..803b75ea80 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -45,7 +45,6 @@
 !helm_tests
 !docker_tests
 
-!.coveragerc
 !.rat-excludes
 !.dockerignore
 !RELEASE_NOTES.rst
diff --git a/.gitattributes b/.gitattributes
index 583924fead..9b5cc3f781 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -24,7 +24,6 @@ CONTRIBUTORS_QUICK_START.rst export-ignore
 
 .devcontainer export-ignore
 .github export-ignore
-.coveragerc export-ignore
 .readthedocs.yml export-ignore
 .hadolint.yaml export-ignore
 .pre-commit-config.yaml export-ignore
diff --git a/.rat-excludes b/.rat-excludes
index cab48fa0ee..954b689f99 100644
--- a/.rat-excludes
+++ b/.rat-excludes
@@ -10,7 +10,6 @@
 .airflowignore
 .babelrc
 .coverage
-.coveragerc
 .codecov.yml
 .codespellignorelines
 .eslintignore
diff --git a/Dockerfile.ci b/Dockerfile.ci
index be5b3de193..a4503f2d7c 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -947,6 +947,8 @@ if [[ ${SKIP_ENVIRONMENT_INITIALIZATION=} != "true" ]]; then
 fi
 
 rm -f "${AIRFLOW_SOURCES}/pytest.ini"
+rm -f "${AIRFLOW_SOURCES}/.coveragerc"
+
 
 set +u
 if [[ "${RUN_TESTS}" != "true" ]]; then
@@ -1020,7 +1022,7 @@ fi
 if [[ ${ENABLE_TEST_COVERAGE:="false"} == "true" ]]; then
     EXTRA_PYTEST_ARGS+=(
         "--cov=airflow"
-        "--cov-config=.coveragerc"
+        "--cov-config=pyproject.toml"
         "--cov-report=xml:/files/coverage-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
     )
 fi
diff --git a/README.md b/README.md
index 0e44e14e61..ae98f44bde 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@
 
 [![PyPI 
version](https://badge.fury.io/py/apache-airflow.svg)](https://badge.fury.io/py/apache-airflow)
 [![GitHub 
Build](https://github.com/apache/airflow/workflows/CI%20Build/badge.svg)](https://github.com/apache/airflow/actions)
-[![Coverage 
Status](https://codecov.io/github/apache/airflow/coverage.svg?branch=main)](https://app.codecov.io/gh/apache/airflow/branch/main)
+[![Coverage 
Status](https://codecov.io/gh/apache/airflow/graph/badge.svg?token=WdLKlKHOAU)](https://codecov.io/gh/apache/airflow)
 
[![License](https://img.shields.io/:license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)
 [![PyPI - Python 
Version](https://img.shields.io/pypi/pyversions/apache-airflow.svg)](https://pypi.org/project/apache-airflow/)
 [![Docker 
Pulls](https://img.shields.io/docker/pulls/apache/airflow.svg)](https://hub.docker.com/r/apache/airflow)
diff --git a/codecov.yml b/codecov.yml
index af129be875..3caf236b58 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -25,7 +25,7 @@ codecov:
 coverage:
   precision: 2
   round: down
-  range: "85...100"
+  range: 55..80
   status:
     project:
       default:
diff --git a/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py 
b/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
index d0a12e965a..37a2ba3f8a 100644
--- a/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
+++ b/dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
@@ -76,7 +76,6 @@ VOLUMES_FOR_SELECTED_MOUNTS = [
     (".bash_aliases", "/root/.bash_aliases"),
     (".bash_history", "/root/.bash_history"),
     (".build", "/opt/airflow/.build"),
-    (".coveragerc", "/opt/airflow/.coveragerc"),
     (".dockerignore", "/opt/airflow/.dockerignore"),
     (".github", "/opt/airflow/.github"),
     (".inputrc", "/root/.inputrc"),
diff --git a/pyproject.toml b/pyproject.toml
index edca58432b..ca6f9c61cf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -143,3 +143,29 @@ combine-as-imports = true
 "airflow/security/utils.py" = ["E402"]
 "tests/providers/elasticsearch/log/elasticmock/__init__.py" = ["E402"]
 "tests/providers/elasticsearch/log/elasticmock/utilities/__init__.py" = 
["E402"]
+
+[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 TYPE_CHECKING:"
+]
diff --git a/scripts/ci/docker-compose/local.yml 
b/scripts/ci/docker-compose/local.yml
index bc9fb047f8..1ae24d8c69 100644
--- a/scripts/ci/docker-compose/local.yml
+++ b/scripts/ci/docker-compose/local.yml
@@ -36,9 +36,6 @@ services:
       - type: bind
         source: ../../../.build
         target: /opt/airflow/.build
-      - type: bind
-        source: ../../../.coveragerc
-        target: /opt/airflow/.coveragerc
       - type: bind
         source: ../../../.dockerignore
         target: /opt/airflow/.dockerignore
diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh
index 73b8a20deb..f08e2eac21 100755
--- a/scripts/docker/entrypoint_ci.sh
+++ b/scripts/docker/entrypoint_ci.sh
@@ -323,9 +323,11 @@ if [[ ${SKIP_ENVIRONMENT_INITIALIZATION=} != "true" ]]; 
then
     fi
 fi
 
-# Remove pytest.ini from the current directory if it exists. It has been 
removed from the source tree
+# Remove pytest.ini and .coveragerc from the current directory if it exists. 
It has been removed from the source tree
 # but may still be present in the local directory if the user has old breeze 
image
 rm -f "${AIRFLOW_SOURCES}/pytest.ini"
+rm -f "${AIRFLOW_SOURCES}/.coveragerc"
+
 
 set +u
 # If we do not want to run tests, we simply drop into bash
@@ -400,7 +402,7 @@ fi
 if [[ ${ENABLE_TEST_COVERAGE:="false"} == "true" ]]; then
     EXTRA_PYTEST_ARGS+=(
         "--cov=airflow"
-        "--cov-config=.coveragerc"
+        "--cov-config=pyproject.toml"
         "--cov-report=xml:/files/coverage-${TEST_TYPE/\[*\]/}-${BACKEND}.xml"
     )
 fi
diff --git a/setup.py b/setup.py
index 9a2daded8e..9ded977624 100644
--- a/setup.py
+++ b/setup.py
@@ -413,7 +413,7 @@ devel_only = [
     "blinker",
     "bowler",
     "click>=8.0",
-    "coverage",
+    "coverage>=7.2",
     "filelock",
     "gitpython",
     "ipdb",

Reply via email to