Skip to content

Eager loading of cloud SDK dependencies can cause runtime error even if you don't plan to use that cloud #580

Description

@remi-braun

In your __init__ file, you try to import all the modules linked to all the cloud services you handle.

This makes all deps mandatory, e.g. with pip install cloudpathlib[s3]:

>>> import cloudpathlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\rbraun\AppData\Local\miniconda3\envs\test\Lib\site-packages\cloudpathlib\__init__.py", line 5, in <module>
    from .azure.azblobclient import AzureBlobClient
  File "C:\Users\rbraun\AppData\Local\miniconda3\envs\test\Lib\site-packages\cloudpathlib\azure\__init__.py", line 1, in <module>
    from .azblobclient import AzureBlobClient
  File "C:\Users\rbraun\AppData\Local\miniconda3\envs\test\Lib\site-packages\cloudpathlib\azure\azblobclient.py", line 22, in <module>
    from azure.core.credentials import AzureNamedKeyCredential
ImportError: cannot import name 'AzureNamedKeyCredential' from 'azure.core.credentials' (C:\Users\rbraun\AppData\Local\miniconda3\envs\test\Lib\site-packages\azure\core\credentials.py)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions