Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dstansby opened this issue Nov 21, 2024 · 1 comment
Open

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

dstansby opened this issue Nov 21, 2024 · 1 comment

Comments

@dstansby
Copy link
Contributor

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.

@dstansby
Copy link
Contributor Author

Pinging @jakirkham to see if you have any thoughts, because I know you've been tidying this up recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant