Skip to content

Commit

Permalink
[doc] Use Python 3.12 to create documentation
Browse files Browse the repository at this point in the history
- run rstcheck, sphinx tests and sphinx doc creation with Python 3.12
- use tomllib library shipped with Pythin 3.11+ instead of tomli package
- update sphinx requirements

Change-Id: Ic58ad749adf05da1af6495ff8d3d82b6ec55f643
  • Loading branch information
xqt committed Aug 8, 2024
1 parent 8df1846 commit f9cf041
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
7 changes: 3 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
import os
import re
import sys
import tomllib
import warnings
from pathlib import Path

import tomli


# Deprecated classes will generate warnings as Sphinx processes them.
# Ignoring them.
Expand All @@ -46,7 +45,7 @@

# If your documentation needs a minimal Sphinx version, state it here.
#
needs_sphinx = '7.3.7'
needs_sphinx = '8.0.2'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down Expand Up @@ -83,7 +82,7 @@
# General information about the project.
filepath = Path().absolute().parent / 'pyproject.toml'
with open(filepath, 'rb') as f:
meta_data = tomli.load(f)
meta_data = tomllib.load(f)

project = meta_data['project']['name'].title()
project_copyright = pywikibot.__copyright__ # alias since Python 3.5
Expand Down
9 changes: 4 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# This is a PIP requirements file for building Sphinx documentation of Pywikibot
# ../requirements.txt is also needed.
# Note: Python 3.9 is required for sphinx 7.2
sphinx >= 7.3.7
rstcheck >=6.2.1
sphinx >= 8.0.2
rstcheck >=6.2.4
sphinxext-opengraph >= 0.9.1
sphinx-copybutton >= 0.5.2
sphinx-notfound-page >= 1.0.0
furo >= 2024.4.27
tomli
sphinx-notfound-page >= 1.0.4
furo >= 2024.8.6
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ deps =
commands = {posargs}

[testenv:doc]
basepython = python3.9
basepython = python3.12
commands =
sphinx-build -M html ./docs ./docs/_build -j auto
deps =
-rrequirements.txt
-rdocs/requirements.txt

[testenv:rstcheck]
basepython = python3.9
basepython = python3.12
commands =
rstcheck --version
rstcheck -r --report-level WARNING --ignore-roles api,phab,source .
Expand All @@ -110,7 +110,7 @@ deps =
-rdocs/requirements.txt

[testenv:sphinx]
basepython = python3.9
basepython = python3.12
commands =
sphinx-build -M html ./docs ./docs/_build -j auto -D html_theme=nature
deps =
Expand Down

0 comments on commit f9cf041

Please sign in to comment.