diff --git a/pyproject.toml b/pyproject.toml index 980c16f97..95be00baf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,14 +92,16 @@ build-backend = "poetry.core.masonry.api" [tool.ruff] target-version = "py39" +output-format="concise" lint.isort.split-on-trailing-comma = false -lint.select = ["B", "D", "E", "F", "I", "SIM", "W"] +lint.select = ["B", "D", "E", "F", "I", "SIM", "W", "ANN001"] lint.ignore = ["B008", "D205", "E501", "F403", "SIM115"] lint.pydocstyle.convention = "google" [tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401"] -"tests/*.py" = ["D100", "D103", "D104", "B018"] +"tests/*.py" = ["D100", "D103", "D104", "B018", "ANN001"] +"benchmarks/*.py" = ["ANN001"] "reflex/.templates/*.py" = ["D100", "D103", "D104"] "*.pyi" = ["D301", "D415", "D417", "D418", "E742"] "*/blank.py" = ["I001"] diff --git a/scripts/wait_for_listening_port.py b/scripts/wait_for_listening_port.py index 247ff4fba..9e52d81e3 100644 --- a/scripts/wait_for_listening_port.py +++ b/scripts/wait_for_listening_port.py @@ -14,7 +14,7 @@ from typing import Tuple import psutil -def _pid_exists(pid): +def _pid_exists(pid: int): # os.kill(pid, 0) doesn't work on Windows (actually kills the PID) # psutil.pid_exists() doesn't work on Windows (does os.kill underneath) # psutil.pids() seems to return the right thing. Inefficient but doesn't matter - keeps things simple. @@ -23,7 +23,7 @@ def _pid_exists(pid): return pid in psutil.pids() -def _wait_for_port(port, server_pid, timeout) -> Tuple[bool, str]: +def _wait_for_port(port: int, server_pid: int, timeout: float) -> Tuple[bool, str]: start = time.time() print(f"Waiting for up to {timeout} seconds for port {port} to start listening.") while True: