module documentation

Server for mypy daemon mode. This implements a daemon process which keeps useful state in memory to enable fine-grained incremental reprocessing of changes.

Class Server No class docstring; 0/9 instance variable, 18/28 methods documented
Function daemonize Create the daemon process via "dmypy daemon" and pass options via command line
Function filter_out_missing_top_level_packages Quickly filter out obviously missing top-level packages.
Function find_all_sources_in_build Undocumented
Function fix_module_deps After an incremental update, update module dependencies to reflect the new state.
Function get_meminfo Undocumented
Function ignore_suppressed_imports Can we skip looking for newly unsuppressed imports to module?
Function process_start_options Undocumented
Constant CONNECTION_NAME Undocumented
Constant MEM_PROFILE Undocumented
Constant MiB Undocumented
Type Alias ChangesAndRemovals Undocumented
Type Alias ModulePathPair Undocumented
Type Alias ModulePathPairs Undocumented
def daemonize(options: Options, status_file: str, timeout: int|None = None, log_file: str|None = None) -> int: (source)

Create the daemon process via "dmypy daemon" and pass options via command line When creating the daemon grandchild, we create it in a new console, which is started hidden. We cannot use DETACHED_PROCESS since it will cause console windows to pop up when starting. See https://github.com/python/cpython/pull/4150#issuecomment-340215696 for more on why we can't have nice things. It also pickles the options to be unpickled by mypy.

def filter_out_missing_top_level_packages(packages: set[str], search_paths: SearchPaths, fscache: FileSystemCache) -> set[str]: (source)

Quickly filter out obviously missing top-level packages. Return packages with entries that can't be found removed. This is approximate: some packages that aren't actually valid may be included. However, all potentially valid packages must be returned.

def find_all_sources_in_build(graph: mypy.build.Graph, extra: Sequence[BuildSource] = ()) -> list[BuildSource]: (source)

Undocumented

def fix_module_deps(graph: mypy.build.Graph): (source)

After an incremental update, update module dependencies to reflect the new state. This can make some suppressed dependencies non-suppressed, and vice versa (if modules have been added to or removed from the build).

def get_meminfo() -> dict[str, Any]: (source)

Undocumented

def ignore_suppressed_imports(module: str) -> bool: (source)

Can we skip looking for newly unsuppressed imports to module?

def process_start_options(flags: list[str], allow_sources: bool) -> Options: (source)

Undocumented

CONNECTION_NAME: str = (source)

Undocumented

Value
'dmypy'
MEM_PROFILE: bool = (source)

Undocumented

Value
False

Undocumented

Value
2**20
ChangesAndRemovals: _TypeAlias = (source)

Undocumented

Value
Tuple[ModulePathPairs, ModulePathPairs]
ModulePathPair: _TypeAlias = (source)

Undocumented

Value
Tuple[str, str]
ModulePathPairs: _TypeAlias = (source)

Undocumented

Value
List[ModulePathPair]