Skip to content

Commit b3fcf86

Browse files
authored
Merge pull request #1497 from Lightning-Sandbox/ci/docs
resolving method resolution order (MRO) to fix docs build
2 parents b913d13 + 113d43f commit b3fcf86

File tree

4 files changed

+27
-39
lines changed

4 files changed

+27
-39
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ on:
1010
branches: [master]
1111

1212
jobs:
13-
build:
13+
pytest:
14+
name: Run pytest
1415
runs-on: ${{ matrix.os }}
1516
strategy:
1617
matrix:
1718
os: [ubuntu-latest, macOS-latest] # add windows-2019 when poetry allows installation with `-f` flag
1819
python-version: ["3.8", "3.9", "3.10"]
19-
20+
defaults:
21+
run:
22+
shell: bash
2023
steps:
2124
- uses: actions/checkout@v2
2225

@@ -30,26 +33,18 @@ jobs:
3033
run: |
3134
brew install libomp # https://github.com/pytorch/pytorch/issues/20030
3235
33-
- name: Setup macOS
34-
if: runner.os == 'windows'
35-
run: |
36-
brew install libomp # https://github.com/pytorch/pytorch/issues/20030
37-
3836
- name: Get full Python version
3937
id: full-python-version
40-
shell: bash
4138
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
4239

4340
- name: Install poetry
44-
shell: bash
4541
run: |
4642
curl -sSL https://install.python-poetry.org | python3 -
4743
4844
- name: Set poetry path variable
4945
run: echo "/Users/runner/.local/bin" >> $GITHUB_PATH
5046

5147
- name: Configure poetry
52-
shell: bash
5348
run: poetry config virtualenvs.in-project true
5449

5550
- name: Set up cache
@@ -61,27 +56,22 @@ jobs:
6156

6257
- name: Ensure cache is healthy
6358
if: steps.cache.outputs.cache-hit == 'true'
64-
shell: bash
6559
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
6660

6761
- name: Upgrade pip
68-
shell: bash
6962
run: poetry run python -m pip install pip -U
7063

7164
- name: Install dependencies
72-
shell: bash
7365
run: poetry install -E "github-actions graph mqf2"
7466

7567
# - name: Install pytorch geometric dependencies
7668
# shell: bash
7769
# run: poetry run pip install pyg_lib torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-2.0.0+cpu.html
7870

7971
- name: Run pytest
80-
shell: bash
8172
run: poetry run pytest tests
8273

8374
- name: Statistics
84-
if: success()
8575
run: |
8676
pip install coverage
8777
coverage report
@@ -99,9 +89,11 @@ jobs:
9989
fail_ci_if_error: false
10090

10191
docs:
102-
name: Test docs build
92+
name: Docs build
10393
runs-on: ubuntu-latest
104-
94+
defaults:
95+
run:
96+
shell: bash
10597
steps:
10698
- name: Check out Git repository
10799
uses: actions/checkout@v2
@@ -116,26 +108,22 @@ jobs:
116108
with:
117109
path: ~/.cache/pip
118110
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
119-
restore-keys: |
120-
${{ runner.os }}-pip-
111+
restore-keys: ${{ runner.os }}-pip-
121112

122113
- name: Install dependencies
123114
run: |
124-
sudo apt-get update && sudo apt-get install -y pandoc
125-
python -m pip install --upgrade pip
115+
sudo apt-get update --fix-missing
116+
sudo apt-get install -y pandoc
126117
pip install -r docs/requirements.txt
127-
shell: bash
128118
129119
- name: Build sphinx documentation
130-
run: |
131-
cd docs
132-
make clean
133-
make html --debug --jobs 2 SPHINXOPTS="-W"
120+
working-directory: docs/
121+
run: make html --debug --jobs 2 SPHINXOPTS="-W"
134122

135123
- name: Upload built docs
136124
uses: actions/upload-artifact@v2
137125
with:
138126
name: docs-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}
139127
path: docs/build/html/
140128
# Use always() to always run this step to publish test results when there are test failures
141-
if: success()
129+
#if: success()

docs/requirements.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
sphinx>3.2
1+
sphinx >3.2
22
nbsphinx
33
pandoc
44
docutils
55
pydata-sphinx-theme
6-
lightning>=2.0.0
6+
lightning >=2.0.0
77
cloudpickle
8-
torch>=2.0,!=2.0.1
9-
optuna>=3.1.0
8+
torch >=2.0,!=2.0.1
9+
optuna >=3.1.0
1010
scipy
11-
pandas>=1.3
12-
scikit-learn>1.2
11+
pandas >=1.3
12+
scikit-learn >1.2
1313
matplotlib
1414
statsmodels
1515
ipython
16-
nbconvert>=6.3.0
17-
recommonmark>=0.7.1
18-
pytorch-optimizer>=2.5.1
19-
fastapi>0.80
16+
nbconvert >=6.3.0
17+
recommonmark >=0.7.1
18+
pytorch-optimizer >=2.5.1
19+
fastapi >0.80

docs/source/tutorials/stallion.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@
978978
" dropout=0.1, # between 0.1 and 0.3 are good values\n",
979979
" hidden_continuous_size=8, # set to <= hidden_size\n",
980980
" loss=QuantileLoss(),\n",
981-
" optimizer=\"Ranger\"\n",
981+
" optimizer=\"Ranger\",\n",
982982
" # reduce learning rate if no improvement in validation loss after x epochs\n",
983983
" # reduce_on_plateau_patience=1000,\n",
984984
")\n",

pytorch_forecasting/models/temporal_fusion_transformer/tuning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
# need to inherit from callback for this to work
29-
class PyTorchLightningPruningCallbackAdjusted(pl.Callback, PyTorchLightningPruningCallback):
29+
class PyTorchLightningPruningCallbackAdjusted(PyTorchLightningPruningCallback, pl.Callback):
3030
pass
3131

3232

0 commit comments

Comments
 (0)