Skip to content

Move to importlib.util.find_spec for checking if packages are installed #25

@nhairs

Description

@nhairs

Per title, move to importlib.util.find_spec over try: import name; catch ImportError.

This allows us to check for installed modules (i.e. orjson, msgspec) without actually importing them.

Ref: https://stackoverflow.com/a/14050282/12281814

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions