Skip to content

Commit 964b20d

Browse files
authored
Add "examples" variant for pip installation including dependencies needed for examples, mention in README, and use in .binder/requirements.txt file. Closes #305 (#402)
1 parent bbe0226 commit 964b20d

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.github/workflows/tests+pypi.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,13 @@ jobs:
202202
python -m pytest --durations=10 -v -s -We -p no:unraisableexception .
203203
cd ..
204204
205+
- env:
206+
SYSTEM_VERSION_COMPAT: 0
207+
run: |
208+
for i in dist/*.whl; do python -m pip install $PIP_INSTALL_OPTS $i[examples]; done;
209+
205210
- run: |
206211
python -m pip install $PIP_INSTALL_OPTS -r gitmodules/devops_tests/requirements.txt
207-
ex -sc 'g/^PyPartMC/d' -cx .binder/requirements.txt
208-
python -m pip install $PIP_INSTALL_OPTS -r .binder/requirements.txt
209212
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} python -m pytest --durations=10 -v -s -We -p no:unraisableexception gitmodules/devops_tests
210213
211214
## uncomment to gain ssh access in case of failure

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ flowchart TD
6161
```sh
6262
git clone --recursive git+https://github.com/open-atmos/PyPartMC.git
6363
cd PyPartMC
64-
DEBUG=1 VERBOSE=1 pip --verbose install -e .
64+
DEBUG=1 VERBOSE=1 pip --verbose install -e .[tests]
6565
gdb python
6666
(gdb) run -m pytest -s -vv -We -p no:unraisableexception tests
6767
```

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ import PyPartMC
5959
#### Jupyter notebooks with examples
6060
Note: clicking the badges below redirects to cloud-computing platforms. The mybinder.org links allow anonymous execution, Google Colab requires logging in with a Google account, ARM JupyerHub requires logging in with an ARM account (and directing Jupyter to a particular notebook within the `examples` folder).
6161

62+
The example notebooks feature additional dependencies that can be installed with:
63+
```bash
64+
pip install PyPartMC[examples]
65+
```
66+
6267
- Urban plume scenario demo (as in [PartMC](https://github.com/compdyn/partmc/tree/master/scenarios/1_urban_plume)):
6368
[![View notebook](https://img.shields.io/static/v1?label=render%20on&logo=github&color=87ce3e&message=GitHub)](https://github.com/open-atmos/PyPartMC/blob/main/examples/particle_simulation.ipynb)
6469
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyPartMC/blob/main/examples/particle_simulation.ipynb)

setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ def build_extension(self, ext): # pylint: disable=too-many-branches
153153
"fastcore!=1.5.8", # https://github.com/fastai/fastcore/issues/439
154154
"ghapi",
155155
"scipy",
156-
]
156+
],
157+
"examples": [
158+
"matplotlib!=3.10.0",
159+
"ipywidgets",
160+
"voila",
161+
"open-atmos-jupyter-utils",
162+
"PySDM",
163+
"PyMieScatt@git+https://github.com/bsumlin/PyMieScatt.git",
164+
"SciPy",
165+
],
157166
},
158167
)

0 commit comments

Comments
 (0)