conda-build
conda-build copied to clipboard
Need option to output list of files at end of CLI build
Actual Behavior
Using conda-build with the option --output doesn't seem to actually build the package. It will go through some steps but stops at actually creating the complete package. The filename that is returned does not exist.
Expected Behavior
With --output the package should still be built.
Steps to Reproduce
Run conda-build with the --output option.
Output of conda info
From the help:
--output Output the conda package filename which would have
been created
This command is functioning exactly as intended. It only outputs the package name that would have been created, if you hadn't used --output. What were you hoping this flag would do?
I misunderstood the help then, my bad.
I would have liked if it would build the package and then output the name. This could then be used for automated building of conda packages and deploying these to private conda channels.
If you use the python api, the return of the conda_build.api.build command is a list of paths to packages built. Really, though, you should be using the --user
or --token
flags to pass your anaconda.org user or token for for the private channel, so you can avoid keeping track of packages at all. If you specify --user or --token, automatic upload gets turned on.
I don't want to upload to the normal repository. I want to upload to a custom internal channel. I do not want to upload to anaconda.org.
I see, yes, we don't support that right now. In that case, your best option is to call conda-build twice: once to do the build, and again to get the output filenames. Alternatively, you could specify the --output_folder flag, which will be where your artifacts will go, and then gather your outputs as the contents of the artifacts folder.
For example, something like this might work:
conda build --output_folder some_existing_folder your_recipe
pushd some_existing_folder/linux-64
anaconda upload $(ls *.tar.bz2)
popd
Otherwise, people have long used patterns like this:
conda build your_recipe
anaconda upload $(conda build --output your_recipe)
This is less desirable because it takes longer, and is more prone to bugs in conda-build. We haven't seen those bugs in a while, but they were a concern historically.
I have a way of using it at this moment, use --output-folder and then have a for loop in bash upload the created conda package. It would have just been slightly easier with the actual filename
Yeah, sorry about that. I think the best way to achieve that might be to add some extra meaning to the --quiet flag, so that it hides the rest of the output from the build, but ultimately outputs just the list of files produced. I can't take that on right now, but I can add it to our backlog if you'd like.
I think adding it to the backlog might be a good idea.
I changed the title to reflect the request, and I'll hope to get to it soon.
Hi there, thank you for your contribution!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.
If you would like this issue to remain open please:
- Verify that you can still reproduce the issue at hand
- Comment that the issue is still reproducible and include: - What OS and version you reproduced the issue on - What steps you followed to reproduce the issue
NOTE: If this issue was closed prematurely, please leave a comment.
Thanks!