-
Notifications
You must be signed in to change notification settings - Fork 57
docs: replace poetry with uv in docs build, use strict sphinx build #2130
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
base: main
Are you sure you want to change the base?
Changes from 33 commits
ac34458
281faf9
e3b9673
2ff6bf9
b76e7b2
fde5a79
f8727ee
6410edb
86867d6
e3b2ab3
541f16e
d4cd796
15c2386
217dfa5
d45d122
0807d3c
27c5f6e
b1c6ff5
6550f4e
523c27b
2190333
4b20b82
b0501b2
ca82d25
8b2c8c5
3cda68f
d5954a1
6a7f6fe
03ced90
4b638f6
9c36b8d
72d10d7
0e35513
c5de015
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -280,9 +280,14 @@ jobs: | |
| if: needs.check_changes.outputs.tket_or_workflow_changed == 'true' || needs.check_changes.outputs.pytket_or_workflow_changed == 'true' | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| enable-cache: true | ||
| version: "0.10.9" | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| submodules: recursive | ||
| submodules: true | ||
| - uses: extractions/setup-just@v3 | ||
| with: | ||
| just-version: 1.5.0 | ||
|
|
@@ -355,12 +360,9 @@ jobs: | |
| if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | ||
| timeout-minutes: 20 | ||
| run: | | ||
| pip install poetry==2.1.4 | ||
| poetry config virtualenvs.create false | ||
| cd pytket/docs | ||
| poetry install | ||
| # just build-strict # https://github.com/quantinuum/tket/issues/2044 | ||
| just build | ||
| just install-dev | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given that we're not using the same editable wheel maybe the docs build should be its own workflow? Not sure
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes I think this is a good idea.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great. I'll make a separate workflow. Thanks. |
||
| just build-strict | ||
| - name: Upload artifact | ||
| if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | ||
| uses: actions/upload-artifact@v7 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,9 +36,6 @@ A full list of available pytket backends is shown below. | |
| {py:class}`~pytket.extensions.pyquil.backends.forest.ForestBackend` | ||
| \- A backend for running circuits on remote Rigetti devices. | ||
|
|
||
| {py:class}`~pytket.extensions.aqt.backends.aqt.AQTBackend`[AQTBackend] | ||
| \- Interface to an AQT device or simulator. | ||
|
|
||
| {py:class}`~pytket.extensions.iqm.backends.iqm.IQMBackend` | ||
| \- Interface to an IQM device or simulator. | ||
|
|
||
|
|
@@ -66,9 +63,6 @@ A full list of available pytket backends is shown below. | |
|
|
||
| {py:class}`~pytket.extensions.pyquil.backends.forest.ForestStateBackend` - State-based interface to a Rigetti device. | ||
|
|
||
| {py:class}`~pytket.extensions.projectq.backends.projectq_backend.ProjectQBackend` | ||
| \- Backend for running statevector simulations on the ProjectQ simulator. | ||
|
|
||
| {py:class}`~pytket.extensions.quest.backends.quest_backend.QuESTBackend` - Interface to the [QUEST simulator](https://quest.qtechtheory.org/docs/). | ||
|
|
||
| ## Unitary Simulators | ||
|
|
@@ -114,12 +108,10 @@ Use `QulacsBackend(result_type="density_matrix")`. | |
| :caption: 'Extensions:' | ||
| :maxdepth: 0 | ||
|
|
||
| pytket-aqt <https://quantinuum.github.io/pytket-aqt/api/index.html> | ||
| pytket-braket <https://docs.quantinuum.com/tket/extensions/pytket-braket> | ||
| pytket-cirq <https://docs.quantinuum.com/tket/extensions/pytket-cirq> | ||
| pytket-iqm <https://docs.quantinuum.com/tket/extensions/pytket-iqm> | ||
| pytket-pennylane <https://docs.quantinuum.com/tket/extensions/pytket-pennylane> | ||
| pytket-projectq <https://docs.quantinuum.com/tket/extensions/pytket-projectq> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pytket-projectq is no longer part of the website so this crossref gave a warning. |
||
| pytket-pyquil <https://docs.quantinuum.com/tket/extensions/pytket-pyquil> | ||
| pytket-pysimplex <https://docs.quantinuum.com/tket/extensions/pytket-pysimplex> | ||
| pytket-pyzx <https://docs.quantinuum.com/tket/extensions/pytket-pyzx> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ See the manual section on [unitary synthesis](https://docs.quantinuum.com/tket/u | |
|
|
||
| Q: How can I convert my qiskit {py:class}`qiskit.circuit.QuantumCircuit` to a pytket {py:class}`~.Circuit`? | ||
|
|
||
| A: This can be achieved using the {external+pytket-qiskit:py:func}`pytket.extensions.qiskit.qiskit_to_tk` function from the [pytket-qiskit extension](https://docs.quantinuum.com/tket/extensions/pytket-qiskit/) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Annoyingly these links stopped resolving. Not sure why. Can probably fix them. |
||
| A: This can be achieved using the `qiskit_to_tk` function from the [pytket-qiskit extension](https://docs.quantinuum.com/tket/extensions/pytket-qiskit/) | ||
|
|
||
| ``` | ||
| from qiskit import QuantumCircuit | ||
|
|
@@ -43,7 +43,7 @@ qc.cx(0, 1) | |
| tk_circ = qiskit_to_tk(qc) | ||
| ``` | ||
|
|
||
| Conversion in the opposite direction can be accomplished using {external+pytket-qiskit:py:func}`pytket.extensions.qiskit.tk_to_qiskit`. In the case where there is no replacement for a pytket operation in qiskit the unsupported operation will be implemented in terms of the available gates. | ||
| Conversion in the opposite direction can be accomplished using `qiskit_to_tk`. In the case where there is no replacement for a pytket operation in qiskit the unsupported operation will be implemented in terms of the available gates. | ||
CalMacCQ marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Note here that `pytket` and `qiskit` use different qubit ordering conventions so care should be taken when | ||
| converting between circuit formats and interpreting results. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,26 @@ | ||
| install-dev: | ||
| poetry install | ||
| poetry run pip install ../. | ||
|
|
||
| install: | ||
| poetry install | ||
| poetry run pip install -U pytket | ||
|
|
||
| prepare: | ||
| cp -R pytket-docs-theming/_static . | ||
| cp pytket-docs-theming/conf.py . | ||
|
|
||
| build *SPHINX_ARGS: prepare | ||
| VERSION=$(poetry run python -c "import pytket; print(pytket.__version__)") && \ | ||
| poetry run sphinx-build {{SPHINX_ARGS}} -b html . build -D html_title="pytket v$VERSION API documentation" | ||
| install: prepare | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can maybe add some more explicit comments here to explain what the commands are doing. |
||
| uv sync | ||
| uv pip install -U "pytket[ZX]" | ||
|
|
||
| install-dev: prepare | ||
| uv sync | ||
| uv pip install ../.[ZX] -v | ||
|
|
||
| build *SPHINX_ARGS: | ||
| VERSION=$(uv run python -c "import pytket; print(pytket.__version__)") && \ | ||
| uv run sphinx-build {{SPHINX_ARGS}} -b html . build -D html_title="pytket v$VERSION API documentation" | ||
|
|
||
| linkcheck: prepare | ||
| poetry run sphinx-build -W -b linkcheck . build | ||
| uv run sphinx-build -W -b linkcheck . build | ||
|
|
||
| coverage: prepare | ||
| poetry run sphinx-build -W -v -b coverage . build/coverage | ||
| uv run sphinx-build -W -v -b coverage . build/coverage | ||
|
|
||
| build-strict: prepare | ||
| VERSION=$(poetry run python -c "import pytket; print(pytket.__version__)") && \ | ||
| build-strict: | ||
| just build -W # Fail on sphinx warnings | ||
| just linkcheck | ||
| just coverage | ||
|
|
@@ -32,12 +31,13 @@ serve: build | |
| serve-debug: | ||
| npm exec serve build | ||
|
|
||
| cleanup: | ||
| # Clean up files generated by Sphinx | ||
| clean: | ||
| # Clean up files generated by Sphinx build | ||
| rm -rf jupyter_execute | ||
| rm -rf .jupyter_cache | ||
| rm -rf build | ||
|
|
||
| # Clean up config files in the event the build fails | ||
| clean-env: | ||
| # Clean up the files copied over from the submodule | ||
| rm -rf _static | ||
| rm -f conf.py | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We no longer have a the quantinuum-sphinx submodule inside the pytket-docs-theming submodule so "recursive" is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it do any harm to keep it "recursive"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not as far as I know. Its more for clarity. If we keep it as recursive then someone who reads this may think we have nested submodules somewhere when we do not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is that this could then break if we did introduce a nested submodule in the other repo.