Skip to content

Commit c4992c3

Browse files
icemachugovk
andauthored
Configure for readthedocs (#284)
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent 5a1a3b2 commit c4992c3

File tree

7 files changed

+84
-2
lines changed

7 files changed

+84
-2
lines changed

Diff for: .github/workflows/docs.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 12 * * 0' # run once a week on Sunday
8+
# Allows running this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
env:
12+
FORCE_COLOR: 1
13+
14+
jobs:
15+
tests:
16+
name: Docs
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python 3.13
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.13
25+
26+
- name: Get pip cache dir
27+
id: pip-cache
28+
run: |
29+
echo "::set-output name=dir::$(pip cache dir)"
30+
31+
- name: Cache
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ steps.pip-cache.outputs.dir }}
35+
key:
36+
docs-v1-${{ hashFiles('**/pyproject.toml') }}
37+
restore-keys: |
38+
docs-v1-
39+
40+
- name: Install dependencies
41+
run: |
42+
python -m pip install -U pip tox
43+
44+
- name: Docs
45+
run: |
46+
tox -e docs

Diff for: .github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
~/.cache/pip
2424
~/.cache/pre-commit
2525
key:
26-
lint-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
26+
lint-v1-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
2727
restore-keys: |
2828
lint-v1-
2929

Diff for: .github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
with:
5454
path: ${{ steps.pip-cache.outputs.dir }}
5555
key:
56-
${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pytest-version }}-v1-${{ hashFiles('**/setup.py') }}
56+
${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pytest-version }}-v1-${{ hashFiles('**/pyproject.toml') }}
5757
restore-keys: |
5858
${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pytest-version }}-v1-
5959

Diff for: .readthedocs.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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
8+
build:
9+
os: ubuntu-lts-latest
10+
tools:
11+
python: "3"
12+
13+
# Build documentation in the "docs/" directory with Sphinx
14+
sphinx:
15+
configuration: docs/conf.py
16+
17+
# We recommend specifying your dependencies to enable reproducible builds:
18+
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
19+
python:
20+
install:
21+
- requirements: docs/requirements.txt
22+
- method: pip
23+
path: .

Diff for: README.rst

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ re-runs tests to eliminate intermittent failures.
1717
.. image:: https://github.com/pytest-dev/pytest-rerunfailures/workflows/Test/badge.svg
1818
:target: https://github.com/pytest-dev/pytest-rerunfailures/actions
1919
:alt: GitHub Actions
20+
.. image:: https://readthedocs.org/projects/pytest-rerunfailures/badge/?version=latest
21+
:target: https://pytest-rerunfailures.readthedocs.io/latest/?badge=latest
22+
:alt: Documentation Status
2023

2124
.. START-INSTALLATION
2225

Diff for: docs/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Sphinx
2+
sphinx_rtd_theme

Diff for: tox.ini

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ max-line-length = 88
1212
envlist =
1313
linting
1414
py{39,310,311,312,313,py3}-pytest{74,80,81,82,83,main}
15+
docs
1516
minversion = 4.0
1617

1718
[testenv]
@@ -30,3 +31,10 @@ basepython = python3
3031
commands = pre-commit run --all-files --show-diff-on-failure {posargs:}
3132
deps = pre-commit>=1.11.0
3233
skip_install = True
34+
35+
[testenv:docs]
36+
basepython = python3
37+
skip_install = True
38+
deps = -r docs/requirements.txt
39+
commands =
40+
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html

0 commit comments

Comments
 (0)