diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acb62f926..cc5ec9c17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,10 @@ jobs: **/requirements*.txt - name: Install package test dependencies + # Test test will actually happened in the container, here only need to install + # the pytest-docker dependency. + # To add the dependencies to the container, we need to add them to the + # installation command in the `test_notebooks/conftest.py`. run: pip install -e .[dev] - name: Set jupyter token env @@ -133,7 +137,7 @@ jobs: **/requirements*.txt - name: Install package - run: pip install -e .[dev,smiles] + run: pip install -e .[dev,smiles,optimade] - name: Run pytest run: pytest -v tests --cov diff --git a/aiidalab_widgets_base/databases.py b/aiidalab_widgets_base/databases.py index 9b7bd149a..5ca7b41e3 100644 --- a/aiidalab_widgets_base/databases.py +++ b/aiidalab_widgets_base/databases.py @@ -156,7 +156,22 @@ def __init__( title: str = None, **kwargs, ) -> None: - from optimade_client import default_parameters, query_filter, query_provider + try: + from optimade_client import default_parameters, query_filter, query_provider + except ImportError: + super().__init__( + [ + ipw.HTML( + """ +
optimade-client
package to be installed.
+ Please run pip install optimade-client
to install the missing package.
+