Repository: conda/conda-build

Issue:
--output is overly verbose
the output option is used by our scripts to determine the name of the file that is being generated. In all 2.* versions it used to print one single line with the FQFN. Unfortunately with 3.0.3, it starts to print many info lines as well which clutter the output...

```
$ conda build conda-receipe/ --output                                                                                                                        
Attempting to finalize metadata for dione-ci-scripts
INFO:conda_build.metadata:Attempting to finalize metadata for dione-ci-scripts
/home/gabm/miniconda3/conda-bld/linux-64/package-name.tar.bz2
```


Discussion:
Thanks for the report. There is a test for this, but it seems to not be
working. I'll investigate today.

On Jul 10, 2017 4:27 AM, "gabm" <notifications@github.com> wrote:

> the output option is used by our scripts to determine the name of the file
> that is being generated. In all 2.* versions it used to print one single
> line with the FQFN. Unfortunately with 3.0.3, it starts to print many info
> lines as well which clutter the output...
>
> $ conda build conda-receipe/ --output                                                                                                                       DontAskForUpload
> Attempting to finalize metadata for dione-ci-scripts
> INFO:conda_build.metadata:Attempting to finalize metadata for dione-ci-scripts
> /home/gabm/miniconda3/conda-bld/linux-64/package-name.tar.bz2
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/conda/conda-build/issues/2173>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AACV-cWaDFbqcc06r4FyQv0uUHmvMNcjks5sMe6ZgaJpZM4OSlNm>
> .
>

One workaround for now:

``conda render --output conda-receipe/``

Those CLI commands are identical; investigating why only one of them works.

Resolving patch:
diff --git a/conda_build/cli/main_build.py b/conda_build/cli/main_build.py
--- a/conda_build/cli/main_build.py
+++ b/conda_build/cli/main_build.py
@@ -261,7 +261,9 @@ def parse_args(args):
 
 def output_action(recipe, config):
     with LoggingContext(logging.CRITICAL + 1):
-        paths = api.get_output_file_paths(recipe)
+        config.verbose = False
+        config.debug = False
+        paths = api.get_output_file_paths(recipe, config=config)
         print('\n'.join(sorted(paths)))
 
 
diff --git a/conda_build/cli/main_render.py b/conda_build/cli/main_render.py
--- a/conda_build/cli/main_render.py
+++ b/conda_build/cli/main_render.py
@@ -147,7 +147,9 @@ def execute(args):
 
     if args.output:
         with LoggingContext(logging.CRITICAL + 1):
-            paths = api.get_output_file_paths(metadata_tuples)
+            config.verbose = False
+            config.debug = False
+            paths = api.get_output_file_paths(metadata_tuples, config=config)
             print('\n'.join(sorted(paths)))
     else:
         logging.basicConfig(level=logging.INFO)


Test patch:
diff --git a/tests/test_cli.py b/tests/test_cli.py
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -11,8 +11,6 @@
 
 import pytest
 
-from conda_build.conda_interface import download
-import conda
 from conda_build.conda_interface import download, reset_context
 from conda_build.tarcheck import TarCheck
 
@@ -88,11 +86,12 @@ def test_render_output_build_path(testing_workdir, testing_metadata, capfd, capl
     args = ['--output', os.path.join(testing_workdir)]
     main_render.execute(args)
     _hash = metadata._hash_dependencies()
-    test_path = "test_render_output_build_path-1.0-py{}{}{}_1.tar.bz2".format(
-                                      sys.version_info.major, sys.version_info.minor, _hash)
+    test_path = os.path.join(sys.prefix, "conda-bld", testing_metadata.config.host_subdir,
+                                  "test_render_output_build_path-1.0-py{}{}{}_1.tar.bz2".format(
+                                      sys.version_info.major, sys.version_info.minor, _hash))
     output, error = capfd.readouterr()
-    # assert error == ""
-    assert os.path.basename(output.rstrip()) == test_path, error
+    assert output.rstrip() == test_path, error
+    assert error == ""
 
 
 def test_build_output_build_path(testing_workdir, testing_metadata, testing_config, capfd):
@@ -107,8 +106,8 @@ def test_build_output_build_path(testing_workdir, testing_metadata, testing_conf
                                   "test_build_output_build_path-1.0-py{}{}{}_1.tar.bz2".format(
                                       sys.version_info.major, sys.version_info.minor, _hash))
     output, error = capfd.readouterr()
-    # assert error == ""
-    assert test_path in output.rstrip(), error
+    assert test_path == output.rstrip(), error
+    assert error == ""
 
 
 def test_build_output_build_path_multiple_recipes(testing_workdir, testing_metadata,