Skip to content

Commit

Permalink
Move habitat dependencies (#4)
Browse files Browse the repository at this point in the history
Instead of commenting out the habitat dependencies, I moved them to a
different group such that they can be installed via a `pip install -e
.[habitat]`. This should also fix the `import cv2` error in one of the
tests. I didn't touch the pre-commit error.

---------

Co-authored-by: Naoki Yokoyama <[email protected]>
Co-authored-by: Naoki Yokoyama <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2023
1 parent 01ae4e3 commit 3f72c6c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- name: Install package
run: |
sudo apt-get install -y libgl1-mesa-dev
pip install -e .[habitat]
pip install -e .[dev]
- name: Pytest
run: |
Expand Down
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"torch >= 1.13.1",
# "habitat-sim @ git+https://github.com/facebookresearch/habitat-sim.git",
# "habitat-baselines >= 0.2.4",
# "habitat-lab",
"frontier_exploration @ git+https://github.com/naokiyokoyama/frontier_exploration.git",
"transformers == 4.28.0", # higher versions break BLIP-2
"flask >= 2.3.2",
"gym >= 0.26.2"
"gym >=0.22.0,<0.23.1"
]

[project.optional-dependencies]
dev = [
"pre-commit>=3.1.1",
"pytest>=7.2.1",
"pytest-cov>=4.0.0",
"pre-commit >= 3.1.1",
"pytest >= 7.2.1",
"pytest-cov >= 4.0.0",
]
habitat = [
"habitat-sim @ git+https://github.com/facebookresearch/[email protected]",
"habitat-baselines == 0.2.420230405",
"habitat-lab == 0.2.420230405",
]

[project.urls]
Expand Down
15 changes: 8 additions & 7 deletions zsos/run.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import hydra
from habitat import get_config # noqa: F401
import hydra # noqa
from habitat.config import read_write
from habitat.config.default import patch_config
from habitat_baselines.run import execute_exp
from omegaconf import DictConfig

# The following imports require habitat to be installed, and will register several
# classes and make them discoverable by Hydra. This run.py script is expected
# to only be used when habitat is installed, thus they are hidden here instead of in an
# __init__.py file. noqa is used to suppress the unused import warning by ruff.
import frontier_exploration # noqa: F401
# The following imports require habitat to be installed, and despite not being used by
# this script itself, will register several classes and make them discoverable by Hydra.
# This run.py script is expected to only be used when habitat is installed, thus they
# are hidden here instead of in an __init__.py file. noqa is used to suppress the unused
# import and unsorted import warnings by ruff.
import frontier_exploration # noqa
from habitat import get_config # noqa
import zsos.obs_transformers.resize # noqa: F401
from zsos.policy import base_policy, itm_policy, llm_policy # noqa: F401

Expand Down

0 comments on commit 3f72c6c

Please sign in to comment.