Skip to content

chore(BA-440): Upgrade mypy to 1.14.1 and ruff to 0.8.5 #3354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 2, 2025
Prev Previous commit
Next Next commit
fix: Newly found type error in agent.server
  • Loading branch information
achimnol committed Jan 2, 2025
commit 7bbe7c637573aef2d394f10b7e58e12dacb98506
7 changes: 4 additions & 3 deletions src/ai/backend/agent/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import sys
from collections import OrderedDict, defaultdict
from datetime import datetime, timezone
from ipaddress import _BaseAddress as BaseIPAddress
from ipaddress import ip_network
from ipaddress import IPv4Address, IPv6Address, ip_network
from pathlib import Path
from pprint import pformat, pprint
from typing import (
Expand Down Expand Up @@ -1155,7 +1154,9 @@ def main(
raise click.Abort()

rpc_host = cfg["agent"]["rpc-listen-addr"].host
if isinstance(rpc_host, BaseIPAddress) and (rpc_host.is_unspecified or rpc_host.is_link_local):
if isinstance(rpc_host, (IPv4Address, IPv6Address)) and (
rpc_host.is_unspecified or rpc_host.is_link_local
):
print(
"ConfigurationError: "
"Cannot use link-local or unspecified IP address as the RPC listening host.",
Expand Down