mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-27 07:18:28 +01:00
Intermediate PR in removing path_info from our code base. It is completely removed from the main codebase and is still being used in tests, which will be migrated in the followups. For fs-specific simple path manipulation, we've introduced `fs.path` helper (similar to `os.path`). Fixes #6774
29 lines
768 B
Python
29 lines
768 B
Python
import threading
|
|
|
|
from funcy import cached_property, wrap_prop
|
|
|
|
from dvc.scheme import Schemes
|
|
|
|
# pylint:disable=abstract-method
|
|
from .fsspec_wrapper import CallbackMixin, ObjectFSWrapper
|
|
|
|
|
|
class GSFileSystem(CallbackMixin, ObjectFSWrapper):
|
|
scheme = Schemes.GS
|
|
REQUIRES = {"gcsfs": "gcsfs"}
|
|
PARAM_CHECKSUM = "etag"
|
|
DETAIL_FIELDS = frozenset(("etag", "size"))
|
|
|
|
def _prepare_credentials(self, **config):
|
|
login_info = {"consistency": None}
|
|
login_info["project"] = config.get("projectname")
|
|
login_info["token"] = config.get("credentialpath")
|
|
return login_info
|
|
|
|
@wrap_prop(threading.Lock())
|
|
@cached_property
|
|
def fs(self):
|
|
from gcsfs import GCSFileSystem
|
|
|
|
return GCSFileSystem(**self.fs_args)
|