Skip to content

Commit d8383d7

Browse files
committed
add readthedocs config and project urls
1 parent 3866eaf commit d8383d7

File tree

8 files changed

+73
-6
lines changed

8 files changed

+73
-6
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ jobs:
3232

3333
# Generate Swagger UI docs
3434
- name: Fetch Swagger UI
35-
run: wget https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${SWAGGER_UI_RELEASE}.tar.gz
36-
- name: Extract Swagger UI
37-
run: tar xf v${SWAGGER_UI_RELEASE}.tar.gz -C docs/_static/ --strip=1 swagger-ui-${SWAGGER_UI_RELEASE}/dist/ --transform s/dist/swagger-ui/
35+
run: ./fetch_swagger.sh
3836
- name: Generate schema
3937
run: uv run generate-schema.py
4038

.readthedocs.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
3+
# Read the Docs configuration file
4+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
5+
6+
# Required
7+
version: 2
8+
9+
# Set the OS, Python version, and other tools you might need
10+
build:
11+
os: ubuntu-24.04
12+
tools:
13+
python: "3.13"
14+
jobs:
15+
post_checkout:
16+
- git fetch --unshallow || true
17+
- git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' || true
18+
- git fetch --all --tags || true
19+
create_environment:
20+
- asdf plugin add uv
21+
- asdf install uv 0.9.2
22+
- asdf global uv 0.9.2
23+
install:
24+
- uv sync
25+
pre_build:
26+
- ./fetch_swagger.sh
27+
- uv run generate-schema.py
28+
build:
29+
html:
30+
- uv run sphinx-build -T -b html docs/ $READTHEDOCS_OUTPUT/html
31+
32+
# Build documentation in the "docs/" directory with Sphinx
33+
sphinx:
34+
configuration: docs/conf.py
35+
36+
# Optionally, but recommended,
37+
# declare the Python requirements required to build your documentation
38+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
39+
# python:
40+
# install:
41+
# - requirements: docs/requirements.txt
42+
43+
44+

docs/changelog.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#########
2+
ChangeLog
3+
#########
4+
5+
***********
6+
0.1.0 (TBR)
7+
***********
8+
9+
Initial version.

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ documentation for details.
1818
/quickstart
1919
/how-tos
2020
/reference
21+
/changelog
2122
/dev
2223

fetch_swagger.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash -ex
2+
3+
SWAGGER_UI_RELEASE=5.30.3
4+
5+
wget https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${SWAGGER_UI_RELEASE}.tar.gz
6+
tar xf v${SWAGGER_UI_RELEASE}.tar.gz -C docs/_static/ --strip=1 swagger-ui-${SWAGGER_UI_RELEASE}/dist/ --transform s/dist/swagger-ui/

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ dynamic = ["version"]
3737
[project.scripts]
3838
structured-tutorial = "structured_tutorials.cli:main"
3939

40+
[project.urls]
41+
Homepage = "https://github.com/mathiasertl/django-ca/"
42+
Documentation = "https://django-ca.readthedocs.io/"
43+
Source = "https://github.com/mathiasertl/structured-tutorials"
44+
Issues = "https://github.com/mathiasertl/structured-tutorials/issues"
45+
Changelog = "https://django-ca.readthedocs.io/en/latest/changelog.html"
46+
4047
[tool.coverage.run]
4148
source = [
4249
"structured_tutorials",

structured_tutorials/output.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import logging
77
import logging.config
8+
import os
89
import sys
910
from typing import Any, ClassVar, Literal
1011

tests/test_cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
"""Test the cli entry point function."""
55

6+
from collections.abc import Iterator
67
from pathlib import Path
78
from unittest.mock import patch
89

@@ -13,10 +14,10 @@
1314

1415

1516
@pytest.fixture(autouse=True)
16-
def mock_setup_logging() -> None:
17+
def mock_setup_logging() -> Iterator[None]:
1718
"""Fixture to mock logging setup - so that it is not called multiple times."""
18-
with patch("structured_tutorials.cli.setup_logging"):
19-
return
19+
with patch("structured_tutorials.cli.setup_logging", autospec=True):
20+
yield
2021

2122

2223
def test_simple_tutorial(simple_tutorial: TutorialModel) -> None:

0 commit comments

Comments
 (0)