Commit 1ab17b5b authored by André Anjos's avatar André Anjos 💬

[scripts/ci] Fix interpretation of packages file

parent ebc85631
Pipeline #30419 passed with stages
in 6 minutes and 10 seconds
......@@ -23,7 +23,7 @@ stages:
- python3 -vv channel base
- source ${CONDA_ROOT}/etc/profile.d/
- conda activate base
- bdt ci docs -vv requirements.txt
- bdt ci docs -vv packages.txt
- bdt ci clean -vv
cache: &build_caches
......@@ -651,10 +651,11 @@ def docs(ctx, requirement, dry_run):
"""Prepares documentation build
This command:
1. Clones all the necessary packages necessary to build the bob documentation
1. Clones all the necessary packages necessary to build the bob/beat
2. Generates the `extra-intersphinx.txt` and `nitpick-exceptions.txt` file
This command is supposed to be run before `bdt ci build...`
This command is supposed to be run **instead** of `bdt ci build...`
......@@ -662,7 +663,6 @@ def docs(ctx, requirement, dry_run):
import git
token = os.environ['CI_JOB_TOKEN']
group = os.environ['CI_PROJECT_NAMESPACE']
# loaded all recipes, now cycle through them implementing what is described
# in the documentation of this function
......@@ -677,7 +677,9 @@ def docs(ctx, requirement, dry_run):
echo_normal((80*'=') + '\n')
clone_to = os.path.join(doc_path, package)
group, name = package.split('/', 1)
clone_to = os.path.join(doc_path, group, name)
dirname = os.path.dirname(clone_to)
if not os.path.exists(dirname):
......@@ -687,12 +689,13 @@ def docs(ctx, requirement, dry_run):'Cloning "%s", branch "%s" (depth=1)...', package, branch)
if os.path.exists(clone_to):'Repo "%s", already cloned; pulling from master...', package)'Repo "%s", already cloned; pulling from master...',
git.Git(clone_to).pull("origin", branch)
else:'Cloning "%s", branch "%s" (depth=1)...', package, branch)
git.Repo.clone_from('' % \
(token, group+"/"+package), clone_to, branch=branch, depth=1)
(token, package), clone_to, branch=branch, depth=1)
# Copying the content from extra_intersphinx
extra_intersphinx_path = os.path.join(clone_to, "doc",
......@@ -716,14 +719,23 @@ def docs(ctx, requirement, dry_run):'Generating sphinx files...')
# Making unique lists and removing all bob references
# Making unique lists and removing all bob/beat references
if not dry_run:
extra_intersphinx = list(set([e for e in extra_intersphinx if group not in e ]))
nitpick = list(set([e for e in nitpick]))
# Removing projects that are part of the group
open(os.path.join(doc_path, "extra-intersphinx.txt"), "w").writelines(extra_intersphinx)
open(os.path.join(doc_path, "nitpick-exceptions.txt"), "w").writelines(nitpick)
# extra requirements for sphinx
group = os.environ['CI_PROJECT_NAMESPACE']
extra_intersphinx = set([k.strip() for k in extra_intersphinx \
if not k.strip().startswith(group)])'Contents of "doc/extra-intersphinx.txt":\n%s',
with open(os.path.join(doc_path, 'extra-intersphinx.txt'), 'w') as f:
# nitpick exceptions'Contents of "doc/nitpick-exceptions.txt":\n%s',
with open(os.path.join(doc_path, "nitpick-exceptions.txt"), "w") as f:
f.writelines(set([k.strip() for k in nitpick]))'Building documentation...')
ctx.invoke(build, dry_run=dry_run)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment