coverage 7.13.1__cp314-cp314t-musllinux_1_2_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. a1_coverage.pth +1 -0
  2. coverage/__init__.py +38 -0
  3. coverage/__main__.py +12 -0
  4. coverage/annotate.py +113 -0
  5. coverage/bytecode.py +197 -0
  6. coverage/cmdline.py +1220 -0
  7. coverage/collector.py +487 -0
  8. coverage/config.py +732 -0
  9. coverage/context.py +74 -0
  10. coverage/control.py +1514 -0
  11. coverage/core.py +139 -0
  12. coverage/data.py +251 -0
  13. coverage/debug.py +669 -0
  14. coverage/disposition.py +59 -0
  15. coverage/env.py +135 -0
  16. coverage/exceptions.py +85 -0
  17. coverage/execfile.py +329 -0
  18. coverage/files.py +553 -0
  19. coverage/html.py +860 -0
  20. coverage/htmlfiles/coverage_html.js +735 -0
  21. coverage/htmlfiles/favicon_32.png +0 -0
  22. coverage/htmlfiles/index.html +199 -0
  23. coverage/htmlfiles/keybd_closed.png +0 -0
  24. coverage/htmlfiles/pyfile.html +149 -0
  25. coverage/htmlfiles/style.css +389 -0
  26. coverage/htmlfiles/style.scss +844 -0
  27. coverage/inorout.py +590 -0
  28. coverage/jsonreport.py +200 -0
  29. coverage/lcovreport.py +218 -0
  30. coverage/misc.py +381 -0
  31. coverage/multiproc.py +120 -0
  32. coverage/numbits.py +146 -0
  33. coverage/parser.py +1215 -0
  34. coverage/patch.py +118 -0
  35. coverage/phystokens.py +197 -0
  36. coverage/plugin.py +617 -0
  37. coverage/plugin_support.py +299 -0
  38. coverage/pth_file.py +16 -0
  39. coverage/py.typed +1 -0
  40. coverage/python.py +272 -0
  41. coverage/pytracer.py +370 -0
  42. coverage/regions.py +127 -0
  43. coverage/report.py +298 -0
  44. coverage/report_core.py +117 -0
  45. coverage/results.py +502 -0
  46. coverage/sqldata.py +1212 -0
  47. coverage/sqlitedb.py +226 -0
  48. coverage/sysmon.py +509 -0
  49. coverage/templite.py +319 -0
  50. coverage/tomlconfig.py +212 -0
  51. coverage/tracer.cpython-314t-aarch64-linux-musl.so +0 -0
  52. coverage/tracer.pyi +43 -0
  53. coverage/types.py +214 -0
  54. coverage/version.py +35 -0
  55. coverage/xmlreport.py +263 -0
  56. coverage-7.13.1.dist-info/METADATA +200 -0
  57. coverage-7.13.1.dist-info/RECORD +61 -0
  58. coverage-7.13.1.dist-info/WHEEL +5 -0
  59. coverage-7.13.1.dist-info/entry_points.txt +4 -0
  60. coverage-7.13.1.dist-info/licenses/LICENSE.txt +177 -0
  61. coverage-7.13.1.dist-info/top_level.txt +1 -0
