Skip to content

Commit a5bb988

Browse files
committed
Update ReadTheDocs config
1 parent 696620d commit a5bb988

File tree

6 files changed

+53
-46
lines changed

6 files changed

+53
-46
lines changed

.github/workflows/pysplashsurf_CI.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,20 @@ jobs:
380380
runs-on: ubuntu-latest
381381
steps:
382382
- uses: actions/checkout@v4
383-
- uses: actions/setup-python@v5
383+
- uses: mamba-org/setup-micromamba@v2
384384
with:
385-
python-version: 3.x
385+
environment-file: pysplashsurf/python_environment.yaml
386+
init-shell: bash
387+
cache-environment: true
388+
post-cleanup: 'all'
386389
- name: Download wheel
387390
uses: actions/download-artifact@v4
388391
with:
389392
name: doc_tests_wheel
390393
path: dist/
391394
- name: Append output to file
392395
run: |
396+
which python
393397
echo "./dist/${{ needs.build_wheel_dev.outputs.filename }}" >> pysplashsurf/pysplashsurf/docs/requirements.txt
394398
- uses: ammaraskar/[email protected]
395399
with:

pysplashsurf/.readthedocs.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@
55
version: 2
66

77
build:
8-
os: ubuntu-22.04
8+
os: ubuntu-24.04
99
tools:
10-
python: "3.12"
10+
python: "mambaforge-23.11"
11+
jobs:
12+
pre_build:
13+
- asdf install rust 1.89.0
14+
- asdf global rust 1.89.0
15+
- py=$(which python) && base="${py%python}" && export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${base}../lib" && cd pysplashsurf && cargo run --bin stub_gen --no-default-features
16+
- cd pysplashsurf && maturin build
17+
- ls pysplashsurf/pysplashsurf
18+
- pip install target/wheels/*.whl
1119

1220
sphinx:
1321
configuration: pysplashsurf/pysplashsurf/docs/source/conf.py
1422

15-
python:
16-
install:
17-
- requirements: pysplashsurf/pysplashsurf/docs/requirements.txt
23+
conda:
24+
environment: pysplashsurf/python_environment.yaml

pysplashsurf/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
2-
// Required to run cargo check or stub gen outside of maturing build
2+
// Required to run cargo check or stub gen outside maturin build
33
if std::env::var_os("CARGO_CFG_TARGET_OS=macos").is_some() {
44
pyo3_build_config::get()
55
.lib_dir

pysplashsurf/pysplashsurf/docs/requirements.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

pysplashsurf/pysplashsurf/docs/source/conf.py

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,29 @@
66

77
# -- Path setup --------------------------------------------------------------
88

9-
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
13-
14-
159
import os
1610
import sys
1711

1812
from sphinx.ext.autodoc.importer import import_module
19-
print(f"### Appended path: {os.path.abspath('../../')}")
20-
sys.path.insert(0, os.path.abspath('../../'))
21-
pysplashsurf = import_module('pysplashsurf')
13+
14+
# Verify that the generated stub file exists
15+
stub_path = os.path.abspath("../../pysplashsurf.pyi")
16+
if not os.path.exists(stub_path):
17+
print(f"### Error: Stub file not found at {stub_path}. Please ensure stub_gen produced pysplashsurf.pyi.")
18+
sys.exit(1)
19+
20+
# Import the stub file
21+
print(f"### Prepend to path: {os.path.abspath('../../')}")
22+
sys.path.insert(0, os.path.abspath("../../"))
23+
pysplashsurf = import_module("pysplashsurf")
2224

2325
#import pysplashsurf
2426

2527
# -- Project information -----------------------------------------------------
2628

27-
project = 'pySplashsurf'
28-
copyright = '2025, Interactive Computer Graphics'
29-
author = 'Interactive Computer Graphics'
29+
project = "pySplashsurf"
30+
copyright = "2025, Interactive Computer Graphics"
31+
author = "Interactive Computer Graphics"
3032

3133

3234
# -- General configuration ---------------------------------------------------
@@ -35,21 +37,21 @@
3537
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3638
# ones.
3739
extensions = [
38-
'sphinx.ext.autodoc',
39-
'sphinx.ext.autosummary',
40-
'sphinx.ext.napoleon',
41-
'numpydoc',
42-
'myst_parser',
43-
'sphinx_rtd_theme',
44-
#'sphinx_autodoc_typehints'
40+
"sphinx.ext.autodoc",
41+
"sphinx.ext.autosummary",
42+
"sphinx.ext.napoleon",
43+
"numpydoc",
44+
"myst_parser",
45+
"sphinx_rtd_theme",
46+
#'sphinx_autodoc_typehints'
4547
]
4648

47-
source_suffix = ['.rst', '.md']
49+
source_suffix = [".rst", ".md"]
4850

4951
numpydoc_class_members_toctree = False
5052

5153
# Add any paths that contain templates here, relative to this directory.
52-
templates_path = ['_templates']
54+
templates_path = ["_templates"]
5355

5456
# List of patterns, relative to source directory, that match files and
5557
# directories to ignore when looking for source files.
@@ -62,7 +64,7 @@
6264
# The theme to use for HTML and HTML Help pages. See the documentation for
6365
# a list of builtin themes.
6466
#
65-
html_theme = 'sphinx_rtd_theme'
67+
html_theme = "sphinx_rtd_theme"
6668

6769
# Add any paths that contain custom static files (such as style sheets) here,
6870
# relative to this directory. They are copied after the builtin static files,
@@ -73,7 +75,7 @@
7375

7476
always_document_param_types = True
7577
always_use_bars_union = True
76-
#typehints_document_rtype = False
77-
#typehints_use_rtype = False
78-
#typehints_use_signature = True
79-
#typehints_use_signature_return = True
78+
# typehints_document_rtype = False
79+
# typehints_use_rtype = False
80+
# typehints_use_signature = True
81+
# typehints_use_signature_return = True

pysplashsurf/python_environment.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@ channels:
66
- conda-forge
77
dependencies:
88
- maturin=1.8.2
9+
- patchelf=0.17.2
910
- meshio=5.3.5
1011
- numpy=2.2.3
1112
- pip=25.0.1
1213
- python=3.13.2
1314
- python_abi=3.13
14-
- sphinx=8.2.3
1515
- numpydoc=1.8.0
1616
- trimesh=4.6.5
1717
- rtree=1.4.0
1818
- scipy=1.15.2
19-
- sphinx_rtd_theme=3.0.1
20-
- myst-parser=4.0.1
2119
- pytest=8.3.5
2220
- pytest-md=0.2.0
21+
- sphinx=8.2.3
22+
- sphinx_rtd_theme=3.0.1
23+
- myst-parser=4.0.1
24+
- numpydoc==1.8.0
25+
- sphinx-autodoc-typehints==3.2.0

0 commit comments

Comments
 (0)