MCPcopy
hub / github.com/python/mypy / Options

Class Options

mypy/options.py:101–674  ·  view source on GitHub ↗

Options collected from flags.

Source from the content-addressed store, hash-verified

99
100
101class Options:
102 """Options collected from flags."""
103
104 def __init__(self) -> None:
105 # Cache for clone_for_module()
106 self._per_module_cache: dict[str, Options] | None = None
107
108 # -- build options --
109 self.build_type = BuildType.STANDARD
110 self.python_version: tuple[int, int] = sys.version_info[:2]
111 # The executable used to search for PEP 561 packages. If this is None,
112 # then mypy does not search for PEP 561 packages.
113 self.python_executable: str | None = sys.executable
114
115 # When cross compiling to emscripten, we need to rely on MACHDEP because
116 # sys.platform is the host build platform, not emscripten.
117 MACHDEP = sysconfig.get_config_var("MACHDEP")
118 if MACHDEP == "emscripten":
119 self.platform = MACHDEP
120 else:
121 self.platform = sys.platform
122
123 self.custom_typing_module: str | None = None
124 self.custom_typeshed_dir: str | None = None
125 # The abspath() version of the above, we compute it once as an optimization.
126 self.abs_custom_typeshed_dir: str | None = None
127 self.mypy_path: list[str] = []
128 self.report_dirs: dict[str, str] = {}
129 # Show errors in PEP 561 packages/site-packages modules
130 self.no_silence_site_packages = False
131 self.no_site_packages = False
132 self.ignore_missing_imports = False
133 # Is ignore_missing_imports set in a per-module section
134 self.ignore_missing_imports_per_module = False
135 # Typecheck modules without stubs or py.typed marker
136 self.follow_untyped_imports = False
137 self.follow_imports = "normal" # normal|silent|skip|error
138 # Whether to respect the follow_imports setting even for stub files.
139 # Intended to be used for disabling specific stubs.
140 self.follow_imports_for_stubs = False
141 # PEP 420 namespace packages
142 # This allows definitions of packages without __init__.py and allows packages to span
143 # multiple directories. This flag affects both import discovery and the association of
144 # input files/modules/packages to the relevant file and fully qualified module name.
145 self.namespace_packages = True
146 # Use current directory and MYPYPATH to determine fully qualified module names of files
147 # passed by automatically considering their subdirectories as packages. This is only
148 # relevant if namespace packages are enabled, since otherwise examining __init__.py's is
149 # sufficient to determine module names for files. As a possible alternative, add a single
150 # top-level __init__.py to your packages.
151 self.explicit_package_bases = False
152 # File names, directory names or subpaths to avoid checking
153 self.exclude: list[str] = []
154 self.exclude_gitignore: bool = False
155
156 # disallow_any options
157 self.disallow_any_generics = False
158 self.disallow_any_unimported = False

Callers 15

parseFunction · 0.90
test_stubsFunction · 0.90
__repr__Method · 0.90
__str__Method · 0.90
__str__Method · 0.90
process_optionsFunction · 0.90
_make_managerMethod · 0.90
setupMethod · 0.90
test_crawl_namespaceMethod · 0.90

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…