Skip to content

Commit f4a5439

Browse files
authored
Merge pull request #12538 from sbidoul/rm-setup.cfg
Move remaining tools configurations from setup.cfg to pyproject.toml
2 parents 6e191e8 + a92f57c commit f4a5439

File tree

3 files changed

+109
-76
lines changed

3 files changed

+109
-76
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: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ exclude = ["contrib", "docs", "tests*", "tasks"]
7070
"w64-arm.exe",
7171
]
7272

73+
######################################################################################
74+
# towncrier
75+
#
76+
7377
[tool.towncrier]
7478
# For finding the __version__
7579
package = "pip"
@@ -94,6 +98,10 @@ type = [
9498
{ name = "Trivial Changes", directory = "trivial", showcontent = false },
9599
]
96100

101+
######################################################################################
102+
# vendoring
103+
#
104+
97105
[tool.vendoring]
98106
destination = "src/pip/_vendor/"
99107
requirements = "src/pip/_vendor/vendor.txt"
@@ -140,6 +148,10 @@ CacheControl = "https://raw.githubusercontent.com/ionrock/cachecontrol/v0.12.6/L
140148
distlib = "https://bitbucket.org/pypa/distlib/raw/master/LICENSE.txt"
141149
webencodings = "https://github.com/SimonSapin/python-webencodings/raw/master/LICENSE"
142150

151+
######################################################################################
152+
# ruff
153+
#
154+
143155
[tool.ruff]
144156
src = ["src"]
145157
target-version = "py38"
@@ -195,3 +207,99 @@ max-args = 15 # default is 5
195207
max-branches = 28 # default is 12
196208
max-returns = 13 # default is 6
197209
max-statements = 134 # default is 50
210+
211+
######################################################################################
212+
# mypy
213+
#
214+
215+
[tool.mypy]
216+
mypy_path = "$MYPY_CONFIG_FILE_DIR/src"
217+
strict = true
218+
no_implicit_reexport = false
219+
disallow_subclassing_any = false
220+
disallow_untyped_calls = false
221+
warn_return_any = false
222+
ignore_missing_imports = true
223+
224+
[[tool.mypy.overrides]]
225+
module = "pip._internal.utils._jaraco_text"
226+
ignore_errors = true
227+
228+
[[tool.mypy.overrides]]
229+
module = "pip._vendor.*"
230+
ignore_errors = true
231+
232+
# These vendored libraries use runtime magic to populate things and don't sit
233+
# well with static typing out of the box. Eventually we should provide correct
234+
# typing information for their public interface and remove these configs.
235+
236+
[[tool.mypy.overrides]]
237+
module = "pip._vendor.pkg_resources"
238+
follow_imports = "skip"
239+
240+
[[tool.mypy.overrides]]
241+
module = "pip._vendor.requests.*"
242+
follow_imports = "skip"
243+
244+
######################################################################################
245+
# pytest
246+
#
247+
248+
[tool.pytest.ini_options]
249+
addopts = "--ignore src/pip/_vendor --ignore tests/tests_cache -r aR --color=yes"
250+
xfail_strict = true
251+
markers = [
252+
"network: tests that need network",
253+
"incompatible_with_sysconfig",
254+
"incompatible_with_venv",
255+
"no_auto_tempdir_manager",
256+
"unit: unit tests",
257+
"integration: integration tests",
258+
"bzr: VCS: Bazaar",
259+
"svn: VCS: Subversion",
260+
"mercurial: VCS: Mercurial",
261+
"git: VCS: git",
262+
"search: tests for 'pip search'",
263+
]
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 & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)