From 4cba7d82ce64ff40374bc645799ae822afc3aa47 Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Mon, 3 Jun 2024 22:07:04 +0200 Subject: [PATCH] Upgraded to xeus-python-shell 0.6.3 --- environment-dev.yml | 2 +- environment-wasm-host.yml | 2 +- include/xeus-python/xinterpreter.hpp | 1 + include/xeus-python/xinterpreter_wasm.hpp | 4 ++++ src/xinterpreter.cpp | 6 +++++- src/xinterpreter_wasm.cpp | 4 ++++ 6 files changed, 16 insertions(+), 3 deletions(-) diff --git a/environment-dev.yml b/environment-dev.yml index dbd81eb8..0578b689 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -12,7 +12,7 @@ dependencies: - nlohmann_json=3.11.3 - pybind11>=2.6.1,<3.0 - pybind11_json>=0.2.6,<0.3 - - xeus-python-shell>=0.5.0,<0.6 + - xeus-python-shell>=0.6.3,<0.7 - debugpy>=1.6.5 # Test dependencies - pytest diff --git a/environment-wasm-host.yml b/environment-wasm-host.yml index 27e7840a..5fe68e6d 100644 --- a/environment-wasm-host.yml +++ b/environment-wasm-host.yml @@ -11,7 +11,7 @@ dependencies: - numpy - xeus-lite - xeus - - xeus-python-shell>=0.5 + - xeus-python-shell>=0.6.3 - pyjs>=2.0.0 - requests-wasm-polyfill>=0.3.0 - libpython diff --git a/include/xeus-python/xinterpreter.hpp b/include/xeus-python/xinterpreter.hpp index 7409fc8d..86727408 100644 --- a/include/xeus-python/xinterpreter.hpp +++ b/include/xeus-python/xinterpreter.hpp @@ -102,6 +102,7 @@ namespace xpyt private: virtual void instanciate_ipython_shell(); + virtual bool use_jedi_for_completion() const; }; } diff --git a/include/xeus-python/xinterpreter_wasm.hpp b/include/xeus-python/xinterpreter_wasm.hpp index 8f616dd5..617ec7d4 100644 --- a/include/xeus-python/xinterpreter_wasm.hpp +++ b/include/xeus-python/xinterpreter_wasm.hpp @@ -34,6 +34,10 @@ namespace xpyt protected: void configure_impl() override; + + private: + + bool use_jedi_for_completion() const override; }; } diff --git a/src/xinterpreter.cpp b/src/xinterpreter.cpp index 29244d65..6c094064 100644 --- a/src/xinterpreter.cpp +++ b/src/xinterpreter.cpp @@ -80,7 +80,7 @@ namespace xpyt instanciate_ipython_shell(); - m_ipython_shell_app.attr("initialize")(); + m_ipython_shell_app.attr("initialize")(use_jedi_for_completion()); m_ipython_shell = m_ipython_shell_app.attr("shell"); // Setting kernel property owning the CommManager and get_parent @@ -383,4 +383,8 @@ namespace xpyt m_ipython_shell_app = py::module::import("xeus_python_shell.shell").attr("XPythonShellApp")(); } + bool interpreter::use_jedi_for_completion() const + { + return true; + } } diff --git a/src/xinterpreter_wasm.cpp b/src/xinterpreter_wasm.cpp index cff7e76e..38c3e205 100644 --- a/src/xinterpreter_wasm.cpp +++ b/src/xinterpreter_wasm.cpp @@ -39,4 +39,8 @@ namespace xpyt py::module::import("pyjs"); } + bool wasm_interpreter::use_jedi_for_completion() const + { + return false; + } }