Skip to content

Commit

Permalink
[Docs] Fix --branch magic to not collide variable with sphinx tags
Browse files Browse the repository at this point in the history
A mistake was made in commit c9dca72
("[Docs] quickstart: Add specific checkout to stable versions") that the
variable name (`tags`) was chosen to collide with Sphinx' special
configuration variable:
https://www.sphinx-doc.org/en/master/usage/configuration.html#project-tags
This went unnoticed, because at the time we were not using project tags.
Later, in commit 6ebc605 ("[Docs]
Update sphinx to 5.3"), we started using this feature. The mistake was
still unnoticed, because the stable checkout was under condition that is
true only rarely.

Fixes: c9dca72 ("[Docs] quickstart: Add specific checkout to stable versions")
Fixes: 6ebc605 ("[Docs] Update sphinx to 5.3")
Signed-off-by: Wojtek Porczyk <[email protected]>
  • Loading branch information
woju committed Nov 29, 2024
1 parent 5789620 commit c9e2d3f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .ci/docs.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ pipeline {
stages {
stage('build') {
steps {
sh 'make -C Documentation html SPHINXOPTS="-W"'
sh '''
cd Documentation
git tag vTEST-FOR-DOCS-PIPELINE
READTHEDOCS=1 READTHEDOCS_VERSION=stable make html SPHINXOPTS="-W"'
make clean
git tag -d vTEST-FOR-DOCS-PIPELINE
make html SPHINXOPTS="-W"'
'''
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@
elif rtd_current_version == 'stable':
# we don't have a version, we may be able to check from git
try:
tags = [tag for tag in subprocess.check_output(
git_tags = [tag for tag in subprocess.check_output(
['git', 'tag', '--points-at']).decode().strip().split()
if tag.startswith('v')]
rst_stable_checkout = f'--branch {tags.pop()}'
rst_stable_checkout = f'--branch {git_tags.pop()}'
except (subprocess.CalledProcessError, IndexError):
pass

Expand Down

0 comments on commit c9e2d3f

Please sign in to comment.