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

Build conceptual and API docs with Sphinx #30

Merged
merged 28 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1543c82
Move initial support for Sphinx docs from old repo.
cgranade Jan 4, 2022
73b4bc8
Publish docs to artifacts, GH Pages.
cgranade Jan 4, 2022
80b94c1
Fix link.
cgranade Jan 4, 2022
343d5ea
Fix ci.yml.
cgranade Jan 4, 2022
6734ed7
Fix taskList.
cgranade Jan 4, 2022
8f3151e
Fix ci.yml.
cgranade Jan 4, 2022
df424d3
Allow build to complete by ignoring false +ve clippy.
cgranade Jan 4, 2022
c717b26
Split out docs build into new job.
cgranade Jan 4, 2022
81bc6d9
Check out source for docs.
cgranade Jan 4, 2022
f2f7dd7
Don't clone submodules when building docs.
cgranade Jan 5, 2022
9186011
Add more explicit error messages to venv call.
cgranade Jan 5, 2022
8c09572
Even more explicit errors.
cgranade Jan 5, 2022
20f9681
Build docs on linux instead.
cgranade Jan 5, 2022
2b9d04e
Update pyqir-jit/src/lib.rs
cgranade Jan 7, 2022
8644045
Update docs/apiref/parser.md
cgranade Jan 7, 2022
807626b
Update eng/psakefile.ps1
cgranade Jan 7, 2022
7e95ddd
Suggestions from code review.
cgranade Jan 7, 2022
ef5733c
Merge branch 'cgranade/sphinx-docs' of https://github.com/qir-allianc…
cgranade Jan 7, 2022
08be019
Remove extraneous semicolons.
Jan 12, 2022
e0ef7b7
Add missing config files for lint / link check CI.
cgranade Jan 12, 2022
eda0a60
Fix broken links.
cgranade Jan 12, 2022
4d197a7
Merge branch 'cgranade/sphinx-docs' of https://github.com/qir-allianc…
cgranade Jan 12, 2022
783e3a9
Fixes for false positives in lint CI, more details on how to write docs.
cgranade Jan 12, 2022
4273b2d
Merge branch 'cgranade/fix-lint-ci' into cgranade/sphinx-docs
cgranade Jan 12, 2022
a2a5af7
Added required blank line.
cgranade Jan 12, 2022
08e6fd1
Fix a couple more warnings.
cgranade Jan 12, 2022
bd4f30b
Update eng/psakefile.ps1
Jan 13, 2022
c708d1b
Update eng/psakefile.ps1
Jan 13, 2022
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
161 changes: 100 additions & 61 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,100 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- feature/*
- features/*

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.config.os }}
env: ${{ matrix.config.env }}
strategy:
fail-fast: false
matrix:
config:
- {
os: "ubuntu-20.04",
arch: "amd64",
env: {},
}
- {
os: "windows-2019",
arch: "amd64",
env: {},
}
- {
os: "macOS-10.15",
arch: "amd64",
env: {},
}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Linux - Install build dependencies, ccache, and update PATH to use linked versions of gcc, cc, etc
run: sudo apt-get install -y ccache ninja-build
if: ${{ matrix.config.os == 'ubuntu-20.04' }}
- name: Windows - Install build dependencies, ccache, and update PATH to use linked versions of gcc, cc, etc
run: choco install --accept-license -y sccache ninja
if: ${{ matrix.config.os == 'windows-2019' }}
- name: MacOS - Install build dependencies, ccache, and update PATH to use linked versions of gcc, cc, etc
run: brew install ccache ninja
if: ${{ matrix.config.os == 'macOS-10.15' }}
- name: Windows - Install LLVM 11.1.0
run: choco install llvm --version=11.1.0 --allow-downgrade
if: ${{ matrix.config.os == 'windows-2019' }}
- name: "Build all"
run: ./build.ps1
shell: pwsh
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: target/wheels/*
name: CI
cgranade marked this conversation as resolved.
Show resolved Hide resolved
on:
push:
branches:
- main
pull_request:
branches:
- main
- feature/*
- features/*

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ${{ matrix.config.os }}
env: ${{ matrix.config.env }}
strategy:
fail-fast: false
matrix:
config:
- {
os: "ubuntu-20.04",
arch: "amd64",
env: {},
}
- {
os: "windows-2019",
arch: "amd64",
env: {},
}
- {
os: "macOS-10.15",
arch: "amd64",
env: {},
}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Linux - Install build dependencies, ccache, and update PATH to use linked versions of gcc, cc, etc
run: sudo apt-get install -y ccache ninja-build
if: ${{ matrix.config.os == 'ubuntu-20.04' }}
- name: Windows - Install build dependencies, ccache, and update PATH to use linked versions of gcc, cc, etc
run: choco install --accept-license -y sccache ninja
if: ${{ matrix.config.os == 'windows-2019' }}
- name: MacOS - Install build dependencies, ccache, and update PATH to use linked versions of gcc, cc, etc
run: brew install ccache ninja
if: ${{ matrix.config.os == 'macOS-10.15' }}
- name: Windows - Install LLVM 11.1.0
run: choco install llvm --version=11.1.0 --allow-downgrade
if: ${{ matrix.config.os == 'windows-2019' }}
- name: "Build all"
run: ./build.ps1
shell: pwsh
- name: Artifacts
uses: actions/upload-artifact@v2
with:
name: artifacts
path: target/wheels/*

docs:
runs-on: "ubuntu-20.04"
needs: build
steps:
- uses: actions/checkout@v2
with:
submodules: false

- name: Download Build Artifacts
uses: actions/download-artifact@v2
with:
name: artifacts
path: wheelhouse

- name: Build Docs
run: |
$properties = @{
"wheelhouse" = (Resolve-Path "wheelhouse/*-linux_x86_64.whl")
};
./eng/build.ps1 `
-taskList docs `
-properties $properties
shell: pwsh

# Always publish docs as an artifact, but only publish docs to GitHub Pages
# when pushing to main.
- name: Publish Docs as Artifacts
uses: actions/upload-artifact@v2
with:
name: docs
path: docs/_build

- name: Publish Docs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.7
with:
branch: gh-pages
folder: docs/_build/html
if: ${{ github.event_name == 'push' }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ venv/
ENV/
env.bak/
venv.bak/
.docs-venv

# Spyder project settings
.spyderproject
Expand Down
21 changes: 21 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
bamarsha marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 10 additions & 0 deletions docs/apiref/generator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# pyqir_generator
cgranade marked this conversation as resolved.
Show resolved Hide resolved

## `QirBuilder` class

:::{eval-rst}
.. autoclass:: pyqir_generator.QirBuilder
:show-inheritance:
:members:
:undoc-members:
:::
11 changes: 11 additions & 0 deletions docs/apiref/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# API Reference

:::{toctree}
---
maxdepth: 2
---

parser
generator
jit
:::
28 changes: 28 additions & 0 deletions docs/apiref/jit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# pyqir_jit

## `NonadaptiveJit` class

:::{eval-rst}
.. autoclass:: pyqir_jit.NonadaptiveJit
:show-inheritance:
:members:
:undoc-members:
:::

## `GateSet` class

:::{eval-rst}
.. autoclass:: pyqir_jit.GateSet
:show-inheritance:
:members:
:undoc-members:
:::

## `GateLogger` class

:::{eval-rst}
.. autoclass:: pyqir_jit.GateLogger
:show-inheritance:
:members:
:undoc-members:
:::
Loading