Skip to content
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

Move optimade dependency as extra dependency #554

Merged
merged 7 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion aiidalab_widgets_base/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,17 @@ 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(
"This widget requires the `optimade-client` package to be installed."
)
]
)
return

providers_header = ipw.HTML("<h4>Select a provider</h4>")
providers = query_provider.OptimadeQueryProviderWidget(
Expand Down
9 changes: 5 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ install_requires =
more-itertools~=8.0
pymysql~=0.9
nglview~=3.0
optimade-client==2022.9.19
spglib>=1.14,<3
vapory~=0.1.2
python_requires = >=3.8
Expand All @@ -43,9 +42,9 @@ zip_safe = False

[options.extras_require]
dev =
bumpver==2021.1114
pgtest==1.3.1
pre-commit==2.10.1
bumpver~=2023.1129
pgtest~=1.3
pre-commit~=3.5
# NOTE: pytest-selenium currently incompatible with pytest>=7.2
# Maybe could be made to work by installing 'py' dependency, see:
# https://docs.pytest.org/en/7.4.x/changelog.html#pytest-7-2-0-2022-10-23
Expand All @@ -56,6 +55,8 @@ dev =
pytest-timeout~=2.2
selenium~=4.7.0
webdriver-manager~=3.8
optimade =
optimade-client==2022.9.19
smiles =
rdkit>=2021.09.2
scikit-learn~=1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests_notebooks/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def notebook_service(docker_ip, docker_services, aiidalab_exec):
aiidalab_exec("chmod -R a+rw /home/jovyan/apps/aiidalab-widgets-base", user="root")

# Install AWB with extra dependencies for SmilesWidget
aiidalab_exec("pip install --no-cache-dir .[smiles]")
aiidalab_exec("pip install --no-cache-dir .[smiles, optimade]")
danielhollas marked this conversation as resolved.
Show resolved Hide resolved

# `port_for` takes a container port and returns the corresponding host port
port = docker_services.port_for("aiidalab", 8888)
Expand Down
Loading