allenai / cached_path

A file utility for accessing both local and remote files through a unified interface.

Home Page:https://cached-path.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

required version of google-cloud-storage needs bumping

will-moore opened this issue · comments

Checklist

  • I have verified that the issue exists against the main branch.
  • I have read the relevant section in the contribution guide on reporting bugs.
  • I have checked the issues list for similar or identical bug reports.
  • I have checked the pull requests list for existing proposed fixes.
  • I have checked the CHANGELOG and the commit log to find out if the bug was already fixed in the main branch.
  • I have included in the "Description" section below a traceback from any exceptions related to this bug.
  • I have included in the "Related issues or possible duplicates" section beloew all related issues and possible duplicate issues (If there are none, check this box anyway).
  • I have included in the "Environment" section below the name of the operating system and Python version that I was using when I discovered this bug.
  • I have included in the "Environment" section below the output of pip freeze.
  • I have included in the "Steps to reproduce" section below a minimally reproducible example.

Description

I already had google-cloud-storage Version: 1.31.0 installed when I installed cached_path, which satisfies the requirements
google-cloud-storage>=1.0,<3.0 in https://github.com/allenai/cached_path/blob/main/requirements.txt

However, when I try to import cached_path I get the exception below because that version of google-cloud-storage is out of date: `No module named 'google.cloud.storage.retry'.

I don't know what version of google-cloud-storage added this, but if I do pip install -U google-cloud-storage the error goes away.

Python traceback:

  File "/Users/wmoore/Desktop/ZARR/ome-zarr-py/ome_zarr/reader.py", line 7, in <module>
    from cached_path import cached_path
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb/lib/python3.9/site-packages/cached_path/__init__.py", line 13, in <module>
    from ._cached_path import cached_path
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb/lib/python3.9/site-packages/cached_path/_cached_path.py", line 15, in <module>
    from .schemes import get_scheme_client, get_supported_schemes, hf_get_from_cache
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb/lib/python3.9/site-packages/cached_path/schemes/__init__.py", line 3, in <module>
    from cached_path.schemes.gs import GsClient
  File "/Users/wmoore/opt/anaconda3/envs/omeroweb/lib/python3.9/site-packages/cached_path/schemes/gs.py", line 11, in <module>
    from google.cloud.storage.retry import DEFAULT_RETRY
ModuleNotFoundError: No module named 'google.cloud.storage.retry'

Related issues or possible duplicates

  • None

Environment

OS: M1 Mac

Python version: 3.9.12

Output of pip freeze:

$ pip show google-cloud-storage
Name: google-cloud-storage
Version: 1.31.0
Summary: Google Cloud Storage API client library
Home-page: https://github.com/googleapis/python-storage
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Location: /Users/wmoore/opt/anaconda3/envs/omeroweb/lib/python3.9/site-packages
Requires: google-auth, google-cloud-core, google-resumable-media
Required-by: cached-path

Steps to reproduce

Example source:

commented

Thanks for bringing this up @will-moore! I'll do some digging.

commented

Looks like this module was first introduced in v1.32.0, so I'll make that the minimum version.

Great, thanks!