question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[discussion] should post-link/pre-unlink scripts output stderr/stdin?

See original GitHub issue

I 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:

feedstocks:

@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.

cc: @ilanschnell @ijstokes @kalefranz

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:28 (20 by maintainers)

github_iconTop GitHub Comments

3reactions
jakevdpcommented, Jun 9, 2016

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 of conda install, and jupyter nbextension uninstall packagename at the beginning conda remove. What’s the recommended alternative for this case?

1reaction
kalefranzcommented, Sep 30, 2016

It’s “just a file,” so use >> rather than >.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using stdout, stdin, and stderr in Node.js - LogRocket Blog
Learn about the standard streams including stdout, stdin, and stderr and how they can help you build programs in your Node.js application.
Read more >
What is STDOUT and STDERR in Linux - echo to STDERR
the Standard output STDOUT and Error STDERR helps to display the result to the user on the monitor.
Read more >
How to tell if output of a command or shell script is stdout or ...
There's no way to tell once the output has already been printed. In this case, both stdout and stderr are connected to the...
Read more >
Confused about stdin, stdout and stderr? - Stack Overflow
If my understanding is correct, stdin is the file in which a program writes into its requests to run a task in the...
Read more >
Linux Fundamentals - I/O, Standard Streams, and Redirection.
In this article we will discuss practical uses of redirection, ... input (stdin), standard output (stdout), and standard error (stderr).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found