-
Notifications
You must be signed in to change notification settings - Fork 13
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
docs: fix silently failing c.i. build of the sphinx docs #459
Open
CalMacCQ
wants to merge
10
commits into
main
Choose a base branch
from
fix/docs_ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d6c5d99
add exit flags
CalMacCQ 4535b8b
sync build script with website, fail on sphinx warnings
CalMacCQ a10815d
exit flags in install script
CalMacCQ fa95eaf
use recursive submodules
CalMacCQ ef59dec
try cd fix
CalMacCQ 233951c
use recursive submodules throughout
CalMacCQ 59de7b1
don't use cd
CalMacCQ 764084d
try install fix
CalMacCQ 0773b8c
try another fix
CalMacCQ b8f653c
add comment explaining submodules
CalMacCQ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
#!/bin/bash | ||
set -e | ||
rm -rf build/ | ||
|
||
# This build script is only used for local docs build. | ||
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. And on the CI for doc checks? 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. Good point, I'll clarify that. |
||
# The docs build for the website uses a different script. | ||
|
||
# Move theming elements into the docs folder | ||
cp -R pytket-docs-theming/_static . | ||
cp -R pytket-docs-theming/quantinuum-sphinx . | ||
cp pytket-docs-theming/conf.py . | ||
cp -R pytket-docs-theming/_static . # Currently unused | ||
|
||
# Get the name of the project | ||
EXTENSION_NAME="$(basename "$(dirname `pwd`)")" | ||
PACKAGE="$(basename "$(dirname `pwd`)")" | ||
|
||
# Get pytket extension version | ||
VERSION="$(pip show $PACKAGE | grep Version | awk '{print $2}')" | ||
|
||
# Correct github link in navbar | ||
sed -i '' 's#CQCL/tket#CQCL/'$EXTENSION_NAME'#' _static/nav-config.js | ||
# Output package version | ||
echo extension version $VERSION | ||
|
||
# Build the docs. Ensure we have the correct project title. | ||
sphinx-build -b html -D html_title="$EXTENSION_NAME" . build | ||
# Combine to set title | ||
PACKAGE+=" $VERSION" | ||
|
||
# Build the docs setting the html_title | ||
sphinx-build -b html . build -D html_title="$PACKAGE API documentation" -W | ||
|
||
# Find and replace all generated links that use _tket in the built html. | ||
# Note that MACOS and linux have differing sed syntax. | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
find build/ -type f -name "*.html" | xargs sed -e 's/pytket._tket/pytket/g' -i "" | ||
sed -i '' 's/pytket._tket/pytket/g' build/searchindex.js | ||
|
@@ -23,7 +35,8 @@ else | |
sed -i 's/pytket._tket/pytket/g' build/searchindex.js | ||
fi | ||
|
||
# Remove copied files. This ensures reusability. | ||
rm -r _static | ||
# Remove copied files after build is done. This ensures reusability. | ||
rm -r quantinuum-sphinx | ||
rm conf.py | ||
rm conf.py | ||
|
||
set +e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
set -e | ||
|
||
|
||
# Copy over poetry dependencies from theming repository | ||
cp pytket-docs-theming/extensions/pyproject.toml . | ||
cp pytket-docs-theming/extensions/poetry.lock . | ||
cp docs/pytket-docs-theming/extensions/pyproject.toml . | ||
cp docs/pytket-docs-theming/extensions/poetry.lock . | ||
|
||
# Install the docs dependencies. Creates a .venv directory in docs | ||
poetry install | ||
|
||
# NOTE: Editable wheel should be installed separately. | ||
# NOTE: Editable wheel should be installed separately. | ||
set +e |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Seems the reason this wasn't working it that we couldn't find the
wheelhouse
directory after "cd"ing into docsAfter 0773b8c the checks are passing.