diff --git a/.github/workflows/build_jupyterbook.yml b/.github/workflows/build_jupyterbook.yml deleted file mode 100644 index c2534ba7..00000000 --- a/.github/workflows/build_jupyterbook.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: build-book - -# Only run this when the main branch changes -on: - push: - branches: - - main - - 'jupyterbook/**' - - pull_request: - branches: - - main - -# This job installs dependencies and builds the jupyterbook -jobs: - check-jupyterbook-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - # Install dependencies - - name: Set up Python 3.10.12 - uses: actions/setup-python@v5 - with: - python-version: 3.10.12 - - - name: Install dependencies - run: | - cd examples - python -m pip install --upgrade pip wheel - python -m pip install -r example_requirements.txt - python -m pip install jupyter-book - - # Build the book ensuring that the build treats warnings as errors (-W flag) - # CLI Reference: https://jupyterbook.org/en/stable/reference/cli.html - - name: Build the book - run: | - cd examples - jupyter-book build -W . - - # Only the build is tested on CI in the pytket repository. The built pages are deployed from the tket-site repository. diff --git a/.github/workflows/check-manual.yml b/.github/workflows/check-docs-build.yml similarity index 56% rename from .github/workflows/check-manual.yml rename to .github/workflows/check-docs-build.yml index 231cdc75..2bb99148 100644 --- a/.github/workflows/check-manual.yml +++ b/.github/workflows/check-docs-build.yml @@ -1,4 +1,4 @@ -name: check manual +name: check docs build on: pull_request: @@ -28,35 +28,28 @@ jobs: - '.github/**' check: - name: check manual + name: check docs build needs: changes if: github.event_name == 'schedule' || needs.changes.outputs.manual == 'true' runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 with: + submodules: true fetch-depth: '0' - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/* - name: Set up Python 3.11 uses: actions/setup-python@v5 with: python-version: 3.11 - - name: install python requirements for manual + - name: install python requirements for docs run: | - python -m pip install --upgrade pip - python -m pip install wheel - python -m pip install -c manual_constraints.txt sphinx sphinx-book-theme jupyter-sphinx quimb - python -m pip install -r manual_requirements.txt - python -m pip install kahypar - python -m pip install sphinx-copybutton - python -m pip install ipyparallel - python -m pip install qiskit-algorithms + python -m pip install poetry + poetry install - name: install graphviz run: | - sudo apt-get update - sudo apt-get install graphviz - - name: build manual + sudo apt-get update + sudo apt-get install graphviz + - name: build manual and examples run: | - cd manual/ - sed "s/REQUIREMENTS/$(sed -e 's/[\&/]/\\&/g' -e 's/$/\\n/' ../manual_requirements.txt | tr -d '\n')/" index-rst-template > index.rst - sphinx-build -b html . build -W + poetry run ./build-docs.sh diff --git a/.github/workflows/check-examples.yml b/.github/workflows/check-examples.yml deleted file mode 100644 index d21b8056..00000000 --- a/.github/workflows/check-examples.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: check examples - -on: - pull_request: - branches: - - main - schedule: - # 04:00 every Saturday morning - - cron: '0 4 * * 6' - -jobs: - - changes: - runs-on: ubuntu-22.04 - outputs: - examples: ${{ steps.filter.outputs.examples }} - steps: - - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - base: ${{ github.ref }} - filters: | - examples: - - 'examples/**' - - 'example_requirements.txt' - - '.github/workflows/check-examples.yml' - - check: - name: check examples - needs: changes - if: github.event_name == 'schedule' || needs.changes.outputs.examples == 'true' - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: '0' - - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* +refs/heads/*:refs/remotes/origin/* - - name: Set up Python 3.11 - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - name: install python requirements for notebooks - run: | - cd examples - python -m pip install --upgrade pip - python -m pip install pre-commit==3.0.0 - python -m pip install wheel - python -m pip install -r example_requirements.txt - python -m pip install pytket-qsharp==0.40.0 - # python -m pip install pytket-pyquil==0.31.0 - python -m pip install -c constraints.txt jupyter plotly - python -m pip install docker p2j - - name: install dotnet SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '6.0.x' - - name: install iqsharp - run: | - dotnet tool install -g Microsoft.Quantum.IQSharp - dotnet iqsharp install --user - - name: pull docker images - run: | - docker pull rigetti/quilc - docker pull rigetti/qvm - - name: install pre-commit hooks and check format with black - run: | - pre-commit install - pre-commit run --all-files black - - name: test example notebooks - run: | - cd examples - ./check-examples - env: - PYTKET_QA_QISKIT_TOKEN: ${{ secrets.PYTKET_QA_QISKIT_TOKEN }} diff --git a/.gitignore b/.gitignore index 7b054f48..5fb31912 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,14 @@ dist .vscode .venv .mypy_cache -manual/build -manual/jupyter_execute +docs/manual/build +docs/manual/jupyter_execute examples/_build/ -*.ipynb_checkpoints \ No newline at end of file +docs/manual/jupyter_execute +docs/examples/_build/ +*.ipynb_checkpoints +docs/build/jupyter_execute/ +docs/build/examples/_build/ +docs/build/ +docs/jupyter_execute +docs/.jupyter_cache \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..cce7cbd1 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "docs/quantinuum-sphinx"] + path = docs/quantinuum-sphinx + url = https://github.com/CQCL/quantinuum-sphinx.git + branch = dist diff --git a/build-docs.sh b/build-docs.sh new file mode 100755 index 00000000..99023de9 --- /dev/null +++ b/build-docs.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +cd docs/ + +rm -rf build/ +sphinx-build -b html . build -W + diff --git a/build-manual b/build-manual deleted file mode 100755 index 891522f1..00000000 --- a/build-manual +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -python -m pip install -r manual_requirements.txt -python -m pip install -c manual_constraints.txt sphinx sphinx-book-theme sphinx-copybutton jupyter-sphinx quimb -python -m pip install qiskit-algorithms -python -m pip install ipykernel -python -m pip install kahypar - -cd manual/ - -ESCAPED_REQS=$(awk '{printf "%s%s",sep,$0; sep="\\\n"} END{print ""}' ../manual_requirements.txt) -sed "s/REQUIREMENTS/$ESCAPED_REQS/" index-rst-template > index.rst - -rm -rf build/ -sphinx-build -b html . build -W - -rm index.rst diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/404.html b/docs/404.html index 4eb44b42..c57b14c0 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,17 +1,20 @@ -
- - + + + +- If you are not redirected automatically, follow - this link to the user manual on tket.quantinuum.com. + If you are not redirected automatically, follow + this link to the user manual on tket.quantinuum.com.
- - + + +