vors / jupyter-powershell

PowerShell language kernel for Jupyter
MIT License
132 stars 26 forks source link

Modification of attribute banner to fix issue with launching with qtconsole command #14

Open hansonap opened 5 years ago

hansonap commented 5 years ago

See issue #13 for original bug details.

Updated the PowerShellKernel to use the traitlets model for the attribute banner. I've never used traitlets before, but that what the underlining ipykernel.Kernel is structured off of and what qtconsole.base_frontend_mixin.BaseFrontendMixin's _dispatch() is expecting.

Implementation:

  1. banner's type is set with banner = Unicode()
  2. banner's default value is provided with:
    @default('banner')
    def _banner_default(self):
       return check_output(['powershell', '$PSVersionTable.PSVersion']).decode('utf-8')
  3. no other traitlets methods were implemented

Questions for @vors

  1. Do you want me to increase the version in kernel.py? If so I assume 0.0.8, is that correct?
  2. Since the traitlets package is now being used, do I need to update any packaging requirements (I've contributed to code installable with pip before - a little out of my depth)?
  3. The following packages are marked as unused; do you want me to remove them?
    • os.unlink
    • base64
    • imghdr
    • signal
    • urllib

Other comments:

  1. As a result of fixing this the command line argument --FrontendWidget.banner=... now works, however this is the JupyterWidget(IPythonWidget)'s banner, not the kernel's banner.
vors commented 5 years ago
  1. Yes, let's bump the version
  2. That's a very good question, I haven't publish anything to pip that has a dependencies. I assume we need a requirements.txt now to support it. I'd very much appreciate if you figure out this story and share with me.
  3. Sure, feel free to remove them. Please use a separate PR for that.