Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add (now mandatory) .readthedocs.yaml file, add docs requirements.txt and update sphinx conf #2916

Merged
merged 2 commits into from
Nov 10, 2023
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -244,7 +244,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Requirements
run: python3 -m pip install .[docs]
run: |
python -m pip install --upgrade pip
pip install -r doc/requirements.txt
- name: Check links
run: sphinx-build -b linkcheck doc/source doc/build
- name: Generate documentation
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-22.04
tools:
python: "3"

python:
install:
- requirements: doc/requirements.txt

sphinx:
configuration: doc/source/conf.py
2 changes: 2 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sphinx~=7.2.6
furo==2023.9.10
45 changes: 30 additions & 15 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -12,19 +12,17 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import datetime
import os
import shlex
import re
import sys

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.append(os.path.abspath('ext/sphinx_rtd_theme'))
sys.path.append(os.path.abspath('../../pythonforandroid'))

import sphinx_rtd_theme

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
@@ -54,18 +52,35 @@
master_doc = 'index'

# General information about the project.
project = u'python-for-android'
copyright = u'2015, Alexander Taylor'
author = u'Alexander Taylor'
project = 'python-for-android'

_today = datetime.datetime.now()

author = 'Kivy Team and other contributors'

copyright = f'{_today.year}, {author}'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#

# Lookup the version from the pyjnius module, without installing it
# since readthedocs.org may have issue to install it.
# Read the version from the __init__.py file, without importing it.
def get_version():
with open(
os.path.join(os.path.abspath("../.."), "pythonforandroid", "__init__.py")
) as fp:
for line in fp:
m = re.search(r'^\s*__version__\s*=\s*([\'"])([^\'"]+)\1\s*$', line)
if m:
return m.group(2)

# The short X.Y version.
version = '0.1'
version = get_version()
# The full version, including alpha/beta/rc tags.
release = '0.1'
release = get_version()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -82,7 +97,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['ext/*', ]
exclude_patterns = []

# The reST default role (used for this markup: `text`) to use for all
# documents.
@@ -116,15 +131,15 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme = 'furo'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# html_theme_path = []

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
@@ -230,8 +245,8 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'python-for-android.tex', u'python-for-android Documentation',
u'Alexander Taylor', 'manual'),
(master_doc, 'python-for-android.tex', 'python-for-android Documentation',
author, 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -95,9 +95,6 @@ def recursively_include(results, directory, patterns):
url='https://github.com/kivy/python-for-android',
license='MIT',
install_requires=install_reqs,
extras_require={
"docs": ["sphinx", "sphinx-rtd-theme"],
},
entry_points={
'console_scripts': [
'python-for-android = pythonforandroid.entrypoints:main',