Skip to content

Commit 0c1dd46

Browse files
authored
Autodocs (#313)
Automated update the API documentation published to https://aws.github.io/aws-iot-device-sdk-python-v2/ **Issue:** - Docs weren't updated unless someone remembered to do it manually. - Manually updating docs whenever you update code pollutes the diff, making it hard to review - Having HTML docs in `main` branch can cause issues. - Bloats size. - Generated docs might contain licenses we don't want to be redistributing. **Description of changes:** - Docs are kept in `docs` branch now - New `docs.yml` Github Workflow updates the `docs` branch whenever the `main` branch changes. - New `check-docs` job in `ci.yml` checks pull-requests for anything that would break docs. - delete the `docs/` folder in `main` and use `.gitignore` to prevent someone from accidentally resurrecting it.
1 parent 34f7e7e commit 0c1dd46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+78
-30390
lines changed

.github/workflows/ci.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- '*'
7-
- '!main'
5+
branches-ignore:
6+
- 'main'
7+
- 'docs'
88

99
env:
1010
BUILDER_VERSION: v0.8.28
@@ -45,4 +45,15 @@ jobs:
4545
chmod a+x builder
4646
./builder build -p ${{ env.PACKAGE_NAME }}
4747
48-
48+
# check that docs can still build
49+
check-docs:
50+
runs-on: ubuntu-20.04 # latest
51+
steps:
52+
- uses: actions/checkout@v2
53+
with:
54+
submodules: true
55+
- name: Check docs
56+
run: |
57+
python3 -m pip install sphinx
58+
python3 -m pip install --verbose .
59+
./make-docs.py

.github/workflows/docs.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Update the API documentation whenever the `main` branch changes.
2+
# This documentation lives in its own `docs` branch.
3+
name: docs
4+
5+
on:
6+
push:
7+
branches:
8+
- 'main'
9+
10+
jobs:
11+
update-docs-branch:
12+
runs-on: ubuntu-20.04 # latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Update docs branch
18+
run: |
19+
python3 -m pip install sphinx
20+
python3 -m pip install --verbose .
21+
./make-docs.py
22+
23+
- name: Commit
24+
run: |
25+
git config --local user.email "[email protected]"
26+
git config --local user.name "GitHub Action"
27+
git add --force docs/
28+
git commit --message="update docs"
29+
30+
- name: Push to docs branch
31+
uses: ad-m/[email protected]
32+
with:
33+
github_token: ${{ github.token }}
34+
branch: docs
35+
# Force push so that `docs` branch always looks like `main`,
36+
# but with 1 additional "update docs" commit.
37+
# This seems simpler than trying to cleanly merge `main` into
38+
# `docs` each time.
39+
force: true

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ docs/.doctrees/
33
__pycache__/
44
*.egg-info
55
build/*
6+
7+
# docs are updated automatically by .github/workflows/docs.yml
8+
docs/

awsiot/greengrasscoreipc/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def connect(*,
3232
environment variable AWS_GG_NUCLEUS_DOMAIN_SOCKET_FILEPATH_FOR_COMPONENT
3333
authtoken: Authentication token, defaults to environment variable SVCUID
3434
lifecycle_handler: Handler for events over the course of this
35-
network connection. See :class:`LifecycleHandler` for more info.
35+
network connection. See :class:`awsiot.eventstreamrpc.LifecycleHandler` for more info.
3636
Handler methods will only be invoked if the connect attempt
3737
succeeds.
3838
timeout: The number of seconds to wait for establishing the connection.

awsiot/mqtt_connection_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def mtls_with_pkcs11(*,
292292
The certificate must be PEM-formatted. The certificate may be
293293
specified by other means instead (ex: `cert_bytes`)
294294
295-
cert_bytes (Optional[bytes-like object]):
295+
cert_bytes (Optional[Union[str, bytes, bytearray]]):
296296
Use this X.509 certificate (contents in memory).
297297
The certificate must be PEM-formatted. The certificate may be
298298
specified by other means instead (ex: `cert_filepath`)

docs/.nojekyll

Whitespace-only changes.

docs/_sources/awsiot/awsiot.rst.txt

-4
This file was deleted.

docs/_sources/awsiot/eventstreamrpc.rst.txt

-4
This file was deleted.

docs/_sources/awsiot/greengrass_discovery.rst.txt

-4
This file was deleted.

docs/_sources/awsiot/greengrasscoreipc.rst.txt

-10
This file was deleted.

docs/_sources/awsiot/iotidentity.rst.txt

-4
This file was deleted.

docs/_sources/awsiot/iotjobs.rst.txt

-4
This file was deleted.

docs/_sources/awsiot/iotshadow.rst.txt

-4
This file was deleted.

docs/_sources/awsiot/mqtt_connection_builder.rst.txt

-4
This file was deleted.

docs/_sources/index.rst.txt

-38
This file was deleted.

docs/_static/background_b01.png

-78 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)