Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:

- name: Set up poetry
uses: Gr1N/setup-poetry@v9
with:
poetry-version: "2.1.1"

- name: Configure poetry
run: poetry config virtualenvs.in-project true
Expand Down
7 changes: 4 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ sphinx:
formats: all

build:
os: ubuntu-20.04
os: ubuntu-24.04
tools:
python: "3.10"
jobs:
post_create_environment:
- pip install poetry
- pip install "poetry==2.1.1"
- poetry config virtualenvs.create false
post_install:
- poetry install --with docs
- poetry install --with docs --no-interaction --no-ansi
- python -m pip install --no-cache-dir "sphinx-immaterial>=0.11,<0.14"
23 changes: 21 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
import openapi_schema_validator
import re
import sys
from pathlib import Path

ROOT_DIR = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT_DIR))


def _read_project_version() -> str:
pyproject_path = ROOT_DIR / "pyproject.toml"
pyproject_content = pyproject_path.read_text(encoding="utf-8")
match = re.search(
r"\[tool\.poetry\][\s\S]*?^version\s*=\s*\"([^\"]+)\"",
pyproject_content,
re.MULTILINE,
)
if match is None:
return "unknown"
return match.group(1)


project = "openapi-schema-validator"
copyright = "2023, Artur Maciag"
author = "Artur Maciag"

release = openapi_schema_validator.__version__
release = _read_project_version()

extensions = [
"sphinx.ext.autodoc",
Expand Down
Loading