-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Improve dependency management #1994
Conversation
@tholor I have plenty of testing to do still, but this branch is already working on Python3.9 on Linux, so feel free to try it out and let me know if you encounter errors. The dependency groups are also just stubs, there are a lot of dependencies that I'm not quite sure about, so if you already see something out of place let me know and I'll move them 🙂 |
…try-catch statements on rest_api and ui imports
Example of workflow for document stores: $ pip install .
... pip logs ...
$ python
>>> import haystack
>>> from haystack.document_stores import FAISSDocumentStore
>>> e = FAISSDocumentStore()
Traceback (most recent call last):
File "/home/sara/work/haystack/haystack/utils/import_utils.py", line 28, in safe_import
module = importlib.import_module(import_path)
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/sara/work/haystack/haystack/document_stores/faiss.py", line 13, in <module>
import faiss
ModuleNotFoundError: No module named 'faiss'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sara/work/haystack/haystack/utils/import_utils.py", line 42, in __init__
raise ImportError(f"Failed to import {classname}. "
ImportError: Failed to import FAISSDocumentStore. Run 'pip install farm-haystack[faiss] to install them.'
>>>
$ pip install .[faiss]
... pip logs ...
$ python
>>> import haystack
>>> from haystack.document_stores import FAISSDocumentStore
>>> e = FAISSDocumentStore()
>>> For other optional modules like $ pip install .
... pip logs ...
$ python
>>> import rest_api.application
Traceback (most recent call last):
File "/home/sara/work/haystack/rest_api/application.py", line 10, in <module>
import uvicorn
ModuleNotFoundError: No module named 'uvicorn'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sara/work/haystack/rest_api/application.py", line 20, in <module>
raise ImportError("Failed to import the REST API due to missing dependencies. Run 'pip install farm-haystack[rest]' to install them.") from ie
ImportError: Failed to import the REST API due to missing dependencies. Run 'pip install farm-haystack[rest]' to install them.
>>>
$ pip install .[rest]
... pip logs ...
$ python
>>> import rest_api.application
>>> |
…ck into try_out_pyproject_toml
…ck into try_out_pyproject_toml
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
…ck into try_out_pyproject_toml
…ck into try_out_pyproject_toml
…ck into try_out_pyproject_toml
…ck into try_out_pyproject_toml
Improve dependecy management by introducing
extras_require
and migrating tosetup.cfg
andpyproject.toml
.Related to #1979