From 26d6ce6898c41022886b18c47332aed3dde68875 Mon Sep 17 00:00:00 2001 From: Johannes Koester Date: Thu, 7 Dec 2023 14:14:04 +0100 Subject: [PATCH] cleanup --- snakemake_storage_plugin_gcs/__init__.py | 5 ++--- tests/test_fake_gcs.py | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/snakemake_storage_plugin_gcs/__init__.py b/snakemake_storage_plugin_gcs/__init__.py index 35b65da..85bb0f2 100644 --- a/snakemake_storage_plugin_gcs/__init__.py +++ b/snakemake_storage_plugin_gcs/__init__.py @@ -1,5 +1,4 @@ from dataclasses import dataclass, field -import sys from typing import Any, Iterable, List, Optional from snakemake_interface_common.utils import lazy_property from snakemake_interface_storage_plugins.settings import StorageProviderSettingsBase @@ -17,7 +16,7 @@ StorageObjectGlob, ) from snakemake_interface_storage_plugins.common import Operation -from snakemake_interface_storage_plugins.io import IOCacheStorageInterface, Mtime +from snakemake_interface_storage_plugins.io import IOCacheStorageInterface from urllib.parse import urlparse import base64 import os @@ -464,7 +463,7 @@ def bucket(self): return self.client.bucket( self.bucket_name, user_project=self.provider.settings.project ) - + @property def blob(self): return self.bucket.blob(self.key) diff --git a/tests/test_fake_gcs.py b/tests/test_fake_gcs.py index 14d606b..c55cf3a 100644 --- a/tests/test_fake_gcs.py +++ b/tests/test_fake_gcs.py @@ -5,14 +5,16 @@ from google.cloud import storage # This endpoint assumes that you are using the default port 4443 from the container. -# If you are using a different port, please set the environment variable STORAGE_EMULATOR_HOST. +# If you are using a different port, please set the environment variable +# STORAGE_EMULATOR_HOST. os.environ.setdefault("STORAGE_EMULATOR_HOST", "http://localhost:4443") client = storage.Client( credentials=AnonymousCredentials(), project="test", - # Alternatively instead of using the global env STORAGE_EMULATOR_HOST. You can define it here. + # Alternatively instead of using the global env STORAGE_EMULATOR_HOST. You can + # define it here. # This will set this client object to point to the local google cloud storage. # client_options={"api_endpoint": "http://localhost:4443"}, ) @@ -35,4 +37,4 @@ # Create a new Bucket bucket = client.bucket("snakemake-test-bucket") client.create_bucket(bucket) -bucket.blob("test-file.txt").upload_from_string("Hello World!") \ No newline at end of file +bucket.blob("test-file.txt").upload_from_string("Hello World!")