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

Update README.md #76

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ To install all dependencies, you need python installed (>= 3.7).
If you don't have python or don't want to install it, just clone the required libraries manually.
You can extract the relevant information from the `dependencies.cfg` script.

Using the script, it's just:

To install, open a command line interface in the folder of BESMod and run:
```python
python install_dependencies.py full
```
Expand Down
8 changes: 8 additions & 0 deletions install_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
import pathlib
import json
from subprocess import check_output, STDOUT, CalledProcessError


class LibraryInstaller:
Expand Down Expand Up @@ -56,6 +57,13 @@ def install_dependencies(
for optional_dependency in optional_dependencies:
if optional_dependency not in optional_dependencies_config:
raise KeyError(f"Given dependency '{optional_dependency}' is not supported.")
if optional_dependency == "Buildings":
try:
check_output(['git', 'lfs', 'version'], stderr=STDOUT)
except CalledProcessError:
raise ModuleNotFoundError(
"The optional requirement Buildings requires git large-file-storage (git lfs).\n"
"Install it when you want to use this library.")
install_libraries[optional_dependency] = optional_dependencies_config[optional_dependency]

open_models = []
Expand Down