Skip to content

Commit a92f57c

Browse files
committed
Move coverage config to pyproject.toml
1 parent 13f6150 commit a92f57c

File tree

3 files changed

+43
-35
lines changed

3 files changed

+43
-35
lines changed

news/12538.process.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move remaining pip development tools configurations to ``pyproject.toml``.

pyproject.toml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,3 +261,45 @@ markers = [
261261
"git: VCS: git",
262262
"search: tests for 'pip search'",
263263
]
264+
265+
######################################################################################
266+
# coverage
267+
#
268+
269+
[tool.coverage.run]
270+
branch = true
271+
# Do not gather coverage for vendored libraries.
272+
omit = "*/_vendor/*"
273+
# Centralized absolute file prefix for coverage files.
274+
data_file = "${COVERAGE_OUTPUT_DIR}/.coverage"
275+
# By default, each covered process will try to truncate and then write to
276+
# `data_file`, but with `parallel`, they will write to separate files suffixed
277+
# with hostname, pid, and a timestamp.
278+
parallel = true
279+
# If not set, then at the termination of each worker (when using pytest-xdist),
280+
# the following is traced: "Coverage.py warning: Module pip was previously
281+
# imported, but not measured (module-not-measured)"
282+
disable_warnings = "module-not-measured"
283+
284+
[tool.coverage.paths]
285+
# We intentionally use "source0" here because pytest-cov unconditionally sets
286+
# "source" after loading the config.
287+
source0 = [
288+
# The primary source code path which other paths will be combined into.
289+
"src/pip/",
290+
# Unit test source directory e.g.
291+
# `.tox/coverage-py3/lib/pythonX.Y/site-packages/pip/...`
292+
"*/site-packages/pip/",
293+
# Functional test virtual environment directories, which look like
294+
# `tmpdir/pip0/pip/src/pip/...`
295+
"*/pip/src/pip/",
296+
]
297+
298+
[tool.coverage.report]
299+
exclude_lines = [
300+
# We must re-state the default because the `exclude_lines` option overrides
301+
# it.
302+
"pragma: no cover",
303+
# This excludes typing-specific code, which will be validated by mypy anyway.
304+
"if TYPE_CHECKING",
305+
]

setup.cfg

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)