Skip to content

Commit d3ad2e6

Browse files
authored
[py] Skip devtools when generating Python API docs (#15918)
1 parent 21b10ad commit d3ad2e6

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

py/docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The `selenium` package is used to automate web browser interaction from Python.
2323
| **API Docs**: | `api.html <api.html>`_ |
2424
+-------------------+------------------------------------------------+
2525

26-
Updated documentation published with each commit is available at: https://selenium-python-api-docs.readthedocs.io
26+
Updated documentation published with each commit is available at: `readthedocs.io <https://selenium-python-api-docs.readthedocs.io/en/latest>`_
2727

2828
----
2929

py/generate_api_module_listing.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
# -----------------------------------------------------------------
19-
# This script recursively scans the `selenium` package directory
20-
# to find all modules, then generates the `py/docs/source/api.rst`
21-
# file containing a listing of all modules in separate sections.
22-
# The `api.rst` file is later used by `sphinx-autogen` to generate
23-
# sphinx autodoc stub pages used in the Python API documentation.
24-
# See `py/tox.ini` for how it is invoked.
18+
19+
"""This script recursively scans the `selenium` package directory
20+
to find all modules, then generates the `py/docs/source/api.rst`
21+
file containing a listing of all modules in separate sections.
22+
The `api.rst` file is later used by `sphinx-autogen` to generate
23+
sphinx autodoc stub pages used in the Python API documentation.
24+
See `py/tox.ini` for how it is invoked."""
2525

2626
import os
2727
import site
@@ -47,8 +47,8 @@ def find_modules(package_name):
4747
package_name = "selenium"
4848
output_file = os.path.join("docs", "source", "api.rst")
4949
print(f"generating module list for sphinx autodoc in: {output_file}\n")
50-
modules = find_modules(package_name)
51-
base_modules = [mod for mod in sorted(set(module.rsplit(".", 1)[0] for module in modules)) if mod != package_name]
50+
modules = [module for module in find_modules(package_name) if ".devtools." not in module]
51+
base_modules = [mod for mod in sorted({module.rsplit(".", 1)[0] for module in modules}) if mod != package_name]
5252
print("found sections:")
5353
for base_module in base_modules:
5454
print(f" {base_module}")

0 commit comments

Comments
 (0)