Skip to content

Commit

Permalink
Build docs on 3.11 & dedup
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Apr 16, 2023
1 parent c8dc77e commit 74c4fd1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ jobs:
workflow-artifact-name: ${{ env.sdist-artifact }}
- uses: actions/setup-python@v4
with:
# Keep in sync with noxfile.py/docs & .readthedocs.yaml
python-version: "3.10"
# Keep in sync with .readthedocs.yaml
python-version: "3.11"
- run: python -Im pip install --upgrade wheel nox

- run: python -Im nox -e docs
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version: 2
build:
os: ubuntu-20.04
tools:
# Keep in sync with noxfile.py/tests_oldestAttrs & ci.yml/docs
python: "3.10"
# Keep in sync with ci.yml/docs
python: "3.11"

python:
install:
Expand Down
14 changes: 12 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from __future__ import annotations

import os
import re

from pathlib import Path

import nox

Expand All @@ -9,6 +12,14 @@
nox.options.error_on_external_run = True


MATCH_PYTHON = re.compile(r"\s+python\: \"(\d\.\d\d)\"").match
# Avoid dependency on a YAML lib using a questionable hack.
for line in Path(".readthedocs.yaml").read_text().splitlines():
if m := MATCH_PYTHON(line):
DOCS_PYTHON = m.group(1)
break


@nox.session
def pre_commit(session: nox.Session) -> None:
session.install("pre-commit")
Expand Down Expand Up @@ -60,8 +71,7 @@ def mypy(session: nox.Session) -> None:
session.run("mypy", "typing_examples.py")


# Keep python in sync with ci.yml/docs and .readthedocs.yaml.
@nox.session(python="3.10")
@nox.session(python=DOCS_PYTHON)
def docs(session: nox.Session) -> None:
session.install(".[docs]")

Expand Down

0 comments on commit 74c4fd1

Please sign in to comment.