Skip to content

Commit

Permalink
update README + setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rizac committed May 15, 2024
1 parent 7602511 commit 8dddfe3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,31 +204,30 @@ source .env/<ENVNAME>/bin/activate
pip install --upgrade pip setuptools
```

**Disclaimer: OpenQuake is not always backward compatible**.

- To upgrade eGSIM without upgrading OpenQuake (more common scenario):
```console
pip install -e . && pip freeze >./requirements.lib.txt && pip install pytest
```
- Otherwise, to upgrade eGSIM and OpenQuake (this operation should be done
only in very specific cases, e.g. a big code refactoring or critical bug fixes):
Open `setup.py` and **comment** the item of `install_requires` where OpenQuake
is installed (should be starting with `openquake.engine`). Then:
```console
pip install -r "https://raw.githubusercontent.com/gem/oq-engine/master/requirements-py311-macos_x86_64.txt"
# pip install -r "https://raw.githubusercontent.com/gem/oq-engine/master/requirements-py311-linux64.txt"
pip install -Ue . && pip freeze >./requirements.lib.txt && pip install pytest
```
(`pip install openquake` works but is not the recommended way)
Upgrade OpenQuake (**optional**). The operation below should be performed in
very specific cases only (important bugfixes or features) because
**being OpenQuake often backward incompatible** it might require additional
code fixes and feedbacks from scientific experts or OpenQuake developers.
First, **open `setup.py` and comment the line of `install_requires` where OpenQuake
is installed** (should be starting with `openquake.engine`). Then
(`pip install openquake` works but is not the recommended way):
```console
pip install -r "https://raw.githubusercontent.com/gem/oq-engine/master/requirements-py311-macos_x86_64.txt"
# pip install -r "https://raw.githubusercontent.com/gem/oq-engine/master/requirements-py311-linux64.txt"
```


Check that tests are running:
Install eGSIM Python library, upgrading its dependencies:
```console
pip install -Ue . && pip freeze >./requirements.lib.txt && pip install pytest
```

Run tests:
```console
pytest -vvv ./tests/smtk
```

install eGSIM web app:
Install eGSIM web app, upgrading its dependencies:
```console
pip install -U --upgrade-strategy eager ".[web]"
pip freeze > ./requirements.txt
Expand All @@ -239,10 +238,11 @@ Run tests:
export DJANGO_SETTINGS_MODULE=egsim.settings_debug; pytest -xvvv ./tests/
```

Change `setup.py` and set the current OpenQuake version in
`install_requires` (uncomment it if commented). Optionally,
remove egsim from requirements.txt (it might interfere with Django web?*).

Change `setup.py` and set the current OpenQuake version (*optional:
remove egsim from requirements.txt (it might interfere with Django web?*),
eventually **commit and push**
Eventually, **commit and push**


# Django
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# Minimal requirements for the library (egsim.smtk package).
# FOR DEV/TESTS, add: `pip install pytest`
install_requires=[
'openquake.engine>3.5.0,<=3.15.0',
'openquake.engine==3.15.0', # 1st tested version was >3.5.0
'pyyaml>=6.0',
'tables>=3.8.0',
],
Expand Down

0 comments on commit 8dddfe3

Please sign in to comment.