nteract / pick

⛏ Customize your kernels on Launch!
BSD 3-Clause "New" or "Revised" License
32 stars 8 forks source link

Create registration system #4

Closed rgbkrk closed 4 years ago

rgbkrk commented 4 years ago

In the style of papermill registration, create a system that allows us to register how we go from config text to kernel manager options. See papermill_io.register as prime examples papermill_translators.register.

The initial idea is we create our own magics registration namespace. It would look something like this for a user of the kernel:

%%kernel.conda-env-yaml
name: env-name
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - codecov

Whereas the implementer has their own package that calls our registration:

pick_kernel.kernels.register("conda-env-yaml", handler)

What do you think @MSeal & @willingc?

rgbkrk commented 4 years ago

With the yaml function for formatting decency on the frontend:


%%kernel.conda-env
yaml('''
name: env-name
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.7
  - codecov
''')
MSeal commented 4 years ago

I think it's a good idea, makes the interface flexible to be used with pre-existing syntax for configuration options in different organizations and tooling.

willingc commented 4 years ago

Oooh nice. I've been doing yaml, toml, json config in most of my work stuff these days.