Skip to content

Commit

Permalink
ci: Fix optional dependancies, use in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman committed Nov 21, 2023
1 parent b1982b8 commit 5786809
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
poetry-version: 1.3.2

- name: Run poetry install
run: poetry install
run: poetry install --extras "gpytorch torchvision"

- name: Run pytest
timeout-minutes: 15
Expand Down
13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,13 @@ typing-extensions = "^4"
# jahs-bench = {git = "https://github.com/automl/jahs_bench_201.git", rev = "v1.0.2"}
mkdocs-material = "^8.1.3"
mike = "^1.1.2"
gpytorch = { version="^1.8", optional=true}
torchvision = { version="<0.16.0", optional=true}


[tool.poetry.group.experimental]
optional = true

[tool.poetry.group.experimental.dependencies]
gpytorch = "1.8.0"
torchvision = "<0.16.0" # Used in examples
# https://python-poetry.org/docs/master/pyproject/#extras
[tool.poetry.extras]
gpytorch = ["gyptorch"]
torchvision = ["torchvision"]

[build-system]
requires = ["poetry-core>=1.1.0"]
Expand Down
4 changes: 2 additions & 2 deletions src/neps/optimizers/bayesian_optimization/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
try:
from .deepGP import DeepGP
except ImportError as e:
DeepGP = MissingDependencyError(libname="neps", dep="gpytorch", install_group="experimental", cause=e)
DeepGP = MissingDependencyError(libname="neps", dep="gpytorch", install_group="gpytorch", cause=e)

try:
from .pfn import PFN_SURROGATE # only if available locally
except Exception as e:
PFN_SURROGATE = MissingDependencyError(libname="neps", dep="pfn", install_group="experimental", cause=e)
PFN_SURROGATE = MissingDependencyError(libname="neps", dep="pfn", install_group=None, cause=e)

SurrogateModelMapping = {
"deep_gp": DeepGP,
Expand Down

0 comments on commit 5786809

Please sign in to comment.