Skip to content

Commit

Permalink
Require Python 3.10 or later to build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Oct 1, 2024
1 parent 8172d8d commit 608a67a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 29 deletions.
10 changes: 4 additions & 6 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,29 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.12"
jobs:
post_checkout:
# RTD defaults to a depth of 50 but Briefcase versioning may require
# much more git history to accurately determine the SCM version
# RTD defaults to a depth of 50 but qbittorrent-api versioning may require
# much more Git history to accurately determine the SCM version
- git fetch --unshallow
pre_build:
- tox -e docs-lint

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: true

# Also build the docs in to a PDF
formats:
- pdf

# Declare the Python requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- dev
- docs
16 changes: 9 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,20 @@ dev = [
"pre-commit <3.6.0 ; python_version < '3.9'",
"pre-commit ==3.8.0 ; python_version >= '3.9'",
"pytest ==8.3.3",
"sphinx ==8.0.2; python_version >= '3.10'",
"sphinx-autobuild ==2024.9.19 ; python_version >= '3.9'",
"sphinx-copybutton ==0.5.2",
"sphinxcontrib-spelling ==8.0.0",
"sphinx-autodoc-typehints <2.1.0 ; python_version < '3.9'",
"sphinx-autodoc-typehints ==2.4.4 ; python_version >= '3.9'",
"tox ==4.21.0",
"twine ==5.1.1",
"types-requests ==2.32.0.20240914",
]

docs = [
# building docs requires Python >3.10
"sphinx ==8.0.2",
"sphinx-autobuild ==2024.9.19",
"sphinx-copybutton ==0.5.2",
"sphinxcontrib-spelling ==8.0.0",
"sphinx-autodoc-typehints ==2.4.4",
]

[project.urls]
"Homepage" = "https://github.com/rmartin16/qbittorrent-api"
"Documentation" = "https://qbittorrent-api.readthedocs.io/"
Expand All @@ -78,7 +81,6 @@ max-complexity = 15
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["C408", "S101", "S108", "S110", "S106", "S105", "C901"]


[tool.pytest.ini_options]
addopts = """
--doctest-modules
Expand Down
25 changes: 9 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ commands_post = !ci: docker stop qbt-tox-testing
docs_dir = {tox_root}{/}docs
source_dir = {[docs]docs_dir}{/}source
build_dir = {[docs]docs_dir}{/}_build
# replace when Sphinx>=7.3 and Python 3.8 is dropped:
# -T => --show-traceback
# -W => --fail-on-warning
# -b => --builder
# -v => --verbose
# -a => --write-all
# -E => --fresh-env
sphinx_args = -T -W --keep-going --jobs auto
sphinx_args = --show-traceback --fail-on-warning --keep-going --jobs auto

[testenv:docs{,-lint,-all,-man,-live,-live-src}]
base_python = py312
Expand All @@ -48,15 +41,15 @@ package = wheel
wheel_build_env = .pkg
change_dir = docs
passenv = FORCE_COLOR
deps = -e {tox_root}[dev]
deps = -e {tox_root}[docs]
commands =
!lint-!all-!man-!live : python -m sphinx {[docs]sphinx_args} -b html {[docs]source_dir} {[docs]build_dir}/html
lint : python -m sphinx {[docs]sphinx_args} -b linkcheck {[docs]source_dir} {[docs]build_dir}/links
lint : python -m sphinx {[docs]sphinx_args} -b spelling {[docs]source_dir} {[docs]build_dir}/spell
all : python -m sphinx {[docs]sphinx_args} -v -a -E -b html {[docs]source_dir} {[docs]build_dir}/html
man : python -m sphinx {[docs]sphinx_args} -b man {[docs]source_dir} {[docs]build_dir}/man
live-!src : sphinx-autobuild {[docs]sphinx_args} {posargs} -b html {[docs]source_dir} {[docs]build_dir}{/}live
live-src : sphinx-autobuild {[docs]sphinx_args} {posargs} -a -E --watch {tox_root}{/}src{/}qbittorrentapi -b html {[docs]source_dir} {[docs]build_dir}{/}live
!lint-!all-!man-!live : python -m sphinx {[docs]sphinx_args} --builder html {[docs]source_dir} {[docs]build_dir}/html
lint : python -m sphinx {[docs]sphinx_args} --builder linkcheck {[docs]source_dir} {[docs]build_dir}/links
lint : python -m sphinx {[docs]sphinx_args} --builder spelling {[docs]source_dir} {[docs]build_dir}/spell
all : python -m sphinx {[docs]sphinx_args} --verbose --write-all --fresh-env --builder html {[docs]source_dir} {[docs]build_dir}/html
man : python -m sphinx {[docs]sphinx_args} --builder man {[docs]source_dir} {[docs]build_dir}/man
live-!src : sphinx-autobuild {[docs]sphinx_args} {posargs} --builder html {[docs]source_dir} {[docs]build_dir}{/}live
live-src : sphinx-autobuild {[docs]sphinx_args} {posargs} --write-all --fresh-env --watch {tox_root}{/}src{/}qbittorrentapi --builder html {[docs]source_dir} {[docs]build_dir}{/}live

[testenv:package]
skip_install = True
Expand Down

0 comments on commit 608a67a

Please sign in to comment.