diff --git a/libs/cli/langgraph_cli/deploy.py b/libs/cli/langgraph_cli/deploy.py index de644f182..8c4765163 100644 --- a/libs/cli/langgraph_cli/deploy.py +++ b/libs/cli/langgraph_cli/deploy.py @@ -1371,7 +1371,10 @@ def _create_host_backend_client( langsmith_endpoint = env_vars.get("LANGSMITH_ENDPOINT") or os.environ.get( "LANGSMITH_ENDPOINT" ) - if langsmith_endpoint and langsmith_endpoint.rstrip("/") not in _cloud_endpoints: + if ( + langsmith_endpoint + and langsmith_endpoint.rstrip("/") not in _cloud_endpoints + ): from urllib.parse import urlparse as _urlparse _p = _urlparse(langsmith_endpoint) @@ -1818,9 +1821,7 @@ def _deploy_cmd( existing = _call_host_backend_with_optional_tenant( client, lambda c: c.get_deployment(deployment_id) ) - existing_source = ( - existing.get("source") if isinstance(existing, dict) else None - ) + existing_source = existing.get("source") if isinstance(existing, dict) else None if existing_source and existing_source != "external_docker": raise click.UsageError( f"Deployment {deployment_id} was created with source " diff --git a/libs/cli/tests/unit_tests/test_host_backend.py b/libs/cli/tests/unit_tests/test_host_backend.py index 85c2a93d5..2be709fdf 100644 --- a/libs/cli/tests/unit_tests/test_host_backend.py +++ b/libs/cli/tests/unit_tests/test_host_backend.py @@ -25,7 +25,7 @@ def client(mock_transport): def test_constructor_strips_trailing_slash(): c = HostBackendClient("https://api.example.com/", "key") - assert str(c._client.base_url) == "https://api.example.com" + assert c.base_url == "https://api.example.com" def test_constructor_empty_url_raises():