Skip to content

Commit 137a10c

Browse files
authored
Update RTD integration (#2)
* Add `LIBCARNA_PYTHON_NBSPHINX_EXECUTE` environment variable * Add docs building for testing to CI * Update RTD integration, remove doc building from CI * Update docs/conf.py * Update .readthedocs.yaml * Update .readthedocs.yaml * Update .readthedocs.yaml
1 parent 7ebf543 commit 137a10c

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

.readthedocs.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ sphinx:
1212
conda:
1313
environment: environment.yml
1414

15-
# Install doc-building dependencies
16-
python:
17-
install:
18-
- requirements: docs/requirements.txt
19-
2015
# Specify the build process
2116
build:
2217
os: ubuntu-24.04
@@ -25,4 +20,9 @@ build:
2520
jobs:
2621
install:
2722
- bash ./linux_build.bash
28-
- pip install libcarna_python-*.whl
23+
- pip install dist/libcarna_python-*.whl
24+
pre_build:
25+
- pip install -r docs/requirements.txt
26+
build:
27+
html:
28+
- LIBCARNA_PYTHON_NBSPHINX_EXECUTE=never sphinx-build -M html docs $READTHEDOCS_OUTPUT

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import sys
1818

1919
LIBCARNA_PYTHON_PATH = os.environ.get('LIBCARNA_PYTHON_PATH')
20-
sys.path.append(LIBCARNA_PYTHON_PATH)
21-
os.environ['PYTHONPATH'] = LIBCARNA_PYTHON_PATH + ':' + os.environ.get('PYTHONPATH', '')
20+
if LIBCARNA_PYTHON_PATH is not None:
21+
sys.path.append(LIBCARNA_PYTHON_PATH)
22+
os.environ['PYTHONPATH'] = LIBCARNA_PYTHON_PATH + ':' + os.environ.get('PYTHONPATH', '')
2223

23-
nbsphinx_execute = 'always'
24+
nbsphinx_execute = os.environ.get('LIBCARNA_PYTHON_NBSPHINX_EXECUTE', 'always')

0 commit comments

Comments
 (0)