From b25a8635b9c2da6308566174917e82fa803cb9a9 Mon Sep 17 00:00:00 2001 From: calvinleng-science Date: Tue, 20 Oct 2026 14:22:10 -0700 Subject: [PATCH 1/2] Accept ip:port for --uri without name discovery The release workflow's simulator check (synapsectl -u 127.0.0.1:50051 info) has been falling into name discovery and failing; it only passed before because failures exited 0. --- synapse/cli/__main__.py | 3 ++- synapse/tests/cli/test_uri.py | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 synapse/tests/cli/test_uri.py diff --git a/synapse/cli/__main__.py b/synapse/cli/__main__.py index 99554aa..01236f8 100755 --- a/synapse/cli/__main__.py +++ b/synapse/cli/__main__.py @@ -38,7 +38,8 @@ def setup_device_uri(args): if not args.uri: # User doesn't want to use something that needs a uri return args - if not is_valid_ip(args.uri): + # Device accepts ip:port, so only the host part decides name vs address. + if not (is_valid_ip(args.uri) or is_valid_ip(args.uri.rsplit(":", 1)[0])): # User passed in a name console = Console() device_ip = find_device_by_name(args.uri, console, False, 60) diff --git a/synapse/tests/cli/test_uri.py b/synapse/tests/cli/test_uri.py new file mode 100644 index 0000000..f37219c --- /dev/null +++ b/synapse/tests/cli/test_uri.py @@ -0,0 +1,21 @@ +import importlib.util +from argparse import Namespace +from pathlib import Path + +import synapse.cli + +# conftest.py stubs synapse.cli.__main__, so load the real file under another name. +_spec = importlib.util.spec_from_file_location( + "synapse_cli_main_for_test", Path(synapse.cli.__file__).with_name("__main__.py") +) +cli_main = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(cli_main) + + +def test_ip_with_port_skips_name_lookup(monkeypatch): + def fail(*a, **k): + raise AssertionError("name lookup should not run") + + monkeypatch.setattr(cli_main, "find_device_by_name", fail) + for uri in ["127.0.0.1", "127.0.0.1:50051", "::1"]: + assert cli_main.setup_device_uri(Namespace(uri=uri)).uri == uri From 8614987058867cb728b47806a2159d6884a115ea Mon Sep 17 00:00:00 2001 From: calvinleng-science Date: Tue, 20 Oct 2026 14:22:10 -0700 Subject: [PATCH 2/2] Bump version to 2.8.4 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bb97a94..83a6ae8 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ def stamp_api_version(): setup( name="science-synapse", - version="2.8.3", + version="2.8.4", description="Client library and CLI for the Synapse API", author="Science Team", author_email="team@science.xyz",