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 doc tests, make them pass. #2890

Merged
merged 3 commits into from
Nov 4, 2023
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
24 changes: 18 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout python-for-android
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
Expand All @@ -36,7 +36,7 @@ jobs:
os: [ubuntu-latest, macOs-latest]
steps:
- name: Checkout python-for-android
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
target: testapps-service_library-aar
steps:
- name: Checkout python-for-android
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Build python-for-android docker image
run: |
docker build --tag=kivy/python-for-android .
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
steps:
- name: Checkout python-for-android
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install python-for-android
run: |
source ci/osx_ci.sh
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
REBUILD_UPDATED_RECIPES_EXTRA_ARGS: --arch=${{ matrix.android_arch }}
steps:
- name: Checkout python-for-android (all-history)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
# helps with GitHub runner getting out of space
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
REBUILD_UPDATED_RECIPES_EXTRA_ARGS: --arch=${{ matrix.android_arch }}
steps:
- name: Checkout python-for-android (all-history)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python-for-android
Expand Down Expand Up @@ -238,3 +238,15 @@ jobs:
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true

documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Requirements
run: python3 -m pip install .[docs]
- name: Check links
run: sphinx-build -b linkcheck doc/source doc/build
- name: Generate documentation
run: sphinx-build doc/source doc/build

12 changes: 5 additions & 7 deletions doc/source/apis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Requires `Permission.WRITE_EXTERNAL_STORAGE` to read and write to.
Read more on all the different storage types and what to use them for
in the Android documentation:

https://developer.android.com/training/data-storage/files
https://developer.android.com/training/data-storage

A note on permissions
~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -148,7 +148,7 @@ Observing Activity result

.. module:: android.activity

The default PythonActivity has a observer pattern for `onActivityResult <http://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)>`_ and `onNewIntent <http://developer.android.com/reference/android/app/Activity.html#onNewIntent(android.content.Intent)>`_.
The default PythonActivity has a observer pattern for `onActivityResult <https://developer.android.com/reference/android/app/Activity#onActivityResult(int, int, android.content.Intent)>`_ and `onNewIntent <https://developer.android.com/reference/android/app/Activity.html#onNewIntent(android.content.Intent)>`_.

.. function:: bind(eventname=callback, ...)

Expand Down Expand Up @@ -193,8 +193,6 @@ Example::
Activity lifecycle handling
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. module:: android.activity

The Android ``Application`` class provides the `ActivityLifecycleCallbacks
<https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks>`_
interface where callbacks can be registered corresponding to `activity
Expand Down Expand Up @@ -241,7 +239,7 @@ Receiving Broadcast message
.. module:: android.broadcast

Implementation of the android `BroadcastReceiver
<http://developer.android.com/reference/android/content/BroadcastReceiver.html>`_.
<https://developer.android.com/reference/android/content/BroadcastReceiver.html>`_.
You can specify the callback that will receive the broadcast event, and actions
or categories filters.

Expand Down Expand Up @@ -308,7 +306,7 @@ Runnable
.. module:: android.runnable

:class:`Runnable` is a wrapper around the Java `Runnable
<http://developer.android.com/reference/java/lang/Runnable.html>`_ class. This
<https://developer.android.com/reference/java/lang/Runnable.html>`_ class. This
class can be used to schedule a call of a Python function into the
`PythonActivity` thread.

Expand Down Expand Up @@ -443,5 +441,5 @@ sometimes a little more involved, particularly if making Java classes
from Python code), but it's not Pythonic and it's not short. These are
problems that Plyer, explained below, attempts to address.

You can check the `Pyjnius documentation <https://pyjnius.readthedocs.io/en/stable/>`_ for further details.
You can check the `Pyjnius documentation <https://pyjnius.readthedocs.io/en/latest/>`_ for further details.

2 changes: 1 addition & 1 deletion doc/source/buildoptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ options (this list may not be exhaustive):
Since Android ignores ``android:screenOrientation`` when in multi-window mode
(Which is the default on Android 12+), this option will also set the window orientation hints
for the SDL bootstrap. If multiple orientations are given,
``android:screenOrientation`` will be set to ``unspecified``.
``android:screenOrientation`` will be set to ``unspecified``.
- ``--manifest-orientation``: The orientation that will be set for the ``android:screenOrientation``
attribute of the activity in the ``AndroidManifest.xml`` file. If not set, the value
will be synthesized from the ``--orientation`` option.
Expand Down
14 changes: 12 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -293,4 +293,14 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}

# Ignore some troublesome links that are actually fine.
linkcheck_ignore = [
# Special characters in URL seems to confuse link-checker.
r"https://developer.android.com/reference/android/app/Activity#onActivity.*",

# GitHub parses anchor tags differently to pure HTML
r"https://github.com/kivy/python-for-android/blob.*",
]

13 changes: 0 additions & 13 deletions doc/source/ext/sphinx_rtd_theme/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions doc/source/ext/sphinx_rtd_theme/Gemfile

This file was deleted.

16 changes: 0 additions & 16 deletions doc/source/ext/sphinx_rtd_theme/Gemfile.lock

This file was deleted.

105 changes: 0 additions & 105 deletions doc/source/ext/sphinx_rtd_theme/Gruntfile.js

This file was deleted.

20 changes: 0 additions & 20 deletions doc/source/ext/sphinx_rtd_theme/LICENSE

This file was deleted.

10 changes: 0 additions & 10 deletions doc/source/ext/sphinx_rtd_theme/MANIFEST.in

This file was deleted.

Loading