[discussion] should post-link/pre-unlink scripts output stderr/stdin?
See original GitHub issueI preemptively went through and found all of the post-link scripts based on my initial, naive pattern for using jupyter (server|nb)extension enable
and added them, but should have created this issue first… if only to make the below list more simply! Anyhow, by having them up there, we can already see the impact this might have.
staged recipes:
- https://github.com/conda-forge/staged-recipes/pull/702
- https://github.com/conda-forge/staged-recipes/pull/710
feedstocks:
- https://github.com/conda-forge/bqplot-feedstock/pull/3
- https://github.com/conda-forge/ipyleaflet-feedstock/pull/5
- https://github.com/conda-forge/nb_anacondacloud-feedstock/pull/1
- https://github.com/conda-forge/nbpresent-feedstock/pull/2
- https://github.com/conda-forge/pythreejs-feedstock/pull/3
- https://github.com/conda-forge/vega-feedstock/pull/1
- https://github.com/conda-forge/widgetsnbextension-feedstock/pull/12
@jakevdp What’s problematic about the output?
@jakirkham Agreed. I kind of like seeing this output as it tells me the post linking worked. Also, it is pretty short; so, don’t really find it a hindrance for following log output. Why should it be removed here or elsewhere?
I’ve heard from a few downstream users of conda with jupyter extensions that post-link/pre-unlink scripts generating output is a Bad Thing, specifically breaking assumptions about conda remove|install --json
. As conda
is increasingly used in more automated use cases, i.e. constructor
, provisioning tools, this seems pretty important to address.
Here is some example --json
output… very weird that it truncates the name in "fetch": "nb_anacondaclo"
… that’s not going to be super useful!
nbollweg@rocinante:~/Documents/projects/nbpresent (master)$ conda install --json nb_anacondacloud
Using Anaconda Cloud api site https://api.anaconda.org
{"maxval": 18683, "finished": false, "progress": 0, "fetch": "nb_anacondaclo"}
{"maxval": 18683, "finished": false, "progress": 16384, "fetch": "nb_anacondaclo"}
{"maxval": 18683, "finished": false, "progress": 18683, "fetch": "nb_anacondaclo"}
{"maxval": 18683, "finished": false, "progress": 18683, "fetch": "nb_anacondaclo"}
{"maxval": 18683, "finished": true, "progress": 18683, "fetch": "nb_anacondaclo"}
{"maxval": 1, "finished": false, "progress": 0}
{"maxval": 1, "finished": false, "progress": 0, "name": "nb_anacondacloud"}
{"maxval": 1, "finished": true, "progress": 1}
{"maxval": 12, "finished": false, "progress": 0}
{"maxval": 12, "finished": false, "progress": 0, "name": "yaml"}
{"maxval": 12, "finished": false, "progress": 1, "name": "funcsigs"}
{"maxval": 12, "finished": false, "progress": 2, "name": "pytz"}
{"maxval": 12, "finished": false, "progress": 3, "name": "pyyaml"}
{"maxval": 12, "finished": false, "progress": 4, "name": "requests"}
{"maxval": 12, "finished": false, "progress": 5, "name": "six"}
{"maxval": 12, "finished": false, "progress": 6, "name": "clyent"}
{"maxval": 12, "finished": false, "progress": 7, "name": "python-dateutil"}
{"maxval": 12, "finished": false, "progress": 8, "name": "anaconda-client"}
{"maxval": 12, "finished": false, "progress": 9, "name": "nb_config_manager"}
Enabling nb_config_manager in /Users/nbollweg/miniconda3/envs/nbpresent-foo/etc/jupyter
Existing config...
{}
New config...
{'NotebookApp': {'config_manager_class': 'nb_config_manager.EnvironmentConfigManager'}}
{"maxval": 12, "finished": false, "progress": 10, "name": "nbsetuptools"}
{"maxval": 12, "finished": false, "progress": 11, "name": "nb_anacondacloud"}
Installing nb_anacondacloud OK
Enabling nb_anacondacloud OK
{"maxval": 12, "finished": true, "progress": 12}
{
"actions": {
"EXTRACT": [
"nb_anacondacloud-0.2.0-py35_0"
],
"FETCH": [
"nb_anacondacloud-0.2.0-py35_0"
],
"LINK": [
"yaml-0.1.6-0 /Users/nbollweg/miniconda3/pkgs 1",
"funcsigs-0.4-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"pytz-2016.4-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"pyyaml-3.11-py35_4 /Users/nbollweg/miniconda3/pkgs 1",
"requests-2.10.0-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"six-1.10.0-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"clyent-1.2.2-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"python-dateutil-2.5.3-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"anaconda-client-1.4.0-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"nb_config_manager-0.1.3-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"nbsetuptools-0.1.5-py35_0 /Users/nbollweg/miniconda3/pkgs 1",
"nb_anacondacloud-0.2.0-py35_0 /Users/nbollweg/miniconda3/pkgs 1"
],
"PREFIX": "/Users/nbollweg/miniconda3/envs/nbpresent-foo",
"SYMLINK_CONDA": [
"/Users/nbollweg/miniconda3"
]
},
"success": true
}
Perhaps the “right” solution would be for conda install
to handle this more actively, and package stderr/stdout from post-link into some stanza, with the above generating something like:
{"maxval": 12, "finished": false, "progress": 11, "name": "nb_anacondacloud", "post-link": [
{"type": "out", "value": "Installing nb_anacondacloud OK"},
{"type": "out, "value": "Enabling nb_anacondacloud OK"}
]}
or, alternately:
{
"actions": {
"POST-LINK": {
"name": "nb_anacondacloud",
"output": [
{"type": "out", "value": "Installing nb_anacondacloud OK"},
{"type": "out, "value": "Enabling nb_anacondacloud OK"}
]
}
}
}
I haven’t looked into what it would take to change conda
to do this, but perhaps that is the easier fix.
Issue Analytics
- State:
- Created 7 years ago
- Comments:28 (20 by maintainers)
Top GitHub Comments
Regarding points 4-5: this means that jupyter nbextensions should not be installed/uninstalled using these scripts, because it depends on the
jupyter
package.These packages need to run, e.g.
jupyter nbextension install packagename
at the end ofconda install
, andjupyter nbextension uninstall packagename
at the beginningconda remove
. What’s the recommended alternative for this case?It’s “just a file,” so use
>>
rather than>
.