sherlock icon indicating copy to clipboard operation
sherlock copied to clipboard

Use `extra_requires` for the backend clients pip

Open kalyanaramansanthanam opened this issue 5 years ago • 3 comments

Suggestion: Instead of requiring all 3 backend clients to be installed, please allow an option to only install the backend being used.

Relevant: https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies

kalyanaramansanthanam avatar Aug 02 '20 05:08 kalyanaramansanthanam

@vaidik (ping)

Problem

#45 and #44 relate to the same issue: library users may not have/need all 3 supported backend at once and related libraries installed yet the package requires them all.

As @kalyanaramansanthanam described above Python offers a solution for optional dependencies. The link above seems not to point to the relevant section anymore but here is a very short summary: https://stackoverflow.com/a/45043494

Additionally, only XXXLock classes whose dependency is available at runtime should be declared (nice to have) to avoid package import failure. This issue will become more problematic as the number of backends increases.

Workaround

macOS: brew install libmemcached Ubuntu: apt-get install libmemcached-dev

PS: This is a fantastic library!

@judahrand Are you the new maintainer now ?

davidandreoletti avatar Jul 14 '22 14:07 davidandreoletti

@davidandreoletti I'm certainly planning on trying to get this project modernized and merge in some fixes improvements, etc.

If you're keen to contribute this change/feature please feel feel to open a PR and I'll do my best to support!

judahrand avatar Jul 15 '22 15:07 judahrand

I have limited bandwidth for OSS projects and ended up not using this package. Another time perhaps :-)

davidandreoletti avatar Aug 25 '22 10:08 davidandreoletti

This should now work. Just need to actually release it -- in the meantime you could install from the repo.

judahrand avatar Oct 03 '22 14:10 judahrand