cloud-files 5.7.0__py3-none-any.whl → 5.8.1__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: cloud-files
3
- Version: 5.7.0
3
+ Version: 5.8.1
4
4
  Summary: Fast access to cloud storage and local FS.
5
5
  Home-page: https://github.com/seung-lab/cloud-files/
6
6
  Author: William Silversmith
@@ -19,41 +19,53 @@ Requires-Python: >=3.9,<4.0
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  License-File: AUTHORS
22
- Requires-Dist: boto3 >=1.4.7
22
+ Requires-Dist: boto3>=1.4.7
23
23
  Requires-Dist: brotli
24
24
  Requires-Dist: crc32c
25
- Requires-Dist: chardet >=3.0.4
25
+ Requires-Dist: chardet>=3.0.4
26
26
  Requires-Dist: click
27
- Requires-Dist: deflate >=0.2.0
27
+ Requires-Dist: deflate>=0.2.0
28
28
  Requires-Dist: gevent
29
- Requires-Dist: google-auth >=1.10.0
30
- Requires-Dist: google-cloud-core >=1.1.0
31
- Requires-Dist: google-cloud-storage >=1.31.1
32
- Requires-Dist: google-crc32c >=1.0.0
29
+ Requires-Dist: google-auth>=1.10.0
30
+ Requires-Dist: google-cloud-core>=1.1.0
31
+ Requires-Dist: google-cloud-storage>=1.31.1
32
+ Requires-Dist: google-crc32c>=1.0.0
33
33
  Requires-Dist: intervaltree
34
34
  Requires-Dist: numpy
35
35
  Requires-Dist: orjson
36
36
  Requires-Dist: pathos
37
- Requires-Dist: protobuf >=3.3.0
38
- Requires-Dist: requests >=2.22.0
39
- Requires-Dist: six >=1.14.0
40
- Requires-Dist: tenacity >=4.10.0
37
+ Requires-Dist: protobuf>=3.3.0
38
+ Requires-Dist: requests>=2.22.0
39
+ Requires-Dist: six>=1.14.0
40
+ Requires-Dist: tenacity>=4.10.0
41
41
  Requires-Dist: tqdm
42
- Requires-Dist: urllib3 >=1.26.3
42
+ Requires-Dist: urllib3>=1.26.3
43
43
  Requires-Dist: zstandard
44
- Requires-Dist: rsa >=4.7.2
44
+ Requires-Dist: rsa>=4.7.2
45
45
  Requires-Dist: fasteners
46
- Provides-Extra: apache
47
- Requires-Dist: lxml ; extra == 'apache'
48
- Provides-Extra: monitoring
49
- Requires-Dist: psutil ; extra == 'monitoring'
50
- Requires-Dist: intervaltree ; extra == 'monitoring'
51
- Requires-Dist: matplotlib ; extra == 'monitoring'
52
- Provides-Extra: numpy
53
- Requires-Dist: numpy ; extra == 'numpy'
54
46
  Provides-Extra: test
55
- Requires-Dist: pytest ; extra == 'test'
56
- Requires-Dist: moto >=5 ; extra == 'test'
47
+ Requires-Dist: pytest; extra == "test"
48
+ Requires-Dist: moto>=5; extra == "test"
49
+ Provides-Extra: numpy
50
+ Requires-Dist: numpy; extra == "numpy"
51
+ Provides-Extra: monitoring
52
+ Requires-Dist: psutil; extra == "monitoring"
53
+ Requires-Dist: intervaltree; extra == "monitoring"
54
+ Requires-Dist: matplotlib; extra == "monitoring"
55
+ Provides-Extra: apache
56
+ Requires-Dist: lxml; extra == "apache"
57
+ Dynamic: author
58
+ Dynamic: author-email
59
+ Dynamic: classifier
60
+ Dynamic: description
61
+ Dynamic: description-content-type
62
+ Dynamic: home-page
63
+ Dynamic: license
64
+ Dynamic: license-file
65
+ Dynamic: provides-extra
66
+ Dynamic: requires-dist
67
+ Dynamic: requires-python
68
+ Dynamic: summary
57
69
 
