Commit 48ae05ae authored by André Anjos's avatar André Anjos 💬
Browse files

Implement support for colorful logging nearly everywhere

parent f6cf88c9
Pipeline #26971 passed with stage
in 3 minutes and 20 seconds
......@@ -5,12 +5,13 @@
import io
import datetime
import logging
logger = logging.getLogger(__name__)
import pytz
import dateutil.parser
from .log import get_logger
logger = get_logger(__name__)
def parse_date(d):
'''Parses any date supported by :py:func:`dateutil.parser.parse`'''
......
......@@ -4,12 +4,12 @@
'''Tools to help CI-based builds and artifact deployment'''
import logging
logger = logging.getLogger(__name__)
import git
import distutils.version
from .log import get_logger
logger = get_logger(__name__)
def is_master(refname, tag, repodir):
'''Tells if we're on the master branch via ref_name or tag
......
......@@ -6,11 +6,11 @@
import os
import pkg_resources
import logging
logger = logging.getLogger(__name__)
from . import bootstrap
from .log import get_logger
logger = get_logger(__name__)
BASE_CONDARC = bootstrap._BASE_CONDARC
'''Default setup for conda builds'''
......
......@@ -9,8 +9,8 @@ import time
import shutil
import gitlab
import logging
logger = logging.getLogger(__name__)
from .log import get_logger
logger = get_logger(__name__)
from distutils.version import StrictVersion
......
......@@ -3,8 +3,6 @@
import os
import sys
import logging
logger = logging.getLogger(__name__)
import yaml
import click
......@@ -12,7 +10,6 @@ import pkg_resources
import conda_build.api
from . import bdt
from ..log import verbosity_option
from ..build import next_build_number, conda_arch, should_skip_build, \
get_rendered_metadata, get_parsed_recipe, make_conda_config, \
get_docserver_setup, get_env_directory
......@@ -20,6 +17,9 @@ from ..constants import CONDA_BUILD_CONFIG, CONDA_RECIPE_APPEND, \
SERVER, MATPLOTLIB_RCDIR, BASE_CONDARC
from ..bootstrap import set_environment, get_channels
from ..log import verbosity_option, get_logger
logger = get_logger(__name__)
@click.command(epilog='''
Examples:
......
#!/usr/bin/env python
import os
import logging
logger = logging.getLogger(__name__)
import click
from . import bdt
from ..log import verbosity_option
from ..log import verbosity_option, get_logger
logger = get_logger(__name__)
@click.command(epilog='''
......
......@@ -4,17 +4,16 @@ import os
import sys
import datetime
import logging
logger = logging.getLogger(__name__)
import click
from . import bdt
from ..log import verbosity_option
from ..changelog import get_last_tag_date, write_tags_with_commits
from ..changelog import parse_date
from ..release import get_gitlab_instance
from ..log import verbosity_option, get_logger
logger = get_logger(__name__)
@click.command(epilog='''
Examples:
......
......@@ -3,8 +3,6 @@
import os
import re
import glob
import logging
logger = logging.getLogger(__name__)
import yaml
import click
......@@ -13,9 +11,11 @@ import conda_build.api
from click_plugins import with_plugins
from . import bdt
from ..log import verbosity_option
from ..constants import SERVER
from ..log import verbosity_option, get_logger, echo_normal
logger = get_logger(__name__)
@with_plugins(pkg_resources.iter_entry_points('bdt.ci.cli'))
@click.group(cls=bdt.AliasedGroup)
......@@ -363,11 +363,11 @@ def base_build(order, python, dry_run):
recipes = list(itertools.product([None], recipes))
for order, (pyver, recipe) in enumerate(recipes):
click.echo('\n' + (80*'='))
echo_normal('\n' + (80*'='))
pytext = 'for python-%s ' % pyver if pyver is not None else ''
click.echo('Building "%s" %s(%d/%d)' % \
echo_normal('Building "%s" %s(%d/%d)' % \
(recipe, pytext, order+1, len(recipes)))
click.echo((80*'=') + '\n')
echo_normal((80*'=') + '\n')
if not os.path.exists(os.path.join(recipe, 'meta.yaml')):
logger.info('Ignoring directory "%s" - no meta.yaml found' % recipe)
continue
......
#!/usr/bin/env python
import os
import logging
logger = logging.getLogger(__name__)
import click
from . import bdt
from ..log import verbosity_option
from ..release import get_gitlab_instance, update_files_with_mr
from ..log import verbosity_option, get_logger
logger = get_logger(__name__)
@click.command(epilog='''
Examples:
......
......@@ -3,20 +3,20 @@
import os
import sys
import logging
logger = logging.getLogger(__name__)
import pkg_resources
import click
import yaml
from . import bdt
from ..log import verbosity_option
from ..build import parse_dependencies, conda_create, make_conda_config
from ..constants import BASE_CONDARC, CONDA_BUILD_CONFIG, \
CONDA_RECIPE_APPEND, SERVER
from ..bootstrap import set_environment, get_channels
from ..log import verbosity_option, get_logger, echo_normal
logger = get_logger(__name__)
@click.command(epilog='''
Examples:
......@@ -138,4 +138,4 @@ def create(name, recipe_dir, python, overwrite, condarc, use_local, config,
deps = parse_dependencies(recipe_dir, conda_config)
status = conda_create(conda, name, overwrite, condarc_options, deps,
dry_run, use_local)
click.echo('Execute on your shell: "conda activate %s"' % name)
echo_normal('Execute on your shell: "conda activate %s"' % name)
......@@ -2,15 +2,14 @@
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
from sphinx.ext import intersphinx
import click
from . import bdt
from ..log import verbosity_option
from ..log import verbosity_option, get_logger
logger = get_logger(__name__)
@click.command(epilog='''
......
#!/usr/bin/env python
import os
import logging
logger = logging.getLogger(__name__)
import click
from . import bdt
from ..log import verbosity_option
from ..release import get_gitlab_instance, download_path
from ..log import verbosity_option, get_logger
logger = get_logger(__name__)
@click.command(epilog='''
Examples:
......
......@@ -2,16 +2,16 @@
import os
import shutil
import logging
import datetime
logger = logging.getLogger(__name__)
import click
import jinja2
import pkg_resources
from . import bdt
from ..log import verbosity_option
from ..log import verbosity_option, get_logger
logger = get_logger(__name__)
def copy_file(template, output_dir):
......
......@@ -4,17 +4,17 @@
import os
import logging
logger = logging.getLogger(__name__)
import click
from . import bdt
from ..log import verbosity_option
from ..release import release_bob, parse_and_process_package_changelog
from ..release import release_package, wait_for_pipeline_to_finish
from ..release import get_gitlab_instance
from ..log import verbosity_option, get_logger
logger = get_logger(__name__)
@click.command(epilog='''
Examples:
......
# -*- coding: utf-8
import functools
import logging
import os
import shutil
import threading
......@@ -15,6 +14,10 @@ from .connection import *
from .exceptions import *
from .urn import Urn
from ..log import get_logger
logger = get_logger(__name__)
try:
from urllib.parse import unquote, urlsplit
except ImportError:
......@@ -22,7 +25,6 @@ except ImportError:
from urlparse import urlsplit
__version__ = "0.2"
log = logging.getLogger(__name__)
def listdir(directory):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment