Skip to content

Commit 79fe21d

Browse files
committed
Fix issues with CI build, update README
1 parent 91ea3d1 commit 79fe21d

File tree

2 files changed

+62
-39
lines changed

2 files changed

+62
-39
lines changed

.github/workflows/ci.yaml

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
strategy:
1414
matrix:
1515
# py_backwardscompat is not included because there is also an issue with numpy compatibility on Python 3.10
16-
env_name: [py_pinned_dependencies, py_latest_dependencies] # removed py_backwardscompat
16+
env_name: [py_pinned_dependencies, py_latest_dependencies]
1717
steps:
1818
- name: Checkout Code
1919
uses: actions/checkout@v3
20+
with:
21+
lfs: true
2022

2123
- name: Setup Python
2224
uses: actions/setup-python@v4
@@ -26,27 +28,55 @@ jobs:
2628
- name: Install Dependencies
2729
run: |
2830
python -m pip install --upgrade pip
29-
if [[ "${{ matrix.env_name }}" == "py" ]]; then
30-
pip install -v -r requirements.txt -r requirements_torch.txt -r requirements_lightgbm.txt -r requirements_geoanalytics.txt -r requirements_xgboost.txt pytest pytest-cov pytest-xdist pytorch-lightning~=1.1.0;
31+
if [[ "${{ matrix.env_name }}" == "py_pinned_dependencies" ]]; then
32+
pip install -v \
33+
-r requirements.txt \
34+
-r requirements_torch.txt \
35+
-r requirements_lightgbm.txt \
36+
-r requirements_geoanalytics.txt \
37+
-r requirements_xgboost.txt \
38+
pytest \
39+
pytest-cov \
40+
pytest-xdist \
41+
pytorch-lightning~=1.1.0 \
42+
coverage \
43+
coverage-badge
3144
elif [[ "${{ matrix.env_name }}" == "py_latest_dependencies" ]]; then
32-
pip install pytest jupyter==1.0.0 nbconvert==6.5.0 clearml==0.17.1 pytorch-lightning>=1.1 ".[full]";
45+
pip install \
46+
pytest \
47+
jupyter==1.0.0 \
48+
nbconvert==6.5.0 \
49+
clearml==0.17.1 \
50+
"pytorch-lightning>=1.1" \
51+
".[full]"
3352
elif [[ "${{ matrix.env_name }}" == "py_backwardscompat" ]]; then
34-
pip install pytest scikit-learn==1.0.2 pytorch-lightning>=1.1 ".[torch]";
53+
pip install \
54+
pytest \
55+
"scikit-learn==1.0.2" \
56+
"numpy<1.21" \
57+
".[torch]"
3558
fi
3659
pip install --no-deps -e .
3760

3861
- name: Run Tests
3962
run: |
40-
if [[ "${{ matrix.env_name }}" == "py" ]]; then
63+
if [[ "${{ matrix.env_name }}" == "py_pinned_dependencies" ]]; then
4164
coverage erase
4265
pytest -n 4 --cov --cov-append --cov-report=term-missing tests;
66+
coverage html
67+
coverage-badge -o badges/coverage.svg -f
4368
elif [[ "${{ matrix.env_name }}" == "py_latest_dependencies" ]]; then
4469
pytest
45-
pytest notebooks;
4670
elif [[ "${{ matrix.env_name }}" == "py_backwardscompat" ]]; then
4771
pytest tests/backwardscompat;
4872
fi
4973

74+
- name: Run Notebook Tests
75+
run: |
76+
if [[ "${{ matrix.env_name }}" == "py_latest_dependencies" ]]; then
77+
pytest notebooks;
78+
fi
79+
5080
# Documentation build job
5181
docs:
5282
runs-on: ubuntu-latest
@@ -62,31 +92,16 @@ jobs:
6292
- name: Install Documentation Dependencies
6393
run: |
6494
python -m pip install --upgrade pip
65-
pip install sphinx==5.0.2 sphinxcontrib-websupport==1.2.4 sphinx-toolbox==3.7.0 sphinx_rtd_theme nbsphinx ipython ipywidgets jupyter-book==0.15.1
95+
pip install \
96+
sphinx==5.0.2 \
97+
sphinxcontrib-websupport==1.2.4 \
98+
sphinx-toolbox==3.7.0 \
99+
sphinx_rtd_theme \
100+
nbsphinx \
101+
ipython \
102+
ipywidgets \
103+
jupyter-book==0.15.1
66104

