From ec512fe1662dbf6a87334b09c703951214acc727 Mon Sep 17 00:00:00 2001 From: yusyus Date: Sun, 8 Feb 2026 14:31:01 +0300 Subject: [PATCH] style: Fix ruff linting errors - Fix bare except in chroma.py - Fix whitespace issues in test_cloud_storage.py - Auto-fixes from ruff --fix --- src/skill_seekers/cli/adaptors/chroma.py | 2 +- tests/test_cloud_storage.py | 27 ++++++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/skill_seekers/cli/adaptors/chroma.py b/src/skill_seekers/cli/adaptors/chroma.py index 8784cbc..a6b876c 100644 --- a/src/skill_seekers/cli/adaptors/chroma.py +++ b/src/skill_seekers/cli/adaptors/chroma.py @@ -287,7 +287,7 @@ class ChromaAdaptor(SkillAdaptor): # Try to get existing collection collection = client.get_collection(name=collection_name) print(f"ℹ️ Using existing collection: {collection_name}") - except: + except Exception: try: # Create new collection metadata = {"hnsw:space": distance_function} diff --git a/tests/test_cloud_storage.py b/tests/test_cloud_storage.py index 54e124f..91ff4a0 100644 --- a/tests/test_cloud_storage.py +++ b/tests/test_cloud_storage.py @@ -3,7 +3,6 @@ Tests for cloud storage adaptors. """ import os -import sys import pytest import tempfile from pathlib import Path @@ -87,7 +86,7 @@ def test_s3_upload_file(): """Test S3 file upload.""" if not BOTO3_AVAILABLE: pytest.skip("boto3 not installed") - + with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3: # Setup mocks mock_client = Mock() @@ -115,7 +114,7 @@ def test_s3_download_file(): """Test S3 file download.""" if not BOTO3_AVAILABLE: pytest.skip("boto3 not installed") - + with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3: # Setup mocks mock_client = Mock() @@ -139,7 +138,7 @@ def test_s3_list_files(): """Test S3 file listing.""" if not BOTO3_AVAILABLE: pytest.skip("boto3 not installed") - + with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3: # Setup mocks mock_client = Mock() @@ -177,7 +176,7 @@ def test_s3_file_exists(): """Test S3 file existence check.""" if not BOTO3_AVAILABLE: pytest.skip("boto3 not installed") - + with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3: # Setup mocks mock_client = Mock() @@ -195,7 +194,7 @@ def test_s3_get_file_url(): """Test S3 presigned URL generation.""" if not BOTO3_AVAILABLE: pytest.skip("boto3 not installed") - + with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3: # Setup mocks mock_client = Mock() @@ -220,7 +219,7 @@ def test_gcs_upload_file(): """Test GCS file upload.""" if not GCS_AVAILABLE: pytest.skip("google-cloud-storage not installed") - + with patch('skill_seekers.cli.storage.gcs_storage.storage') as mock_storage: # Setup mocks mock_client = Mock() @@ -252,7 +251,7 @@ def test_gcs_download_file(): """Test GCS file download.""" if not GCS_AVAILABLE: pytest.skip("google-cloud-storage not installed") - + with patch('skill_seekers.cli.storage.gcs_storage.storage') as mock_storage: # Setup mocks mock_client = Mock() @@ -278,7 +277,7 @@ def test_gcs_list_files(): """Test GCS file listing.""" if not GCS_AVAILABLE: pytest.skip("google-cloud-storage not installed") - + with patch('skill_seekers.cli.storage.gcs_storage.storage') as mock_storage: # Setup mocks mock_client = Mock() @@ -311,7 +310,7 @@ def test_azure_upload_file(): """Test Azure file upload.""" if not AZURE_AVAILABLE: pytest.skip("azure-storage-blob not installed") - + with patch('skill_seekers.cli.storage.azure_storage.BlobServiceClient') as mock_blob_service: # Setup mocks mock_service_client = Mock() @@ -344,7 +343,7 @@ def test_azure_download_file(): """Test Azure file download.""" if not AZURE_AVAILABLE: pytest.skip("azure-storage-blob not installed") - + with patch('skill_seekers.cli.storage.azure_storage.BlobServiceClient') as mock_blob_service: # Setup mocks mock_service_client = Mock() @@ -375,7 +374,7 @@ def test_azure_list_files(): """Test Azure file listing.""" if not AZURE_AVAILABLE: pytest.skip("azure-storage-blob not installed") - + with patch('skill_seekers.cli.storage.azure_storage.BlobServiceClient') as mock_blob_service: # Setup mocks mock_service_client = Mock() @@ -435,7 +434,7 @@ def test_upload_directory(): """Test directory upload.""" if not BOTO3_AVAILABLE: pytest.skip("boto3 not installed") - + with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3: # Setup mocks mock_client = Mock() @@ -462,7 +461,7 @@ def test_download_directory(): """Test directory download.""" if not BOTO3_AVAILABLE: pytest.skip("boto3 not installed") - + with patch('skill_seekers.cli.storage.s3_storage.boto3') as mock_boto3: # Setup mocks mock_client = Mock()