cloud-files 5.1.2__tar.gz → 5.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloud_files-5.1.2 → cloud_files-5.2.0}/ChangeLog +12 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/PKG-INFO +1 -1
- {cloud_files-5.1.2 → cloud_files-5.2.0}/automated_test.py +7 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloud_files.egg-info/PKG-INFO +1 -1
- cloud_files-5.2.0/cloud_files.egg-info/pbr.json +1 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/compression.py +1 -1
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/interfaces.py +4 -1
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/lib.py +2 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/paths.py +14 -2
- {cloud_files-5.1.2 → cloud_files-5.2.0}/setup.cfg +1 -1
- cloud_files-5.1.2/cloud_files.egg-info/pbr.json +0 -1
- {cloud_files-5.1.2 → cloud_files-5.2.0}/.github/workflows/test-suite.yml +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/AUTHORS +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/LICENSE +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/MANIFEST.in +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/README.md +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloud_files.egg-info/SOURCES.txt +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloud_files.egg-info/dependency_links.txt +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloud_files.egg-info/entry_points.txt +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloud_files.egg-info/not-zip-safe +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloud_files.egg-info/requires.txt +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloud_files.egg-info/top_level.txt +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/__init__.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/cloudfiles.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/connectionpools.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/exceptions.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/gcs.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/resumable_tools.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/scheduler.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/secrets.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/test.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/threaded_queue.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles/typing.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles_cli/LICENSE +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles_cli/__init__.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/cloudfiles_cli/cloudfiles_cli.py +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/requirements.txt +0 -0
- {cloud_files-5.1.2 → cloud_files-5.2.0}/setup.py +0 -0
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
CHANGES
|
|
2
2
|
=======
|
|
3
3
|
|
|
4
|
+
5.2.0
|
|
5
|
+
-----
|
|
6
|
+
|
|
7
|
+
* fix: support |format: style of cloudpaths (#110)
|
|
8
|
+
* fix: correct crc32c representation for s3
|
|
9
|
+
|
|
10
|
+
5.1.3
|
|
11
|
+
-----
|
|
12
|
+
|
|
13
|
+
* fix: package metadata
|
|
14
|
+
* fix: deflate returning bytearray from gunzip as well
|
|
15
|
+
|
|
4
16
|
5.1.2
|
|
5
17
|
-----
|
|
6
18
|
|
|
@@ -538,6 +538,13 @@ def test_path_extraction():
|
|
|
538
538
|
'dataset/layer', None, None
|
|
539
539
|
))
|
|
540
540
|
|
|
541
|
+
assert (
|
|
542
|
+
paths.extract('gs://bucket/dataset/layer|zarr2:')
|
|
543
|
+
== ExtractedPath(
|
|
544
|
+
'zarr2', 'gs', 'bucket',
|
|
545
|
+
'dataset/layer', None, None
|
|
546
|
+
))
|
|
547
|
+
|
|
541
548
|
okgoogle('gs://bucket/dataset/layer/')
|
|
542
549
|
# shoulderror('gs://bucket/dataset/layer/info')
|
|
543
550
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "bee40ef", "is_release": true}
|
|
@@ -1189,10 +1189,13 @@ class S3Interface(StorageInterface):
|
|
|
1189
1189
|
**attrs
|
|
1190
1190
|
)
|
|
1191
1191
|
else:
|
|
1192
|
+
if isinstance(content, str):
|
|
1193
|
+
content = content.encode('utf8')
|
|
1194
|
+
|
|
1192
1195
|
attrs['Bucket'] = self._path.bucket
|
|
1193
1196
|
attrs['Body'] = content
|
|
1194
1197
|
attrs['Key'] = key
|
|
1195
|
-
attrs["ChecksumCRC32C"] =
|
|
1198
|
+
attrs["ChecksumCRC32C"] = encode_crc32c_b64(content).decode('utf8')
|
|
1196
1199
|
self._conn.put_object(**attrs)
|
|
1197
1200
|
|
|
1198
1201
|
@retry
|
|
@@ -163,6 +163,8 @@ def crc32c(binary):
|
|
|
163
163
|
Computes the crc32c of a binary string
|
|
164
164
|
and returns it as an integer.
|
|
165
165
|
"""
|
|
166
|
+
if isinstance(binary, str):
|
|
167
|
+
binary = binary.encode('utf8')
|
|
166
168
|
return crc32clib.crc32c(binary) # an integer
|
|
167
169
|
|
|
168
170
|
def md5(binary, base=64):
|
|
@@ -58,11 +58,14 @@ def update_aliases_from_file():
|
|
|
58
58
|
|
|
59
59
|
def cloudpath_error(cloudpath):
|
|
60
60
|
return yellow(f"""
|
|
61
|
-
Cloud Path must conform to
|
|
61
|
+
Cloud Path must conform to one of:
|
|
62
|
+
(a) [FORMAT://]PROTOCOL://PATH
|
|
63
|
+
(b) PROTOCOL://PATH|FORMAT:
|
|
62
64
|
Examples:
|
|
63
65
|
precomputed://gs://test_bucket/em
|
|
64
66
|
gs://test_bucket/em
|
|
65
67
|
graphene://https://example.com/image/em
|
|
68
|
+
gs://text_bucket/em/|zarr2:
|
|
66
69
|
|
|
67
70
|
Supported Formats: None (precomputed), {", ".join(ALLOWED_FORMATS)}
|
|
68
71
|
Supported Protocols: {", ".join(ALLOWED_PROTOCOLS)}
|
|
@@ -87,6 +90,9 @@ def mkregexp():
|
|
|
87
90
|
CLOUDPATH_REGEXP = re.compile(mkregexp())
|
|
88
91
|
BUCKET_RE = re.compile(r'^(/?[~\d\w_\.\-]+(?::\d+)?)(?:/|$)') # posix /what/a/great/path
|
|
89
92
|
|
|
93
|
+
# |neuroglancer-precomputed: or |zarr2: suffixes etc
|
|
94
|
+
TAIL_FORMAT_REGEXP = re.compile('\\|(?P<fmt>[\\w\\d-]+):$')
|
|
95
|
+
|
|
90
96
|
def add_alias(alias:str, host:str):
|
|
91
97
|
global ALIASES
|
|
92
98
|
global ALLOWED_PROTOCOLS
|
|
@@ -291,6 +297,13 @@ def pop_protocol(cloudpath):
|
|
|
291
297
|
def extract_format_protocol(cloudpath:str, allow_defaults=True) -> tuple:
|
|
292
298
|
error = UnsupportedProtocolError(cloudpath_error(cloudpath))
|
|
293
299
|
|
|
300
|
+
cloudpath = cloudpath.removesuffix(PRECOMPUTED_SUFFIX)
|
|
301
|
+
|
|
302
|
+
m = re.search(TAIL_FORMAT_REGEXP, cloudpath)
|
|
303
|
+
if m is not None:
|
|
304
|
+
cloudpath = re.sub(TAIL_FORMAT_REGEXP, "", cloudpath)
|
|
305
|
+
cloudpath = f"{m.group('fmt')}://{cloudpath}"
|
|
306
|
+
|
|
294
307
|
alias, cloudpath = resolve_alias(cloudpath)
|
|
295
308
|
|
|
296
309
|
m = re.match(CLOUDPATH_REGEXP, cloudpath)
|
|
@@ -299,7 +312,6 @@ def extract_format_protocol(cloudpath:str, allow_defaults=True) -> tuple:
|
|
|
299
312
|
|
|
300
313
|
groups = m.groups()
|
|
301
314
|
cloudpath = re.sub(CLOUDPATH_REGEXP, '', cloudpath, count=1)
|
|
302
|
-
cloudpath = cloudpath.removesuffix(PRECOMPUTED_SUFFIX)
|
|
303
315
|
|
|
304
316
|
fmt = m.group('fmt')
|
|
305
317
|
if not fmt and allow_defaults:
|
|
@@ -6,7 +6,7 @@ description_content_type = text/markdown
|
|
|
6
6
|
description_file = README.md
|
|
7
7
|
author = William Silversmith
|
|
8
8
|
author_email = ws9@princeton.edu
|
|
9
|
-
|
|
9
|
+
home_page = https://github.com/seung-lab/cloud-files/
|
|
10
10
|
license = License :: OSI Approved :: BSD License
|
|
11
11
|
classifier =
|
|
12
12
|
Intended Audience :: Developers
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"git_version": "02bf227", "is_release": true}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|