Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Dependency extras #211

Closed
peterschutt opened this issue Jan 8, 2023 · 4 comments · Fixed by #213
Closed

Dependency extras #211

peterschutt opened this issue Jan 8, 2023 · 4 comments · Fixed by #213
Assignees

Comments

@peterschutt
Copy link
Member

Any feature of the plugin that requires an additional dependency should require an "extra" install, and that feature should only be enabled if the extra is available.

For example, we make sentry an extra install, and we only configure it if it is available in the environment (and respecting the PluginConfig.do_sentry flag.

@gazorby gazorby self-assigned this Jan 8, 2023
@gazorby
Copy link
Collaborator

gazorby commented Jan 8, 2023

Working on it. I just noticed that we have hiredis requirement but it's not import anywhere, any reason?

@peterschutt
Copy link
Member Author

Thanks for picking this up! This is one that @cofin requested in starlite discord.

If hiredis is in the environment, it is automatically used by redis-py:

For faster performance, install redis with hiredis support, this provides a compiled response parser, and for most cases requires zero code changes. By default, if hiredis >= 1.0 is available, redis-py will attempt to use it for response parsing.

@gazorby
Copy link
Collaborator

gazorby commented Jan 8, 2023

Alright, so we could create a "caching" dependency group with redis and hiredis what do you think?

@peterschutt
Copy link
Member Author

peterschutt commented Jan 9, 2023

Not sure - redis is a dependency of saq too. Just saw that you made SAQ optional as well - maybe need to rename the lib 😆

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

Successfully merging a pull request may close this issue.

2 participants