Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: API for new envs #195

Open
apowers313 opened this issue Dec 20, 2020 · 1 comment
Open

Proposal: API for new envs #195

apowers313 opened this issue Dec 20, 2020 · 1 comment

Comments

@apowers313
Copy link

The problem: Jupyter, the scientific notebook platform, is often derided for it’s lack of reproducibility. A big part of that is lack of transparency around environment configuration, which envinfo can help with. I’d like to make a magic command for the JavaScript Jupyter environment that reports on the environment, and envinfo covers 90% of the variables I want to report on. The problem is “how do I gracefully add the last 10% of environment”, such as Jupyter version and git hash?

Proposed solution: A simple API exposed by envinfo to register new commands to run. Something like:

const envinfo = require('envinfo');

envinfo.addHelper({
    group: “Utilities”,
    name: “Jupyter”,
    cmd: “jupyter”,
    args: [“—version”],
    resultsParser: function parser(stdout, stderr) { /* ... */ return “6.1.5; }
});

The result would be a new line under “Utilities” that is “Jupyter: 6.1.5”.

I realize that I can exec my own code and parse the results, but doing that requires thinking of and handling all the scenarios that envinfo has already thought through (e.g. program doesn’t exist) and merging my results into the JSON object or Markdown.

Happy to submit a PR if this seems like a reasonable direction.

@ryhinchey
Copy link
Collaborator

this sounds like a great idea to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants