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
25 changes: 23 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import re
import runpy
import sys
import tomllib

from docutils import nodes
from sphinx.domains.python import PythonDomain
Expand Down Expand Up @@ -225,6 +226,14 @@ def run_util(filename, run_name="__main__", init_globals=None):
# The full version, including alpha/beta/rc tags.
release = VERSION


# Read synced info from pyproject.toml
with open("../pyproject.toml", "rb") as pyproject_file:
pyproject_toml = tomllib.load(pyproject_file)

min_py_version = pyproject_toml['project']['requires-python'].strip(">=")


# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
Expand All @@ -236,10 +245,11 @@ def run_util(filename, run_name="__main__", init_globals=None):
# directories to ignore when looking for source files.
exclude_patterns = [
"_includes/*",
"substitutions.rst",
"substitutions.rst", # built out below
"_archive/*",
]


# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "default" # will use "sphinx" or the theme's default

Expand Down Expand Up @@ -354,6 +364,7 @@ def run_util(filename, run_name="__main__", init_globals=None):
"typing_extensions": ("https://typing-extensions.readthedocs.io/en/latest/", None),
}


# These will be joined as one block and prepended to every source file.
# Substitutions for |version| and |release| are predefined by Sphinx.
PROLOG_PARTS = [
Expand All @@ -366,11 +377,21 @@ def run_util(filename, run_name="__main__", init_globals=None):
' <img src="/_static/copy-button.svg"/>\n\n'
" </div>\n\n"
),
f".. |min_py_version| replace:: {min_py_version}\n"
f".. |min_py_fullname| replace:: Python {min_py_version}\n"
f".. |min_py_fullname_plus| replace:: Python {min_py_version}+"
]


with open("_includes/links.rst") as f:
PROLOG_PARTS.extend(f.readlines())

rst_prolog = "\n".join(PROLOG_PARTS)
# IMPORTANT: make sure to trim white space or substitutions may cease to exist
rst_prolog = ("\n".join(PROLOG_PARTS)).strip()
print(
"=== rst_prolog: substitutions.rst (if present) + _rst_prolog_parts joined together ===",
rst_prolog, sep="\n", end="\n\n")



def strip_init_return_typehint(app, what, name, obj, options, signature, return_annotation):
Expand Down
4 changes: 2 additions & 2 deletions doc/get_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Requirements
------------
Arcade requires a desktop, laptop, or compatible Single-Board Computer (SBC) with:

#. Python 3.10 or higher
#. |min_py_fullname| or higher
#. Graphics drivers with support for either:
* OpenGL 3.3+
* GLES 3.1+ with extensions on SBCs
Expand All @@ -30,7 +30,7 @@ unsupported.
Windows, Linux, and Intel Mac
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Your computer can likely run Arcade if it supports Python 3.10 or higher.
Your computer can likely run Arcade if it supports |min_py_fullname| or higher.

In general, even older convertible Windows tablets will work as long as they:

Expand Down
2 changes: 1 addition & 1 deletion doc/programming_guide/gles_raspi_and_sbc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ requirements may work.

Standard Python
^^^^^^^^^^^^^^^
Arcade requires Python 3.10 or higher.
Arcade requires |min_py_fullname| or higher.

In practice, this means running Linux. In theory, it may be possible to run Arcade
on an ARM-specific version of Windows, but nobody has tried this before.
Expand Down
Loading