@@ -70,6 +70,10 @@ exclude = ["contrib", "docs", "tests*", "tasks"]
70
70
" w64-arm.exe" ,
71
71
]
72
72
73
+ # #####################################################################################
74
+ # towncrier
75
+ #
76
+
73
77
[tool .towncrier ]
74
78
# For finding the __version__
75
79
package = " pip"
@@ -94,6 +98,10 @@ type = [
94
98
{ name = " Trivial Changes" , directory = " trivial" , showcontent = false },
95
99
]
96
100
101
+ # #####################################################################################
102
+ # vendoring
103
+ #
104
+
97
105
[tool .vendoring ]
98
106
destination = " src/pip/_vendor/"
99
107
requirements = " src/pip/_vendor/vendor.txt"
@@ -140,6 +148,10 @@ CacheControl = "https://raw.githubusercontent.com/ionrock/cachecontrol/v0.12.6/L
140
148
distlib = " https://bitbucket.org/pypa/distlib/raw/master/LICENSE.txt"
141
149
webencodings = " https://github.com/SimonSapin/python-webencodings/raw/master/LICENSE"
142
150
151
+ # #####################################################################################
152
+ # ruff
153
+ #
154
+
143
155
[tool .ruff ]
144
156
src = [" src" ]
145
157
target-version = " py38"
@@ -195,3 +207,99 @@ max-args = 15 # default is 5
195
207
max-branches = 28 # default is 12
196
208
max-returns = 13 # default is 6
197
209
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
+ ]
0 commit comments