From 2c3d1b81d6f450c9f1e465e2348bd82ba1acf2c1 Mon Sep 17 00:00:00 2001 From: atlaie Date: Fri, 2 Oct 2026 18:22:21 +0200 Subject: [PATCH] fix: point the token_path login error at docs/auth.md Co-Authored-By: Claude Opus 5.5 --- syft/sync/login.py | 3 ++- tests/integration/without_unit_coverage/test_login.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/syft/sync/login.py b/syft/sync/login.py index b669159dfd8..e7a43d12363 100644 --- a/syft/sync/login.py +++ b/syft/sync/login.py @@ -82,7 +82,8 @@ def _resolve_login_params( token_path = token_path or settings.token_path if not token_path: raise NotImplementedError( - "Jupyter login is only supported with a token path" + "Running outside Colab: pass token_path=... to login_do()/login_ds(). " + "See docs/auth.md to create a token (about 15 minutes)." ) if email is None: raise ValueError("Email is required for Jupyter login") diff --git a/tests/integration/without_unit_coverage/test_login.py b/tests/integration/without_unit_coverage/test_login.py index 55da6b486a4..7cf482c5582 100644 --- a/tests/integration/without_unit_coverage/test_login.py +++ b/tests/integration/without_unit_coverage/test_login.py @@ -178,7 +178,7 @@ def test_login_ds_missing_token_path_raises(monkeypatch): """Test that login_ds raises error when token_path is missing in Jupyter env.""" # Unset the env var so the test can verify the error is raised monkeypatch.delenv("SYFT_TOKEN_PATH", raising=False) - with pytest.raises(NotImplementedError, match="token path"): + with pytest.raises(NotImplementedError, match="token_path"): sy.login_ds( email="test@test.com", token_path=None, @@ -192,7 +192,7 @@ def test_login_do_missing_token_path_raises(monkeypatch): """Test that login_do raises error when token_path is missing in Jupyter env.""" # Unset the env var so the test can verify the error is raised monkeypatch.delenv("SYFT_TOKEN_PATH", raising=False) - with pytest.raises(NotImplementedError, match="token path"): + with pytest.raises(NotImplementedError, match="token_path"): sy.login_do( email="test@test.com", token_path=None,