Skip to content

Commit fe637ea

Browse files
MarquessVkalzoo
andauthored
doc(python): Publish documentation on GitHub pages (#412)
--------- Co-authored-by: Kalan <[email protected]>
1 parent 409b187 commit fe637ea

File tree

13 files changed

+377
-113
lines changed

13 files changed

+377
-113
lines changed

.github/workflows/publish-docs.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish qcs-sdk-python documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
- closed
13+
14+
jobs:
15+
publish-docs:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.11'
22+
- name: Install poetry
23+
uses: snok/install-poetry@v1
24+
- uses: Swatinem/rust-cache@v2
25+
- name: Install cargo-make
26+
uses: actions-rs/cargo@v1
27+
with:
28+
command: install
29+
args: --debug cargo-make
30+
- name: Build qcs-sdk-python documentation
31+
uses: actions-rs/cargo@v1
32+
with:
33+
command: make
34+
args: --cwd crates/python --makefile Makefile.toml docs
35+
- name: Deploy preview
36+
if: ${{ github.event_name == 'pull_request' }}
37+
uses: rossjrw/pr-preview-action@v1
38+
with:
39+
source-dir: crates/python/build/docs
40+
preview-branch: qcs-sdk-python-docs
41+
- name: Deploy docs
42+
if: ${{ github.event_name == 'push' }}
43+
uses: peaceiris/actions-gh-pages@v3
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_dir: crates/python/build/docs
47+
publish_branch: qcs-sdk-python-docs
48+

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ qcs-api/docs
2525

2626
# Python artifacts
2727
**/__pycache__
28+
**/null-ls-cache*
2829
crates/python/.hypothesis
2930
crates/python/qcs_sdk/*.so
31+
crates/python/build

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ numpy = "0.20.0"
2727
pyo3 = "0.20.0"
2828
pyo3-asyncio = { version = "0.20", features = ["tokio-runtime"] }
2929
pyo3-build-config = "0.20.0"
30-
rigetti-pyo3 = { version = "0.3.0", features = ["complex"] }
30+
rigetti-pyo3 = { version = "0.3.1", features = ["complex"] }
3131

3232
# The primary intent of these options is to reduce the binary size for Python wheels
3333
# since PyPi has limits on how much storage a project can use.

crates/python/Makefile.toml

+6
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ alias = "dev-flow"
5757

5858
[tasks.ci-flow]
5959
dependencies = ["pytest-flow", "stubtest"]
60+
61+
[tasks.docs]
62+
dependencies = ["poetry-install", "install-lib"]
63+
command = "poetry"
64+
args = ["run", "pdoc", "-o", "build/docs", "qcs_sdk", "!qcs_sdk.qcs_sdk", "--logo", "https://qcs.rigetti.com/static/img/rigetti-logo.svg"]
65+

crates/python/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ to compile and run Quil programs on Rigetti quantum processors. Internally, it i
88
While this package can be used directly, [pyQuil](https://pypi.org/project/pyquil/) offers more functionality and a
99
higher-level interface for building and executing Quil programs. This package is still in early development and breaking changes should be expected between minor versions.
1010

11+
# Documentation
12+
13+
Documentation for the current release of `qcs_sdk` is published [here](https://rigetti.github.io/qcs-sdk-rust/qcs_sdk.html). Every version of `qcs_sdk` ships [with type stubs](https://github.com/rigetti/qcs-sdk-rust/tree/main/crates/python/qcs_sdk) that can provide type hints and documentation to Python tooling and editors.
14+
1115
## Troubleshooting
1216

1317
### Enabling Debug logging

crates/python/poetry.lock

+162-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/python/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pytest-asyncio = "^0.19.0"
5353
black = "^22.8.0"
5454
syrupy = "^3.0.6"
5555
mypy = "^1.4.1"
56+
pdoc = "^14.1.0"
5657

5758
[build-system]
5859
requires = ["maturin>=1.0.0,<2.0.0"]

0 commit comments

Comments
 (0)