Skip to content

Commit f3eb37e

Browse files
maliasadiringo-but-quantum
authored andcommitted
Skip binaries in the docs build script (#904)
### Before submitting Please complete the following checklist when submitting a PR: - [ ] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the [`tests`](../tests) directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [ ] Ensure that the test suite passes, by running `make test`. - [ ] Add a new entry to the `.github/CHANGELOG.md` file, summarizing the change, and including a link back to the PR. - [ ] Ensure that code is properly formatted by running `make format`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** Skip the build of Lightning sims binaries and dev requirements for pulbic documentations. This will speed up the build of docs from +3000 seconds to 700 seconds. **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** [sc-73505] --------- Co-authored-by: ringo-but-quantum <[email protected]>
1 parent 797fe8b commit f3eb37e

File tree

6 files changed

+19
-22
lines changed

6 files changed

+19
-22
lines changed

.github/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
### Improvements
3535

36+
* Skip the compilation of Lightning simulators and development requirements to boost the build of public docs up to 5x.
37+
[(#904)](https://github.com/PennyLaneAI/pennylane-lightning/pull/904)
38+
3639
* Update Pybind11 to 2.13.5.
3740
[(#901)](https://github.com/PennyLaneAI/pennylane-lightning/pull/901)
3841

.readthedocs.yml

+5-20
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,17 @@ version: 2
33
sphinx:
44
configuration: doc/conf.py
55

6-
python:
7-
install:
8-
- requirements: ci_build_requirements.txt
9-
- requirements: doc/requirements.txt
10-
- requirements: requirements-dev.txt
11-
- method: pip
12-
path: .
13-
146
build:
157
os: ubuntu-22.04
168
tools:
179
python: "3.10"
1810
apt_packages:
19-
- cmake
20-
- build-essential
21-
- libopenblas-base
22-
- libopenblas-dev
2311
- graphviz
24-
- wget
2512
jobs:
26-
pre_install:
27-
- wget https://developer.download.nvidia.com/compute/cuda/12.3.2/local_installers/cuda_12.3.2_545.23.08_linux.run
28-
- sh cuda_12.3.2_545.23.08_linux.run --silent --toolkit --toolkitpath=${READTHEDOCS_VIRTUALENV_PATH}/cuda-12.3 || cat /tmp/cuda-installer.log
29-
- echo "setuptools~=66.0" >> ci_build_requirements.txt
3013
post_install:
31-
- rm -rf ./build && export PATH=${READTHEDOCS_VIRTUALENV_PATH}/cuda-12.3/bin${PATH:+:${PATH}} && export LD_LIBRARY_PATH=${READTHEDOCS_VIRTUALENV_PATH}/cuda-12.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} && PL_BACKEND="lightning_gpu" python scripts/configure_pyproject_toml.py && CMAKE_ARGS="-DPL_DISABLE_CUDA_SAFETY=1" python -m build
32-
- rm -rf ./build && PL_BACKEND="lightning_kokkos" python scripts/configure_pyproject_toml.py && python -m build
33-
- rm -rf ./build && export PATH=${READTHEDOCS_VIRTUALENV_PATH}/cuda-12.3/bin${PATH:+:${PATH}} && export LD_LIBRARY_PATH=${READTHEDOCS_VIRTUALENV_PATH}/cuda-12.3/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} && PL_BACKEND="lightning_tensor" python scripts/configure_pyproject_toml.py && CMAKE_ARGS="-DPL_DISABLE_CUDA_SAFETY=1" python -m build
14+
- python -m pip install --exists-action=w --no-cache-dir -r doc/requirements.txt
15+
- PL_BACKEND="lightning_qubit" python scripts/configure_pyproject_toml.py && SKIP_COMPILATION=True python -m build
16+
- rm -rf ./build && PL_BACKEND="lightning_gpu" python scripts/configure_pyproject_toml.py && SKIP_COMPILATION=True python -m build
17+
- rm -rf ./build && PL_BACKEND="lightning_kokkos" python scripts/configure_pyproject_toml.py && SKIP_COMPILATION=True python -m build
18+
- rm -rf ./build && PL_BACKEND="lightning_tensor" python scripts/configure_pyproject_toml.py && SKIP_COMPILATION=True python -m build
3419
- python -m pip install ./dist/*.whl

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,15 @@ clean:
6363
rm -rf pennylane_lightning/*_ops*
6464
rm -rf *.egg-info
6565

66-
.PHONY: python
66+
.PHONY: python python-skip-compile
6767
python:
6868
PL_BACKEND=$(PL_BACKEND) python scripts/configure_pyproject_toml.py
6969
pip install -e . --config-settings editable_mode=compat -vv
7070

71+
python-skip-compile:
72+
PL_BACKEND=$(PL_BACKEND) python scripts/configure_pyproject_toml.py
73+
SKIP_COMPILATION=True pip install -e . --config-settings editable_mode=compat -vv
74+
7175
.PHONY: wheel
7276
wheel:
7377
PL_BACKEND=$(PL_BACKEND) python scripts/configure_pyproject_toml.py

doc/conf.py

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# add these directories to sys.path here. If the directory is relative to the
2222
# documentation root, use os.path.abspath to make it absolute, like shown here.
2323
sys.path.insert(0, os.path.abspath(""))
24+
sys.path.insert(0, os.path.abspath("."))
2425
sys.path.insert(0, os.path.abspath("_ext"))
2526
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath("doc")), "doc"))
2627

@@ -189,6 +190,8 @@ def __getattr__(cls, name):
189190
# This patterns also effect to html_static_path and html_extra_path
190191
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
191192

193+
nbsphinx_execute = "never"
194+
192195
# If true, sectionauthor and moduleauthor directives will be shown in the
193196
# output. They are ignored by default.
194197
show_authors = True

doc/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
tomlkit
2+
build
13
breathe
24
docutils==0.16
35
exhale>=0.3.3

pennylane_lightning/core/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
Version number (major.minor.patch[-label])
1717
"""
1818

19-
__version__ = "0.39.0-dev18"
19+
__version__ = "0.39.0-dev19"

0 commit comments

Comments
 (0)