Skip to content

Decide, document (and rethink?) optional dependency handling #655

@dstansby

Description

@dstansby

Currently the approach to handling optional dependencies is to not define codec classes if the dependency is not present (e.g., see #637). This leads to a poor user experience when you want to use an optional codec, but haven't installed the optional dependency: if you try and import the codec, you get an import error without any information that to fix the error you have to install a specific package: #526

I propose that we switch to a model where instead instantiating a codec class where an optional dependency is missing raises a helpful error message.

At some point I will create a PR with a concrete implementation of this change to help see what it would mean, but please share opinions on if there are other/better ways to improve user experience around optional dependency handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions