Commit 8e5aad1d authored by André Anjos's avatar André Anjos 💬

[scripts/ci] Use read_packages from

parent 1204df69
Pipeline #30384 passed with stage
in 4 minutes and 22 seconds
......@@ -14,31 +14,12 @@ from . import bdt
from ..deploy import deploy_conda_package, deploy_documentation
from import read_packages
from ..log import verbosity_option, get_logger, echo_normal
logger = get_logger(__name__)
def read_packages(filename):
Return a python list given file containing one package per line
# loads dirnames from order file (accepts # comments and empty lines)
packages = []
with open(filename, 'rt') as f:
for line in f:
line = line.partition('#')[0].strip()
if line:
if ',' in line: #user specified a branch
path, branch = [k.strip() for k in line.split(',', 1)]
packages.append((path, branch))
packages.append((line, 'master'))
return packages
def ci():
......@@ -560,7 +541,7 @@ def nightlies(ctx, order, dry_run):
# loads dirnames from order file (accepts # comments and empty lines)
packages = read_packages(order)
token = os.environ['CI_JOB_TOKEN']
import git
......@@ -676,7 +657,7 @@ def docs(ctx, requirement, dry_run):
This command is supposed to be run before `bdt ci build...`
packages = read_packages(requirement)
import git
......@@ -688,7 +669,7 @@ def docs(ctx, requirement, dry_run):
extra_intersphinx = []
nitpick = []
doc_path = os.path.join(os.environ['CI_PROJECT_DIR'], 'doc')
for n, (package, branch) in enumerate(packages):
echo_normal('\n' + (80*'='))
......@@ -702,7 +683,7 @@ def docs(ctx, requirement, dry_run):
# clone the repo, shallow version, on the specified branch
if dry_run:
if dry_run:'Cloning "%s", branch "%s" (depth=1)...', package, branch)
if os.path.exists(clone_to):
......@@ -712,10 +693,12 @@ def docs(ctx, requirement, dry_run):'Cloning "%s", branch "%s" (depth=1)...', package, branch)
git.Repo.clone_from('' % \
(token, group+"/"+package), clone_to, branch=branch, depth=1)
# Copying the content from extra_intersphinx
extra_intersphinx_path = os.path.join(clone_to, "doc", "extra-intersphinx.txt")
test_requirements_path = os.path.join(clone_to, "doc", "test-requirements.txt")
extra_intersphinx_path = os.path.join(clone_to, "doc",
test_requirements_path = os.path.join(clone_to, "doc",
requirements_path = os.path.join(clone_to, "requirements.txt")
if os.path.exists(extra_intersphinx_path):
......@@ -731,17 +714,16 @@ def docs(ctx, requirement, dry_run):
if os.path.exists(nitpick_path):
nitpick += open(nitpick_path).readlines()'Generating sphinx files')'Generating sphinx files...')
# Making unique lists and removing all bob 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)'Building !!')'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