class documentation

class Server: (source)

View In Hierarchy

Undocumented

Method __init__ Initialize the server with the desired mypy flags.
Method check Check using fine-grained incremental mode.
Method cmd_check Check a list of files.
Method cmd_hang Hang for 100 seconds, as a debug hack.
Method cmd_inspect Locate and inspect expression(s).
Method cmd_recheck Check the same list of files we checked most recently.
Method cmd_run Check a list of files, triggering a restart if needed.
Method cmd_status Return daemon status.
Method cmd_stop Stop daemon.
Method cmd_suggest Suggest a signature for a function.
Method direct_imports Return the direct imports of module not included in seen.
Method find_added_suppressed Find suppressed modules that have been added (and not included in seen).
Method find_changed Undocumented
Method find_reachable_changed_modules Follow imports within graph from given sources until hitting changed modules.
Method fine_grained_increment Perform a fine-grained type checking increment.
Method fine_grained_increment_follow_imports Like fine_grained_increment, but follow imports.
Method flush_caches Undocumented
Method following_imports Are we following imports?
Method increment_output Undocumented
Method initialize_fine_grained Undocumented
Method pretty_messages Undocumented
Method run_command Run a specific command from the registry.
Method serve Serve requests, synchronously (no thread or fork).
Method update_changed Undocumented
Method update_sources Undocumented
Method update_stats Undocumented
Instance Variable fine_grained_manager Undocumented
Instance Variable formatter Undocumented
Instance Variable fscache Undocumented
Instance Variable fswatcher Undocumented
Instance Variable options Undocumented
Instance Variable options_snapshot Undocumented
Instance Variable previous_sources Undocumented
Instance Variable status_file Undocumented
Instance Variable timeout Undocumented
Method _find_changed Undocumented
Method _response_metadata Undocumented
def __init__(self, options: Options, status_file: str, timeout: int|None = None): (source)

Initialize the server with the desired mypy flags.

def check(self, sources: list[BuildSource], export_types: bool, is_tty: bool, terminal_width: int) -> dict[str, Any]: (source)

Check using fine-grained incremental mode. If is_tty is True format the output nicely with colors and summary line (unless disabled in self.options). Also pass the terminal_width to formatter.

def cmd_check(self, files: Sequence[str], export_types: bool, is_tty: bool, terminal_width: int) -> dict[str, object]: (source)

Check a list of files.

def cmd_hang(self) -> dict[str, object]: (source)

Hang for 100 seconds, as a debug hack.

def cmd_inspect(self, show: str, location: str, verbosity: int = 0, limit: int = 0, include_span: bool = False, include_kind: bool = False, include_object_attrs: bool = False, union_attrs: bool = False, force_reload: bool = False) -> dict[str, object]: (source)

Locate and inspect expression(s).

def cmd_recheck(self, is_tty: bool, terminal_width: int, export_types: bool, remove: list[str]|None = None, update: list[str]|None = None) -> dict[str, object]: (source)

Check the same list of files we checked most recently. If remove/update is given, they modify the previous list; if all are None, stat() is called for each file in the previous list.

def cmd_run(self, version: str, args: Sequence[str], export_types: bool, is_tty: bool, terminal_width: int) -> dict[str, object]: (source)

Check a list of files, triggering a restart if needed.

def cmd_status(self, fswatcher_dump_file: str|None = None) -> dict[str, object]: (source)

Return daemon status.

def cmd_stop(self) -> dict[str, object]: (source)

Stop daemon.

def cmd_suggest(self, function: str, callsites: bool, **kwargs: Any) -> dict[str, object]: (source)

Suggest a signature for a function.

def direct_imports(self, module: tuple[str, str], graph: mypy.build.Graph) -> list[BuildSource]: (source)

Return the direct imports of module not included in seen.

def find_added_suppressed(self, graph: mypy.build.Graph, seen: set[str], search_paths: SearchPaths) -> list[tuple[str, str]]: (source)

Find suppressed modules that have been added (and not included in seen). Args: seen: reachable modules we've seen before (mutated here!!) Return suppressed, added modules.

def find_changed(self, sources: list[BuildSource]) -> ChangesAndRemovals: (source)

Undocumented

def find_reachable_changed_modules(self, roots: list[BuildSource], graph: mypy.build.Graph, seen: set[str], changed_paths: AbstractSet[str]) -> tuple[list[tuple[str, str]], list[BuildSource]]: (source)

Follow imports within graph from given sources until hitting changed modules. If we find a changed module, we can't continue following imports as the imports may have changed. Args: roots: modules where to start search from graph: module graph to use for the search seen: modules we've seen before that won't be visited (mutated here!!) changed_paths: which paths have changed (stop search here and return any found) Return (encountered reachable changed modules, unchanged files not in sources_set traversed).

def fine_grained_increment(self, sources: list[BuildSource], remove: list[str]|None = None, update: list[str]|None = None) -> list[str]: (source)

Perform a fine-grained type checking increment. If remove and update are None, determine changed paths by using fswatcher. Otherwise, assume that only these files have changes. Args: sources: sources passed on the command line remove: paths of files that have been removed update: paths of files that have been changed or created

def fine_grained_increment_follow_imports(self, sources: list[BuildSource]) -> list[str]: (source)

Like fine_grained_increment, but follow imports.

def flush_caches(self): (source)

Undocumented

def following_imports(self) -> bool: (source)

Are we following imports?

def increment_output(self, messages: list[str], sources: list[BuildSource], is_tty: bool, terminal_width: int) -> dict[str, Any]: (source)

Undocumented

def initialize_fine_grained(self, sources: list[BuildSource], is_tty: bool, terminal_width: int) -> dict[str, Any]: (source)

Undocumented

def pretty_messages(self, messages: list[str], n_sources: int, is_tty: bool = False, terminal_width: int|None = None) -> list[str]: (source)

Undocumented

def run_command(self, command: str, data: dict[str, object]) -> dict[str, object]: (source)

Run a specific command from the registry.

def serve(self): (source)

Serve requests, synchronously (no thread or fork).

def update_changed(self, sources: list[BuildSource], remove: list[str], update: list[str]) -> ChangesAndRemovals: (source)

Undocumented

def update_sources(self, sources: list[BuildSource]): (source)

Undocumented

def update_stats(self, res: dict[str, Any]): (source)

Undocumented

fine_grained_manager = (source)

Undocumented

formatter = (source)

Undocumented

Undocumented

fswatcher = (source)

Undocumented

Undocumented

options_snapshot = (source)

Undocumented

previous_sources = (source)

Undocumented

status_file = (source)

Undocumented

Undocumented

def _find_changed(self, sources: list[BuildSource], changed_paths: AbstractSet[str]) -> ChangesAndRemovals: (source)

Undocumented

def _response_metadata(self) -> dict[str, str]: (source)

Undocumented