Commit c048be79 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: pop no default, flush print

parent 29b41ca9
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import os import os
import sys import sys
from fsl_ci_utils import sprun, tempdir from fsl_ci_utils import sprun, tempdir, fprint
def pre_build_recipe(url, ref, output_dir, *channels): def pre_build_recipe(url, ref, output_dir, *channels):
...@@ -29,7 +29,7 @@ def build_recipe(recipe_dir, ref, output_dir, *channels): ...@@ -29,7 +29,7 @@ def build_recipe(recipe_dir, ref, output_dir, *channels):
env = dict(os.environ) env = dict(os.environ)
if ref == '': if ref == '':
env.pop('FSLCONDA_REVISION') env.pop('FSLCONDA_REVISION', None)
else: else:
env['FSLCONDA_REVISION'] = ref env['FSLCONDA_REVISION'] = ref
...@@ -89,14 +89,14 @@ def main(): ...@@ -89,14 +89,14 @@ def main():
sprun(f'conda index {local_channel}') sprun(f'conda index {local_channel}')
sprun('conda install -y -c conda-forge conda-build') sprun('conda install -y -c conda-forge conda-build')
print('************************************') fprint('************************************')
print(f'Building conda recipe for: {env["CI_PROJECT_NAME"]}') fprint(f'Building conda recipe for: {env["CI_PROJECT_NAME"]}')
print(f'Recipe URL: {env["CI_PROJECT_URL"]}') fprint(f'Recipe URL: {env["CI_PROJECT_URL"]}')
print(f'Pre-built packages: {prebuild}') fprint(f'Pre-built packages: {prebuild}')
print( 'Revision (empty means to build release') fprint( 'Revision (empty means to build release')
print(f' specified in meta.yaml): {project_ref}') fprint(f' specified in meta.yaml): {project_ref}')
print(f'FSL conda channel URL: {channel_url}') fprint(f'FSL conda channel URL: {channel_url}')
print('************************************') fprint('************************************')
build_recipe('.', project_ref, output_dir, local_channel, channel_url) build_recipe('.', project_ref, output_dir, local_channel, channel_url)
......
...@@ -16,6 +16,11 @@ import fsl_ci_utils.conda_api as api # noqa # pylint: disable=unused-import ...@@ -16,6 +16,11 @@ import fsl_ci_utils.conda_api as api # noqa # pylint: disable=unused-import
import fsl_ci_utils.conda as conda # noqa # pylint: disable=unused-import import fsl_ci_utils.conda as conda # noqa # pylint: disable=unused-import
def fprint(*args, **kwargs):
"""Print with flush=True. """
print(*args, **kwargs, flush=True)
@ctxlib.contextmanager @ctxlib.contextmanager
def tempdir(): def tempdir():
"""Context manager to create, and change into, a temporary directory, and """Context manager to create, and change into, a temporary directory, and
......
Supports Markdown
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