67105
- name: Build Documentation
68106
run: sh build-docs.sh
69107

70-
# Coverage report generation
71-
coverage:
72-
needs: test
73-
runs-on: ubuntu-latest
74-
steps:
75-
- name: Checkout Code
76-
uses: actions/checkout@v3
77-
78-
- name: Setup Python
79-
uses: actions/setup-python@v4
80-
with:
81-
python-version: "3.10"
82-
83-
- name: Install Coverage Dependencies
84-
run: |
85-
python -m pip install --upgrade pip
86-
pip install coverage coverage-badge
87-
88-
- name: Generate Coverage Report
89-
run: |
90-
coverage html
91-
coverage-badge -o badges/coverage.svg -f
92-
coverage erase

README-dev.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,32 @@ Use conda to set up the Python environment:
1818

1919
Solving the environment may take several minutes (but should ultimately work).
2020

21-
NOTE: versions are mostly unpinned in the environment specification, because this facilitates conda dependency resolution. Also, sensAI is intended to be compatible with *all* (newer) versions of the dependencies. If it isn't, we need to specify an upper version bound in `setup.py` (where it matters the most) as well as in `environment.yml`. Compatibility with old (pinned) versions and the latest versions is tested in the tox build (see below).
21+
NOTE: versions are mostly unpinned in the environment specification, because this facilitates conda dependency resolution.
22+
Also, sensAI is intended to be compatible with *all* (newer) versions of the dependencies.
23+
If it isn't, we need to specify an upper version bound in `setup.py` (where it matters the most) as well as in `environment.yml`.
24+
Compatibility with old (pinned) versions and the latest versions is tested in the GitHub build (see below).
2225

2326
# Build and Test Pipeline
2427

25-
The tests and docs build are executed via **tox** in several environments:
26-
* `py`: the "regular" test environment, where we test against the pinned dependencies (by explicitly including `requirements.txt` with the pinned versions; this is also the environment in which we test the execution of notebooks
27-
* `py_latest_dependencies`: the environment where we use the latest versions of all dependencies (except where we have identified an incompatibility; see `setup.py` definitions `DEPS_VERSION_LOWER_BOUND` and `DEPS_VERSION_UPPER_BOUND_EXCLUSIVE`); by not including `requirements.txt`, we depend on the latest admissible versions according to `setup.py`
28-
* `docs`: the environment in which docs are built via sphinx
28+
The tests and docs build are executed in several environments:
29+
* `py_pinned_dependencies`: the "regular" test environment, where we test against the pinned dependencies
30+
(by explicitly including `requirements.txt` with the pinned versions; this is also the environment in which we test the
31+
execution of notebooks
32+
* `py_latest_dependencies`: the environment where we use the latest versions of all dependencies (except where we have
33+
identified an incompatibility; see `setup.py` definitions `DEPS_VERSION_LOWER_BOUND` and `DEPS_VERSION_UPPER_BOUND_EXCLUSIVE`);
34+
by not including `requirements.txt`, we depend on the latest admissible versions according to `setup.py`
35+
* `py_backwardscompa`: a special environment with old versions of some critical dependences where we can test backwards compatibility
36+
with persisted models of very old sensAI versions (that used older versions of the dependencies, e.g. sklearn)
2937

3038
## Automated Tests
3139

32-
The tests can be locally run without tox via
40+
The tests can be locally via
3341

3442
sh run_pytest_tests.sh
3543

3644
## Docs Build
3745

38-
Docs are automatically created during the GitHub build via tox.
46+
Docs are automatically created during the GitHub build.
3947

4048
All .rst files are auto-generated (by `build_scripts/update_docs.py`), with the exception of the root index file `index.rst`.
4149

@@ -56,7 +64,7 @@ For changes in notebooks to be reflected in the docs build, the test needs to be
5664

5765
### Manually Running the Docs Build
5866

59-
The docs build can be run without tox via
67+
The docs build can be run via
6068

6169
sh build-docs.sh
6270

0 commit comments

Comments
 (0)