Skip to content
Snippets Groups Projects
Commit 8e5aad1d authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[scripts/ci] Use read_packages from ..ci

parent 1204df69
No related branches found
No related tags found
1 merge request!59Created the CLI command 'bdt ci docs' to replace the before_build.sh
Pipeline #30384 passed
......@@ -14,31 +14,12 @@ from . import bdt
from ..constants import SERVER, CONDA_BUILD_CONFIG, CONDA_RECIPE_APPEND, \
WEBDAV_PATHS, BASE_CONDARC
from ..deploy import deploy_conda_package, deploy_documentation
from ..ci 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))
else:
packages.append((line, 'master'))
return packages
@with_plugins(pkg_resources.iter_entry_points('bdt.ci.cli'))
@click.group(cls=bdt.AliasedGroup)
def ci():
......@@ -714,8 +695,10 @@ def docs(ctx, requirement, dry_run):
(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",
"extra-intersphinx.txt")
test_requirements_path = os.path.join(clone_to, "doc",
"test-requirements.txt")
requirements_path = os.path.join(clone_to, "requirements.txt")
if os.path.exists(extra_intersphinx_path):
......@@ -731,7 +714,7 @@ def docs(ctx, requirement, dry_run):
if os.path.exists(nitpick_path):
nitpick += open(nitpick_path).readlines()
logger.info('Generating sphinx files')
logger.info('Generating sphinx files...')
# Making unique lists and removing all bob references
if not dry_run:
......@@ -742,6 +725,5 @@ def docs(ctx, requirement, dry_run):
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)
logger.info('Building !!')
logger.info('Building documentation...')
ctx.invoke(build, dry_run=dry_run)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment