From 1858aa85a8fde50fbc51a168b7d7bc518a4dd959 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Wed, 31 Jul 2024 18:00:46 +0200 Subject: [PATCH 1/6] Opt-in to python 3.8 This commit... 1. opts-in Helium to python 3.8 2. adjusts dependencies for python 3.8 plugin_host - "enum" is now built-in and no longer needed - "pyzmq" 26 however requires "tornado" library --- .python-version | 2 +- dependencies.json | 31 +++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.python-version b/.python-version index eb39e53..cc1923a 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.3 +3.8 diff --git a/dependencies.json b/dependencies.json index 642507d..77567f8 100644 --- a/dependencies.json +++ b/dependencies.json @@ -1,30 +1,53 @@ { "windows": { - "*": [ + "<4000": [ "dateutil", "enum", "python-six", - "pyzmq" + "pyzmq", + "tornado" + ], + ">=4000": [ + "dateutil", + "python-six", + "pyzmq", + "tornado" ] }, "osx": { - "*": [ + "<4000": [ "dateutil", "enum", "pexpect", "ptyprocess", "python-six", "pyzmq" + ], + ">=4000": [ + "dateutil", + "pexpect", + "ptyprocess", + "python-six", + "pyzmq", + "tornado" ] }, "linux": { - "*": [ + "<4000": [ "dateutil", "enum", "pexpect", "ptyprocess", "python-six", "pyzmq" + ], + ">=4000": [ + "dateutil", + "pexpect", + "ptyprocess", + "python-six", + "pyzmq", + "tornado" ] } } \ No newline at end of file From 9f199e7f506a1d7bd12a22a428254e4514995823 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Wed, 31 Jul 2024 18:07:45 +0200 Subject: [PATCH 2/6] Remove tornado for ST3 --- dependencies.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dependencies.json b/dependencies.json index 77567f8..da2ac48 100644 --- a/dependencies.json +++ b/dependencies.json @@ -4,8 +4,7 @@ "dateutil", "enum", "python-six", - "pyzmq", - "tornado" + "pyzmq" ], ">=4000": [ "dateutil", From 4e839c80171b254ffeec42daf92ddc618833eed5 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Wed, 31 Jul 2024 18:10:57 +0200 Subject: [PATCH 3/6] Fix syntax warnings --- lib/client/jupyter_client/manager.py | 2 +- lib/client/traitlets/config/loader.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/client/jupyter_client/manager.py b/lib/client/jupyter_client/manager.py index 3df36fd..f3888f0 100644 --- a/lib/client/jupyter_client/manager.py +++ b/lib/client/jupyter_client/manager.py @@ -78,7 +78,7 @@ def _kernel_name_changed(self, name, old, new): @property def kernel_spec(self): - if self._kernel_spec is None and self.kernel_name is not '': + if self._kernel_spec is None and self.kernel_name != '': self._kernel_spec = self.kernel_spec_manager.get_kernel_spec(self.kernel_name) return self._kernel_spec diff --git a/lib/client/traitlets/config/loader.py b/lib/client/traitlets/config/loader.py index 803b362..ae7e6c9 100644 --- a/lib/client/traitlets/config/loader.py +++ b/lib/client/traitlets/config/loader.py @@ -792,7 +792,7 @@ def _add_arguments(self, aliases=None, flags=None): nargs = '?' else: nargs = None - if len(key) is 1: + if len(key) == 1: paa('-'+key, '--'+key, type=text_type, dest=value, nargs=nargs) else: paa('--'+key, type=text_type, dest=value, nargs=nargs) @@ -801,7 +801,7 @@ def _add_arguments(self, aliases=None, flags=None): # self.alias_flags[self.aliases[key]] = value continue - if len(key) is 1: + if len(key) == 1: paa('-'+key, '--'+key, action='append_const', dest='_flags', const=value) else: paa('--'+key, action='append_const', dest='_flags', const=value) From 5caac511b74adc9d2f7a96d7ba898e7fa34535dc Mon Sep 17 00:00:00 2001 From: deathaxe Date: Wed, 31 Jul 2024 18:16:08 +0200 Subject: [PATCH 4/6] Fix regexp pattern --- lib/client/traitlets/config/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/traitlets/config/loader.py b/lib/client/traitlets/config/loader.py index ae7e6c9..7395b77 100644 --- a/lib/client/traitlets/config/loader.py +++ b/lib/client/traitlets/config/loader.py @@ -542,7 +542,7 @@ def _load_flag(self, cfg): # rejects: --anything=anything # --two.word -flag_pattern = re.compile(r'\-\-?\w+[\-\w]*$') +flag_pattern = re.compile(r'\-\-?\w[\-\w]*$') class KeyValueConfigLoader(CommandLineConfigLoader): """A config loader that loads key value pairs from the command line. From fe6204eaed25be8c4753bb24f6dc34b53e78a187 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Wed, 31 Jul 2024 18:20:31 +0200 Subject: [PATCH 5/6] Fix unused variable --- lib/client/traitlets/config/loader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/traitlets/config/loader.py b/lib/client/traitlets/config/loader.py index 7395b77..c9ef77e 100644 --- a/lib/client/traitlets/config/loader.py +++ b/lib/client/traitlets/config/loader.py @@ -669,7 +669,7 @@ def load_config(self, argv=None, aliases=None, flags=None): elif flag_pattern.match(raw): if item in flags: - cfg,help = flags[item] + cfg,_ = flags[item] self._load_flag(cfg) else: raise ArgumentError("Unrecognized flag: '%s'"%raw) From 2e44c674b5a2b08055bedbf7acef7cc05717e9b1 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Wed, 31 Jul 2024 18:21:55 +0200 Subject: [PATCH 6/6] Tweak README Remove ST version number. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index efb8b58..64b5660 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -Helium package for Sublime Text 3 +Helium package for Sublime Text === -Helium is a package for Sublime Text 3, which provides in-editor code execution and autocomplete in interaction with Jupyter kernels. -The concept of an editor extension communicating Jupyter kernels is inspired by @nteract's splendid Atom package [Hydrogen](https://github.com/nteract/Hydrogen). I want something like it in Sublime Text 3, too. +Helium is a package for Sublime Text, which provides in-editor code execution and autocomplete in interaction with Jupyter kernels. +The concept of an editor extension communicating Jupyter kernels is inspired by @nteract's splendid Atom package [Hydrogen](https://github.com/nteract/Hydrogen). I want something like it in Sublime Text, too. Any feedback is highly welcome. I hope this package will help your life with ST3!