coverage/inorout.py ADDED
@@ -0,0 +1,590 @@
1
+ # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
2
+ # For details: https://github.com/coveragepy/coveragepy/blob/main/NOTICE.txt
3
+
4
+ """Determining whether files are being measured/reported or not."""
5
+
6
+ from __future__ import annotations
7
+
8
+ import importlib.util
9
+ import inspect
10
+ import itertools
11
+ import os
12
+ import os.path
13
+ import sys
14
+ import sysconfig
15
+ import traceback
16
+ from collections.abc import Iterable
17
+ from types import FrameType, ModuleType
18
+ from typing import TYPE_CHECKING, Any, cast
19
+
20
+ from coverage import env
21
+ from coverage.disposition import FileDisposition, disposition_init
22
+ from coverage.exceptions import ConfigError, CoverageException, PluginError
23
+ from coverage.files import (
24
+ GlobMatcher,
25
+ ModuleMatcher,
26
+ TreeMatcher,
27
+ canonical_filename,
28
+ find_python_files,
29
+ prep_patterns,
30
+ )
31
+ from coverage.misc import isolate_module, sys_modules_saved
32
+ from coverage.python import source_for_file, source_for_morf
33
+ from coverage.types import TDebugCtl, TFileDisposition, TMorf, TWarnFn
34
+
35
+ if TYPE_CHECKING:
36
+ from coverage.config import CoverageConfig
37
+ from coverage.plugin_support import Plugins
38
+
39
+
40
+ os = isolate_module(os)
41
+
42
+
43
+ def canonical_path(morf: TMorf, directory: bool = False) -> str:
44
+ """Return the canonical path of the module or file `morf`.
45
+
46
+ If the module is a package, then return its directory. If it is a
47
+ module, then return its file, unless `directory` is True, in which
48
+ case return its enclosing directory.
49
+
50
+ """
51
+ morf_path = canonical_filename(source_for_morf(morf))
52
+ if morf_path.endswith("__init__.py") or directory:
53
+ morf_path = os.path.split(morf_path)[0]
54
+ return morf_path
55
+
56
+
57
+ def name_for_module(filename: str, frame: FrameType | None) -> str | None:
58
+ """Get the name of the module for a filename and frame.
59
+
60
+ For configurability's sake, we allow __main__ modules to be matched by
61
+ their importable name.
62
+
63
+ If loaded via runpy (aka -m), we can usually recover the "original"
64
+ full dotted module name, otherwise, we resort to interpreting the
65
+ file name to get the module's name. In the case that the module name
66
+ can't be determined, None is returned.
67
+
68
+ """
69
+ module_globals = frame.f_globals if frame is not None else {}
70
+ dunder_name: str | None = module_globals.get("__name__", None)
71
+
72
+ if isinstance(dunder_name, str) and dunder_name != "__main__":
73
+ # This is the usual case: an imported module.
74
+ return dunder_name
75
+
76
+ spec = module_globals.get("__spec__", None)
77
+ if spec:
78
+ fullname = spec.name
79
+ if isinstance(fullname, str) and fullname != "__main__":
80
+ # Module loaded via: runpy -m
81
+ return fullname
82
+
83
+ # Script as first argument to Python command line.
84
+ inspectedname = inspect.getmodulename(filename)
85
+ if inspectedname is not None:
86
+ return inspectedname
87
+ else:
88
+ return dunder_name
89
+
90
+
91
+ def module_is_namespace(mod: ModuleType) -> bool:
92
+ """Is the module object `mod` a PEP420 namespace module?"""
93
+ return hasattr(mod, "__path__") and getattr(mod, "__file__", None) is None
94
+
95
+
96
+ def module_has_file(mod: ModuleType) -> bool:
97
+ """Does the module object `mod` have an existing __file__ ?"""
98
+ mod__file__ = getattr(mod, "__file__", None)
99
+ if mod__file__ is None:
100
+ return False
101
+ return os.path.exists(mod__file__)
102
+
103
+
104
+ def file_and_path_for_module(modulename: str) -> tuple[str | None, list[str]]:
105
+ """Find the file and search path for `modulename`.
106
+
107
+ Returns:
108
+ filename: The filename of the module, or None.
109
+ path: A list (possibly empty) of directories to find submodules in.
110
+
111
+ """
112
+ filename = None
113
+ path = []
114
+ try:
115
+ spec = importlib.util.find_spec(modulename)
116
+ except Exception:
117
+ pass
118
+ else:
119
+ if spec is not None:
120
+ filename = spec.origin
121
+ path = list(spec.submodule_search_locations or ())
122
+ return filename, path
123
+
124
+
125
+ def add_sysconfig_paths(paths: set[str], path_names: list[str]) -> None:
126
+ """Get paths from `sysconfig.get_paths`"""
127
+ scheme_names = set(sysconfig.get_scheme_names())
128
+
129
+ for scheme in scheme_names:
130
+ config_paths = sysconfig.get_paths(scheme)
131
+ for path_name in path_names:
132
+ paths.add(config_paths[path_name])
133
+
134
+
135
+ def add_stdlib_paths(paths: set[str]) -> None:
136
+ """Add paths where the stdlib can be found to the set `paths`."""
137
+ add_sysconfig_paths(paths, ["stdlib", "platstdlib"])
138
+
139
+
140
+ def add_third_party_paths(paths: set[str]) -> None:
141
+ """Add locations for third-party packages to the set `paths`."""
142
+ add_sysconfig_paths(paths, ["platlib", "purelib", "scripts"])
143
+
144
+
145
+ def add_coverage_paths(paths: set[str]) -> None:
146
+ """Add paths where coverage.py code can be found to the set `paths`."""
147
+ cover_path = canonical_path(__file__, directory=True)
148
+ paths.add(cover_path)
149
+ if env.TESTING:
150
+ # Don't include our own test code.
151
+ paths.add(os.path.join(cover_path, "tests"))
152
+
153
+
154
+ class InOrOut:
155
+ """Machinery for determining what files to measure."""
156
+
157
+ def __init__(
158
+ self,
159
+ config: CoverageConfig,
160
+ warn: TWarnFn,
161
+ debug: TDebugCtl | None,
162
+ include_namespace_packages: bool,
163
+ ) -> None:
164
+ self.warn = warn
165
+ self.debug = debug
166
+ self.include_namespace_packages = include_namespace_packages
167
+
168
+ self.source_pkgs: list[str] = []
169
+ self.source_pkgs.extend(config.source_pkgs)
170
+ self.source_dirs: list[str] = []
171
+ self.source_dirs.extend(config.source_dirs)
172
+ for src in config.source or []:
173
+ if os.path.isdir(src):
174
+ self.source_dirs.append(src)
175
+ else:
176
+ self.source_pkgs.append(src)
177
+
178
+ # Canonicalize everything in `source_dirs`.
179
+ # Also confirm that they actually are directories.
180
+ for i, src in enumerate(self.source_dirs):
181
+ if not os.path.isdir(src):
182
+ raise ConfigError(f"Source dir is not a directory: {src!r}")
183
+ self.source_dirs[i] = canonical_filename(src)
184
+
185
+ self.source_pkgs_unmatched = self.source_pkgs[:]
186
+
187
+ self.include = prep_patterns(config.run_include)
188
+ self.omit = prep_patterns(config.run_omit)
189
+
190
+ # The directories for files considered "installed with the interpreter".
191
+ self.pylib_paths: set[str] = set()
192
+ if not config.cover_pylib:
193
+ add_stdlib_paths(self.pylib_paths)
194
+
195
+ # To avoid tracing the coverage.py code itself, we skip anything
196
+ # located where we are.
197
+ self.cover_paths: set[str] = set()
198
+ add_coverage_paths(self.cover_paths)
199
+
200
+ # Find where third-party packages are installed.
201
+ self.third_paths: set[str] = set()
202
+ add_third_party_paths(self.third_paths)
203
+
204
+ def _debug(msg: str) -> None:
205
+ if self.debug:
206
+ self.debug.write(msg)
207
+
208
+ # Generally useful information
209
+ _debug("sys.path:" + "".join(f"\n {p}" for p in sys.path))
210
+
211
+ if self.debug:
212
+ _debug("sysconfig paths:")
213
+ for scheme in sorted(sysconfig.get_scheme_names()):
214
+ _debug(f" {scheme}:")
215
+ for k, v in sysconfig.get_paths(scheme).items():
216
+ _debug(f" {k}: {v}")
217
+
218
+ # Create the matchers we need for should_trace
219
+ self.source_match = None
220
+ self.source_pkgs_match = None
221
+ self.pylib_match = None
222
+ self.include_match = self.omit_match = None
223
+
224
+ if self.source_dirs or self.source_pkgs:
225
+ against = []
226
+ if self.source_dirs:
227
+ self.source_match = TreeMatcher(self.source_dirs, "source")
228
+ against.append(f"trees {self.source_match!r}")
229
+ if self.source_pkgs:
230
+ self.source_pkgs_match = ModuleMatcher(self.source_pkgs, "source_pkgs")
231
+ against.append(f"modules {self.source_pkgs_match!r}")
232
+ _debug("Source matching against " + " and ".join(against))
233
+ else:
234
+ if self.pylib_paths:
235
+ self.pylib_match = TreeMatcher(self.pylib_paths, "pylib")
236
+ _debug(f"Python stdlib matching: {self.pylib_match!r}")
237
+ if self.include:
238
+ self.include_match = GlobMatcher(self.include, "include")
239
+ _debug(f"Include matching: {self.include_match!r}")
240
+ if self.omit:
241
+ self.omit_match = GlobMatcher(self.omit, "omit")
242
+ _debug(f"Omit matching: {self.omit_match!r}")
243
+
244
+ self.cover_match = TreeMatcher(self.cover_paths, "coverage")
245
+ _debug(f"Coverage code matching: {self.cover_match!r}")
246
+
247
+ self.third_match = TreeMatcher(self.third_paths, "third")
248
+ _debug(f"Third-party lib matching: {self.third_match!r}")
249
+
250
+ # Check if the source we want to measure has been installed as a
251
+ # third-party package.
252
+ # Is the source inside a third-party area?
253
+ self.source_in_third_paths = set()
254
+ with sys_modules_saved():
255
+ for pkg in self.source_pkgs:
256
+ try:
257
+ modfile, path = file_and_path_for_module(pkg)
258
+ _debug(f"Imported source package {pkg!r} as {modfile!r}")
259
+ except CoverageException as exc:
260
+ _debug(f"Couldn't import source package {pkg!r}: {exc}")
261
+ continue
262
+ if modfile:
263
+ if self.third_match.match(modfile):
264
+ _debug(
265
+ f"Source in third-party: source_pkg {pkg!r} at {modfile!r}",
266
+ )
267
+ self.source_in_third_paths.add(canonical_path(source_for_file(modfile)))
268
+ else:
269
+ for pathdir in path:
270
+ if self.third_match.match(pathdir):
271
+ _debug(
272
+ f"Source in third-party: {pkg!r} path directory at {pathdir!r}",
273
+ )
274
+ self.source_in_third_paths.add(pathdir)
275
+
276
+ for src in self.source_dirs:
277
+ if self.third_match.match(src):
278
+ _debug(f"Source in third-party: source directory {src!r}")
279
+ self.source_in_third_paths.add(src)
280
+ self.source_in_third_match = TreeMatcher(self.source_in_third_paths, "source_in_third")
281
+ _debug(f"Source in third-party matching: {self.source_in_third_match}")
282
+
283
+ self.plugins: Plugins
284
+ self.disp_class: type[TFileDisposition] = FileDisposition
285
+
286
+ def should_trace(self, filename: str, frame: FrameType | None = None) -> TFileDisposition:
287
+ """Decide whether to trace execution in `filename`, with a reason.
288
+
289
+ This function is called from the trace function. As each new file name
290
+ is encountered, this function determines whether it is traced or not.
291
+
292
+ Returns a FileDisposition object.
293
+
294
+ """
295
+ original_filename = filename
296
+ disp = disposition_init(self.disp_class, filename)
297
+
298
+ def nope(disp: TFileDisposition, reason: str) -> TFileDisposition:
299
+ """Simple helper to make it easy to return NO."""
300
+ disp.trace = False
301
+ disp.reason = reason
302
+ return disp
303
+
304
+ if original_filename.startswith("<"):
305
+ return nope(disp, "original file name is not real")
306
+
307
+ if frame is not None:
308
+ # Compiled Python files have two file names: frame.f_code.co_filename is
309
+ # the file name at the time the .pyc was compiled. The second name is
310
+ # __file__, which is where the .pyc was actually loaded from. Since
311
+ # .pyc files can be moved after compilation (for example, by being
312
+ # installed), we look for __file__ in the frame and prefer it to the
313
+ # co_filename value.
314
+ dunder_file = frame.f_globals and frame.f_globals.get("__file__")
315
+ if dunder_file:
316
+ # Danger: __file__ can (rarely?) be of type Path.
317
+ filename = source_for_file(str(dunder_file))
318
+ if original_filename and not original_filename.startswith("<"):
319
+ orig = os.path.basename(original_filename)
320
+ if orig != os.path.basename(filename):
321
+ # Files shouldn't be renamed when moved. This happens when
322
+ # exec'ing code. If it seems like something is wrong with
323
+ # the frame's file name, then just use the original.
324
+ filename = original_filename
325
+
326
+ if not filename:
327
+ # Empty string is pretty useless.
328
+ return nope(disp, "empty string isn't a file name")
329
+
330
+ if filename.startswith("memory:"):
331
+ return nope(disp, "memory isn't traceable")
332
+
333
+ if filename.startswith("<"):
334
+ # Lots of non-file execution is represented with artificial
335
+ # file names like "<string>", "<doctest readme.txt[0]>", or
336
+ # "<exec_function>". Don't ever trace these executions, since we
337
+ # can't do anything with the data later anyway.
338
+ return nope(disp, "file name is not real")
339
+
340
+ canonical = canonical_filename(filename)
341
+ disp.canonical_filename = canonical
342
+
343
+ # Try the plugins, see if they have an opinion about the file.
344
+ plugin = None
345
+ for plugin in self.plugins.file_tracers:
346
+ if not plugin._coverage_enabled:
347
+ continue
348
+
349
+ try:
350
+ file_tracer = plugin.file_tracer(canonical)
351
+ if file_tracer is not None:
352
+ file_tracer._coverage_plugin = plugin
353
+ disp.trace = True
354
+ disp.file_tracer = file_tracer
355
+ if file_tracer.has_dynamic_source_filename():
356
+ disp.has_dynamic_filename = True
357
+ else:
358
+ disp.source_filename = canonical_filename(
359
+ file_tracer.source_filename(),
360
+ )
361
+ break
362
+ except Exception:
363
+ plugin_name = plugin._coverage_plugin_name
364
+ tb = traceback.format_exc()
365
+ self.warn(f"Disabling plug-in {plugin_name!r} due to an exception:\n{tb}")
366
+ plugin._coverage_enabled = False
367
+ continue
368
+ else:
369
+ # No plugin wanted it: it's Python.
370
+ disp.trace = True
371
+ disp.source_filename = canonical
372
+
373
+ if not disp.has_dynamic_filename:
374
+ if not disp.source_filename:
375
+ raise PluginError(
376
+ f"Plugin {plugin!r} didn't set source_filename for '{disp.original_filename}'",
377
+ )
378
+ reason = self.check_include_omit_etc(disp.source_filename, frame)
379
+ if reason:
380
+ nope(disp, reason)
381
+
382
+ return disp
383
+
384
+ def check_include_omit_etc(self, filename: str, frame: FrameType | None) -> str | None:
385
+ """Check a file name against the include, omit, etc, rules.
386
+
387
+ Returns a string or None. String means, don't trace, and is the reason
388
+ why. None means no reason found to not trace.
389
+
390
+ """
391
+ modulename = name_for_module(filename, frame)
392
+
393
+ # If the user specified source or include, then that's authoritative
394
+ # about the outer bound of what to measure and we don't have to apply
395
+ # any canned exclusions. If they didn't, then we have to exclude the
396
+ # stdlib and coverage.py directories.
397
+ if self.source_match or self.source_pkgs_match:
398
+ extra = ""
399
+ ok = False
400
+ if self.source_pkgs_match:
401
+ if isinstance(modulename, str) and self.source_pkgs_match.match(modulename):
402
+ ok = True
403
+ if modulename in self.source_pkgs_unmatched:
404
+ self.source_pkgs_unmatched.remove(modulename)
405
+ else:
406
+ extra = f"module {modulename!r} "
407
+ if not ok and self.source_match:
408
+ if self.source_match.match(filename):
409
+ ok = True
410
+ if not ok:
411
+ return extra + "falls outside the --source spec"
412
+ if self.third_match.match(filename) and not self.source_in_third_match.match(filename):
413
+ return "inside --source, but is third-party"
414
+ elif self.include_match:
415
+ if not self.include_match.match(filename):
416
+ return "falls outside the --include trees"
417
+ else:
418
+ # We exclude the coverage.py code itself, since a little of it
419
+ # will be measured otherwise.
420
+ if self.cover_match.match(filename):
421
+ return "is part of coverage.py"
422
+
423
+ # If we aren't supposed to trace installed code, then check if this
424
+ # is near the Python standard library and skip it if so.
425
+ if self.pylib_match and self.pylib_match.match(filename):
426
+ return "is in the stdlib"
427
+
428
+ # Exclude anything in the third-party installation areas.
429
+ if self.third_match.match(filename):
430
+ return "is a third-party module"
431
+
432
+ # Check the file against the omit pattern.
433
+ if self.omit_match and self.omit_match.match(filename):
434
+ return "is inside an --omit pattern"
435
+
436
+ # No point tracing a file we can't later write to SQLite.
437
+ try:
438
+ filename.encode("utf-8")
439
+ except UnicodeEncodeError:
440
+ return "non-encodable filename"
441
+
442
+ # No reason found to skip this file.
443
+ return None
444
+
445
+ def warn_conflicting_settings(self) -> None:
446
+ """Warn if there are settings that conflict."""
447
+ if self.include:
448
+ if self.source_dirs or self.source_pkgs:
449
+ self.warn("--include is ignored because --source is set", slug="include-ignored")
450
+
451
+ def warn_already_imported_files(self) -> None:
452
+ """Warn if files have already been imported that we will be measuring."""
453
+ if self.include or self.source_dirs or self.source_pkgs:
454
+ warned = set()
455
+ for mod in list(sys.modules.values()):
456
+ filename = getattr(mod, "__file__", None)
457
+ if filename is None:
458
+ continue
459
+ if filename in warned:
460
+ continue
461
+
462
+ if len(getattr(mod, "__path__", ())) > 1:
463
+ # A namespace package, which confuses this code, so ignore it.
464
+ continue
465
+
466
+ disp = self.should_trace(filename)
467
+ if disp.has_dynamic_filename:
468
+ # A plugin with dynamic filenames: the Python file
469
+ # shouldn't cause a warning, since it won't be the subject
470
+ # of tracing anyway.
471
+ continue
472
+ if disp.trace:
473
+ msg = f"Already imported a file that will be measured: {filename}"
474
+ self.warn(msg, slug="already-imported")
475
+ warned.add(filename)
476
+ elif self.debug and self.debug.should("trace"):
477
+ self.debug.write(
478
+ "Didn't trace already imported file {!r}: {}".format(
479
+ disp.original_filename,
480
+ disp.reason,
481
+ ),
482
+ )
483
+
484
+ def warn_unimported_source(self) -> None:
485
+ """Warn about source packages that were of interest, but never traced."""
486
+ for pkg in self.source_pkgs_unmatched:
487
+ self._warn_about_unmeasured_code(pkg)
488
+
489
+ def _warn_about_unmeasured_code(self, pkg: str) -> None:
490
+ """Warn about a package or module that we never traced.
491
+
492
+ `pkg` is a string, the name of the package or module.
493
+
494
+ """
495
+ mod = sys.modules.get(pkg)
496
+ if mod is None:
497
+ self.warn(f"Module {pkg} was never imported.", slug="module-not-imported")
498
+ return
499
+
500
+ if module_is_namespace(mod):
501
+ # A namespace package. It's OK for this not to have been traced,
502
+ # since there is no code directly in it.
503
+ return
504
+
505
+ if not module_has_file(mod):
506
+ self.warn(f"Module {pkg} has no Python source.", slug="module-not-python")
507
+ return
508
+
509
+ # The module was in sys.modules, and seems like a module with code, but
510
+ # we never measured it. I guess that means it was imported before
511
+ # coverage even started.
512
+ msg = f"Module {pkg} was previously imported, but not measured"
513
+ self.warn(msg, slug="module-not-measured")
514
+
515
+ def find_possibly_unexecuted_files(self) -> Iterable[tuple[str, str | None]]:
516
+ """Find files in the areas of interest that might be untraced.
517
+
518
+ Yields pairs: file path, and responsible plug-in name.
519
+ """
520
+ for pkg in self.source_pkgs:
521
+ if pkg not in sys.modules or not module_has_file(sys.modules[pkg]):
522
+ continue
523
+ pkg_file = source_for_file(cast(str, sys.modules[pkg].__file__))
524
+ yield from self._find_executable_files(canonical_path(pkg_file))
525
+
526
+ for src in self.source_dirs:
527
+ yield from self._find_executable_files(src)
528
+
529
+ def _find_plugin_files(self, src_dir: str) -> Iterable[tuple[str, str]]:
530
+ """Get executable files from the plugins."""
531
+ for plugin in self.plugins.file_tracers:
532
+ for x_file in plugin.find_executable_files(src_dir):
533
+ yield x_file, plugin._coverage_plugin_name
534
+
535
+ def _find_executable_files(self, src_dir: str) -> Iterable[tuple[str, str | None]]:
536
+ """Find executable files in `src_dir`.
537
+
538
+ Search for files in `src_dir` that can be executed because they
539
+ are probably importable. Don't include ones that have been omitted
540
+ by the configuration.
541
+
542
+ Yield the file path, and the plugin name that handles the file.
543
+
544
+ """
545
+ py_files = (
546
+ (py_file, None)
547
+ for py_file in find_python_files(src_dir, self.include_namespace_packages)
548
+ )
549
+ plugin_files = self._find_plugin_files(src_dir)
550
+
551
+ for file_path, plugin_name in itertools.chain(py_files, plugin_files):
552
+ file_path = canonical_filename(file_path)
553
+ if self.omit_match and self.omit_match.match(file_path):
554
+ # Turns out this file was omitted, so don't pull it back
555
+ # in as un-executed.
556
+ continue
557
+ yield file_path, plugin_name
558
+
559
+ def sys_info(self) -> Iterable[tuple[str, Any]]:
560
+ """Our information for Coverage.sys_info.
561
+
562
+ Returns a list of (key, value) pairs.
563
+ """
564
+ info = [
565
+ ("coverage_paths", self.cover_paths),
566
+ ("stdlib_paths", self.pylib_paths),
567
+ ("third_party_paths", self.third_paths),
568
+ ("source_in_third_party_paths", self.source_in_third_paths),
569
+ ]
570
+
571
+ matcher_names = [
572
+ "source_match",
573
+ "source_pkgs_match",
574
+ "include_match",
575
+ "omit_match",
576
+ "cover_match",
577
+ "pylib_match",
578
+ "third_match",
579
+ "source_in_third_match",
580
+ ]
581
+
582
+ for matcher_name in matcher_names:
583
+ matcher = getattr(self, matcher_name)
584
+ if matcher:
585
+ matcher_info = matcher.info()
586
+ else:
587
+ matcher_info = "-none-"
588
+ info.append((matcher_name, matcher_info))
589
+
590
+ return info