-
Notifications
You must be signed in to change notification settings - Fork 267
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
Optional dependencies #1798
Optional dependencies #1798
Conversation
@@ -37,6 +37,7 @@ install_requires= | |||
# sqlitedict==2.0.0 is slow! https://github.com/RaRe-Technologies/sqlitedict/issues/152 | |||
# Keep sqlitedict version at 1.7.0. | |||
sqlitedict~=1.7.0 | |||
bottle~=0.12.23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is bottle not under server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed that section from "server" to "proxy-server". Bottle is not under there because it's also used for helm-server
, not just the proxy.
@@ -358,6 +359,12 @@ def filter_by_metadata(self, subset: ICESubset, header_dir: str, all_corpus_file | |||
return [] | |||
|
|||
for fi, columns in files: | |||
|
|||
try: | |||
import xlrd # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not do this at the top-level like the other imports of optional dependencies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved. I wanted to keep it close to the pd.read_excel()
call for readability, but I agree that it is better to have it at the top and just add a comment to explain it.
# TODO: Ask user to install more specific optional dependencies | ||
# e.g. crfm-helm[plots] or crfm-helm[server] | ||
raise OptionalDependencyNotInstalled( | ||
f"Optional dependency {e.name} is not installed. " "Please run `pip install helm-crfm[all]` to install it." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could ask them to look at setup.cfg
to determine which optional dependencies to install rather than always defaulting to [all]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I have an idea of how to suggest which command to run, but I'll do it in the next PR.
727ea4f
to
83f1aee
Compare
If a user attempts to use a feature that requires an optional dependency, they will be prompted to run
pip install crfm-helm[all]
.Addresses #1327