Skip to content

Commit f629044

Browse files
authored
[py] Configure readthedocs publishing for Python API docs (#15614)
This fixes the "Read the Docs" configuration so Python docs get published to https://selenium-python-api-docs.readthedocs.io on every commit to trunk.
1 parent 78ffa20 commit f629044

File tree

3 files changed

+70
-60
lines changed

3 files changed

+70
-60
lines changed

.readthedocs.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

py/docs/.readthedocs.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# .readthedocs.yaml
2+
# configuration file for publishing Python API documentation on "Read the Docs"
3+
#
4+
# configuration file reference: https://docs.readthedocs.io/en/stable/config-file/v2.html
5+
# job configuration: https://app.readthedocs.org/projects/selenium-python-api-docs
6+
# published docs: https://selenium-python-api-docs.readthedocs.io
7+
8+
version: 2
9+
10+
build:
11+
os: ubuntu-24.04
12+
tools:
13+
python: "3.11"
14+
commands:
15+
- pip install -r py/docs/requirements.txt
16+
- pip install -r py/requirements.txt
17+
- PYTHONPATH=py sphinx-autogen -o $READTHEDOCS_OUTPUT/html py/docs/source/api.rst
18+
- PYTHONPATH=py sphinx-build -b html -d build/docs/doctrees py/docs/source $READTHEDOCS_OUTPUT/html
19+
20+
sphinx:
21+
configuration: py/docs/source/conf.py

py/docs/source/index.rst

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,41 @@ Python language bindings for Selenium WebDriver.
99

1010
The `selenium` package is used to automate web browser interaction from Python.
1111

12-
+-----------------+--------------------------------------------------------------------------------------+
13-
| **Home**: | https://selenium.dev |
14-
+-----------------+--------------------------------------------------------------------------------------+
15-
| **GitHub**: | https://github.com/SeleniumHQ/Selenium |
16-
+-----------------+--------------------------------------------------------------------------------------+
17-
| **PyPI**: | https://pypi.org/project/selenium |
18-
+-----------------+--------------------------------------------------------------------------------------+
19-
| **API Docs**: | https://selenium.dev/selenium/docs/api/py/api.html |
20-
+-----------------+--------------------------------------------------------------------------------------+
21-
| **IRC/Slack**: | `Selenium chat room <https://www.selenium.dev/support/#ChatRoom>`_ |
22-
+-----------------+--------------------------------------------------------------------------------------+
23-
24-
Several browsers/drivers are supported (Firefox, Chrome, Edge, Safari), as well as the Remote protocol.
12+
+-------------------+------------------------------------------------+
13+
| **Home**: | https://selenium.dev |
14+
+-------------------+------------------------------------------------+
15+
| **GitHub**: | https://github.com/SeleniumHQ/Selenium |
16+
+-------------------+------------------------------------------------+
17+
| **PyPI**: | https://pypi.org/project/selenium |
18+
+-------------------+------------------------------------------------+
19+
| **IRC/Slack**: | https://www.selenium.dev/support/#ChatRoom |
20+
+-------------------+------------------------------------------------+
21+
| **Docs**: | https://www.selenium.dev/selenium/docs/api/py |
22+
+-------------------+------------------------------------------------+
23+
| **API Docs**: | `api.html <api.html>`_ |
24+
+-------------------+------------------------------------------------+
25+
26+
Updated documentation published with each commit is available at: https://selenium-python-api-docs.readthedocs.io
27+
28+
----
2529

2630
Supported Python Versions
2731
=========================
2832

2933
* Python 3.9+
3034

35+
Supported Browsers
36+
==================
37+
38+
Several browsers are supported, as well as the Remote protocol:
39+
40+
* Chrome
41+
* Edge
42+
* Firefox
43+
* Safari
44+
* WebKitGTK
45+
* WPEWebKit
46+
3147
Installing
3248
==========
3349

@@ -53,13 +69,13 @@ specify browsers and drivers yourself.
5369
Links to some of the more popular browser drivers:
5470

5571
+--------------+-----------------------------------------------------------------------+
56-
| **Chrome**: | https://chromedriver.chromium.org/downloads |
72+
| **Chrome**: | https://developer.chrome.com/docs/chromedriver |
5773
+--------------+-----------------------------------------------------------------------+
58-
| **Edge**: | https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ |
74+
| **Edge**: | https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver |
5975
+--------------+-----------------------------------------------------------------------+
60-
| **Firefox**: | https://github.com/mozilla/geckodriver/releases |
76+
| **Firefox**: | https://github.com/mozilla/geckodriver |
6177
+--------------+-----------------------------------------------------------------------+
62-
| **Safari**: | https://webkit.org/blog/6900/webdriver-support-in-safari-10/ |
78+
| **Safari**: | https://webkit.org/blog/6900/webdriver-support-in-safari-10 |
6379
+--------------+-----------------------------------------------------------------------+
6480

6581
Example 0:
@@ -107,7 +123,8 @@ Example 1:
107123
Example 2:
108124
==========
109125

110-
Selenium WebDriver is often used as a basis for testing web applications. Here is a simple example using Python's standard `unittest <http://docs.python.org/3/library/unittest.html>`_ library:
126+
Selenium WebDriver is often used as a basis for testing web applications. Here is a simple example using Python's standard
127+
`unittest <http://docs.python.org/3/library/unittest.html>`_ library:
111128

112129
.. code-block:: python
113130
@@ -143,18 +160,22 @@ Use The Source Luke!
143160

144161
View source code online:
145162

146-
+-----------+------------------------------------------------------+
147-
| Official: | https://github.com/SeleniumHQ/selenium/tree/trunk/py |
148-
+-----------+------------------------------------------------------+
163+
+---------------+-------------------------------------------------------+
164+
| **Official**: | https://github.com/SeleniumHQ/selenium/tree/trunk/py |
165+
+---------------+-------------------------------------------------------+
149166

150167
Contributing
151168
=============
152169

170+
- Fork the selenium repo and clone it locally
153171
- Create a branch for your work
154-
- Ensure `tox` is installed (using a `virtualenv` is recommended)
155-
- Run: `python -m venv venv && source venv/bin/activate && pip install tox`
156-
- After making changes, before committing execute `tox -e linting`
157-
- If tox exits `0`, commit and push. Otherwise fix the newly introduced style violations.
158-
- `flake8` requires manual fixes
159-
- `black` will rewrite the violations automatically, however the files are unstaged and should staged again.
160-
- `isort` will rewrite the violations automatically, however the files are unstaged and should staged again.
172+
- Run: `git checkout -b my-cool-branch-name`
173+
- Create a virtual environment and install tox
174+
- Run: `python -m venv venv && source venv/bin/activate && pip install tox`
175+
- Make your changes
176+
- Run: `tox -e linting`
177+
- If tox exits `0`, commit and push. Otherwise, fix the newly introduced style violations
178+
- `flake8` requires manual fixes
179+
- `black` will rewrite the violations automatically, however the files are unstaged and should be staged again
180+
- `isort` will rewrite the violations automatically, however the files are unstaged and should be staged again
181+
- Submit a Pull Request

0 commit comments

Comments
 (0)