Skip to content

Handle import of optional dependencies consistently #72

@simonbohnen

Description

@simonbohnen

@xhochy suggested this pattern for optional dependencies like gcsfs:

try:
from gcsfs import GCSFileSystem
has_gcsfs = True
except ImportError:
has_gcsfs = False

We should apply this to all the dependencies, e.g. dulwich:

from dulwich.objects import Blob, Commit, Tree
from dulwich.repo import Repo

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