Skip to content

Commit 69d0f4c

Browse files
authored
Merge pull request #35 from boutproject/rtd
Update RTD config
2 parents 94774cb + dadd8e2 commit 69d0f4c

3 files changed

Lines changed: 42 additions & 3 deletions

File tree

.readthedocs.yml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
18
build:
2-
image: latest
9+
os: ubuntu-24.04
10+
tools:
11+
python: "3.12"
12+
# You can also specify other tool versions:
13+
# nodejs: "20"
14+
# rust: "1.70"
15+
# golang: "1.20"
16+
17+
# Build documentation in the "docs/" directory with Sphinx
18+
sphinx:
19+
configuration: docs/source/conf.py
20+
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
21+
# builder: "dirhtml"
22+
# Fail on all warnings to avoid broken references
23+
# fail_on_warning: true
24+
25+
# Optionally build your docs in additional formats such as PDF and ePub
26+
# formats:
27+
# - pdf
28+
# - epub
329

30+
# Optional but recommended, declare the Python requirements required
31+
# to build your documentation
32+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
433
python:
5-
version: 3.6
34+
install:
35+
- requirements: docs/requirements.txt

docs/requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ ipykernel
33
nbsphinx
44
matplotlib>=2.2
55
sphinx_rtd_theme
6-
numpy
6+
numpy
7+
build
8+
setuptools_scm[toml]>=7

docs/source/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626

2727
# Find the version number
2828
_version_py = "../../animatplot/_version.py"
29+
if not os.path.exists(_version_py):
30+
import subprocess
31+
32+
subprocess.run(
33+
"python -m build ../.. --no-isolation --sdist", shell=True, check=False
34+
)
35+
2936
version_ns = {}
3037
with open(_version_py) as f:
3138
exec(f.read(), {}, version_ns)

0 commit comments

Comments
 (0)