58
70
  [![PyPI version](https://badge.fury.io/py/cloud-files.svg)](https://badge.fury.io/py/cloud-files) [![Test Suite](https://github.com/seung-lab/cloud-files/workflows/Test%20Suite/badge.svg)](https://github.com/seung-lab/cloud-files/actions?query=workflow%3A%22Test+Suite%22)
59
71
 
@@ -1,10 +1,12 @@
1
+ cloud_files-5.8.1.dist-info/licenses/AUTHORS,sha256=BFVmobgAhaVFI5fqbuqAY5XmBQxe09ZZAsAOTy87hKQ,318
2
+ cloud_files-5.8.1.dist-info/licenses/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
1
3
  cloudfiles/__init__.py,sha256=pLB4CcV2l3Jgv_ni1520Np1pfzFj8Cpr87vNxFT3rNI,493
2
4
  cloudfiles/cloudfiles.py,sha256=tPG1PBLEjABPu-KLe93yf6xW_zbafPsQ6z5NuofyUoU,56743
3
5
  cloudfiles/compression.py,sha256=WXJHnoNLJ_NWyoY9ygZmFA2qMou35_9xS5dzF7-2H-M,6262
4
6
  cloudfiles/connectionpools.py,sha256=aL8RiSjRepECfgAFmJcz80aJFKbou7hsbuEgugDKwB8,4814
5
7
  cloudfiles/exceptions.py,sha256=N0oGQNG-St6RvnT8e5p_yC_E61q2kgAe2scwAL0F49c,843
6
8
  cloudfiles/gcs.py,sha256=unqu5KxGKaPq6N4QeHSpCDdtnK1BzPOAerTZ8FLt2_4,3820
7
- cloudfiles/interfaces.py,sha256=5rUh2DWOVlg13fAxyZ0wAaQyfW04xc2zlUfTItFV-zQ,45325
9
+ cloudfiles/interfaces.py,sha256=M62UdugtWcF-J4iQMClHNDEQYu7xxCSc1aT7WW2C1lU,44942
8
10
  cloudfiles/lib.py,sha256=HHjCvjmOjA0nZWSvHGoSeYpxqd6FAG8xk8LM212LAUA,5382
9
11
  cloudfiles/monitoring.py,sha256=N5Xq0PYZK1OxoYtwBFsnnfaq7dElTgY8Rn2Ez_I3aoo,20897
10
12
  cloudfiles/paths.py,sha256=HOvtdLSIYGwlwvnZt9d_Ez3TXOe7WWd18bZNDpExUDQ,12231
@@ -16,12 +18,10 @@ cloudfiles/threaded_queue.py,sha256=Nl4vfXhQ6nDLF8PZpSSBpww0M2zWtcd4DLs3W3BArBw,
16
18
  cloudfiles/typing.py,sha256=f3ZYkNfN9poxhGu5j-P0KCxjCCqSn9HAg5KiIPkjnCg,416
17
19
  cloudfiles_cli/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
18
20
  cloudfiles_cli/__init__.py,sha256=Wftt3R3F21QsHtWqx49ODuqT9zcSr0em7wk48kcH0WM,29
19
- cloudfiles_cli/cloudfiles_cli.py,sha256=k5_bMUcjDM2o-HjgwSaK6rT51t91nYjSAy3xZHf-qSs,38128
20
- cloud_files-5.7.0.dist-info/AUTHORS,sha256=BFVmobgAhaVFI5fqbuqAY5XmBQxe09ZZAsAOTy87hKQ,318
21
- cloud_files-5.7.0.dist-info/LICENSE,sha256=Jna4xYE8CCQmaxjr5Fs-wmUBnIQJ1DGcNn9MMjbkprk,1538
22
- cloud_files-5.7.0.dist-info/METADATA,sha256=oiedYRc-OIb1u8yRqMKOOKtvEJHj5phtQd-0V-cEqfI,30530
23
- cloud_files-5.7.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
24
- cloud_files-5.7.0.dist-info/entry_points.txt,sha256=xlirb1FVhn1mbcv4IoyMEGumDqKOA4VMVd3drsRQxIg,51
25
- cloud_files-5.7.0.dist-info/pbr.json,sha256=btfjSn_FM-LMcr5pxgz5jRJ_ImTfyOwfBZgFRavgNP8,46
26
- cloud_files-5.7.0.dist-info/top_level.txt,sha256=xPyrST3okJbsmdCF5IC2gYAVxg_aD5AYVTnNo8UuoZU,26
27
- cloud_files-5.7.0.dist-info/RECORD,,
21
+ cloudfiles_cli/cloudfiles_cli.py,sha256=JlP9ocqxZbMANAZhZCQSvvjwe6syovQ1asUzSeAlNYk,38459
22
+ cloud_files-5.8.1.dist-info/METADATA,sha256=rpDcFJu73xenVENaNYRiVfR101bCuRZ-81GwCjUBXEM,30769
23
+ cloud_files-5.8.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ cloud_files-5.8.1.dist-info/entry_points.txt,sha256=xlirb1FVhn1mbcv4IoyMEGumDqKOA4VMVd3drsRQxIg,51
25
+ cloud_files-5.8.1.dist-info/pbr.json,sha256=NMitOWL8rgzn1OryBwJszO5j4XHPTNlgqjPegLKIiCU,46
26
+ cloud_files-5.8.1.dist-info/top_level.txt,sha256=xPyrST3okJbsmdCF5IC2gYAVxg_aD5AYVTnNo8UuoZU,26
27
+ cloud_files-5.8.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1 @@
1
+ {"git_version": "add0684", "is_release": true}
cloudfiles/interfaces.py CHANGED
@@ -798,6 +798,7 @@ class GoogleCloudStorageInterface(StorageInterface):
798
798
  except google.cloud.exceptions.NotFound:
799
799
  pass
800
800
 
801
+
801
802
  @retry
802
803
  def list_files(self, prefix, flat=False):
803
804
  """
@@ -817,33 +818,22 @@ class GoogleCloudStorageInterface(StorageInterface):
817
818
  delimiter=delimiter,
818
819
  )
819
820
 
820
- first = True
821
- for blob in blobs:
822
- # This awkward construction is necessary
823
- # because the request that populates prefixes
824
- # isn't made until the iterator is activated.
825
- if first and blobs.prefixes:
821
+ for page in blobs.pages:
822
+ if page.prefixes:
826
823
  yield from (
827
824
  item.removeprefix(path)
828
- for item in blobs.prefixes
825
+ for item in page.prefixes
829
826
  )
830
- first = False
831
827
 
832
- filename = blob.name.removeprefix(layer_path)
833
- if not filename:
834
- continue
835
- elif not flat and filename[-1] != '/':
836
- yield filename
837
- elif flat and '/' not in blob.name.removeprefix(path):
838
- yield filename
828
+ for blob in page:
829
+ filename = blob.name.removeprefix(layer_path)
830
+ if not filename:
831
+ continue
832
+ elif not flat and filename[-1] != '/':
833
+ yield filename
834
+ elif flat and '/' not in blob.name.removeprefix(path):
835
+ yield filename
839
836
 
840
- # When there are no regular items at this level
841
- # we need to still print the directories.
842
- if first and blobs.prefixes:
843
- yield from (
844
- item.removeprefix(path)
845
- for item in blobs.prefixes
846
- )
847
837
 
848
838
  def release_connection(self):
849
839
  global GC_POOL
@@ -182,6 +182,19 @@ def get_mfp(path, recursive):
182
182
 
183
183
  return (many, flat, prefix, suffix)
184
184
 
185
+ @main.command("mkdir")
186
+ @click.argument("paths", nargs=-1)
187
+ def _mkdir(paths):
188
+ """
189
+ Create paths on the local file system.
190
+ """
191
+ for path in paths:
192
+ path = normalize_path(path)
193
+ protocol = get_protocol(path)
194
+
195
+ if protocol == "file":
196
+ mkdir(path.replace("file://", "", 1))
197
+
185
198
  @main.command()
186
199
  @click.argument("source", nargs=-1)
187
200
  @click.argument("destination", nargs=1)
@@ -588,6 +601,7 @@ def touch(
588
601
  ctx, sources,
589
602
  progress, no_sign_request,
590
603
  ):
604
+ """Create file if it doesn't exist."""
591
605
  sources = list(map(normalize_path, sources))
592
606
  sources = [ src.replace("precomputed://", "") for src in sources ]
593
607
  pbar = tqdm(total=len(sources), desc="Touch", disable=(not progress))
@@ -1 +0,0 @@
1
- {"git_version": "cab2668", "is_release": true}