Skip to content

[python-types] server_manager.py: 6 methods missing -> None return type #730

@realfishsam

Description

@realfishsam

File

sdks/python/pmxt/server_manager.py

Missing Return Types

All six methods below have None-returning bodies but no -> None annotation. With disallow_untyped_defs = true enabled (#246), mypy will flag all of them.

Line 56 — ServerManager.__init__ (HIGH — public constructor)

def __init__(self, base_url: str = "http://localhost:3847"):

→ should be -> None

Line 259 — _kill_orphan_sidecars (HIGH — called by ensure_server_running)

def _kill_orphan_sidecars(self) -> None:

Already docstring-documented as returning None; annotation is missing.

Line 300 — _kill_old_server (HIGH — called by stop, restart, ensure_server_running)

def _kill_old_server(self) -> None:

Line 397 — _remove_stale_lock (MEDIUM — private utility)

def _remove_stale_lock(self) -> None:

Line 404 — _start_server_via_launcher (HIGH — core of ensure_server_running)

def _start_server_via_launcher(self) -> None:

Line 460 — _wait_for_health (HIGH — core of ensure_server_running)

def _wait_for_health(self) -> None:

Impact

  • ServerManager.__init__ is the public constructor used directly by users via pmxt.server and by Exchange.__init__ internally. Missing -> None blocks IDE hover documentation.
  • The five private helpers are all called from ensure_server_running, which is the hot path on every SDK startup. Mypy enables call-site type narrowing only when return types are declared.
  • Enabling disallow_untyped_defs = true ([python-types] pyproject.toml: disallow_untyped_defs = false allows all type gaps to silently pass #246) will fail CI on all six simultaneously.

Suggested Fix

Add -> None to each method:

def __init__(self, base_url: str = "http://localhost:3847") -> None:
def _kill_orphan_sidecars(self) -> None:
def _kill_old_server(self) -> None:
def _remove_stale_lock(self) -> None:
def _start_server_via_launcher(self) -> None:
def _wait_for_health(self) -> None:

Found by automated Python type hints audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions