diff --git a/.github/workflows/deploy-github-page.yml b/.github/workflows/deploy-github-page.yml index 4f60b9f0..08c3fc70 100644 --- a/.github/workflows/deploy-github-page.yml +++ b/.github/workflows/deploy-github-page.yml @@ -42,7 +42,7 @@ jobs: run: | micromamba create \ -f environment-wasm-host.yml --platform=emscripten-wasm32 \ - -c https://prefix.dev/emscripten-forge-dev \ + -c https://prefix.dev/emscripten-forge-4x \ -c https://prefix.dev/conda-forge set -eux diff --git a/environment-dev.yml b/environment-dev.yml index be0e6932..7c8335ec 100644 --- a/environment-dev.yml +++ b/environment-dev.yml @@ -8,7 +8,7 @@ dependencies: - ninja - cmake < 4 # TODO: remove pin on CMake # Host dependencies - - xeus-zmq>=3.1,<4.0 + - xeus-zmq>=4,<5 - nlohmann_json=3.12.0 - pybind11>=2.6.1,<3.0 - pybind11_json>=0.2.6,<0.3 diff --git a/environment-wasm-build.yml b/environment-wasm-build.yml index 617bf918..a9bb8778 100644 --- a/environment-wasm-build.yml +++ b/environment-wasm-build.yml @@ -1,10 +1,10 @@ name: xeus-python-wasm-build channels: - - https://prefix.dev/emscripten-forge-dev + - https://prefix.dev/emscripten-forge-4x - conda-forge dependencies: - cmake - - emscripten_emscripten-wasm32==3.1.73 + - emscripten_emscripten-wasm32 - pip - python=3.13 - yarn diff --git a/environment-wasm-host.yml b/environment-wasm-host.yml index 72e89111..deaf8b7f 100644 --- a/environment-wasm-host.yml +++ b/environment-wasm-host.yml @@ -1,6 +1,6 @@ name: xeus-python-wasm-host channels: - - https://prefix.dev/emscripten-forge-dev + - https://prefix.dev/emscripten-forge-4x - https://prefix.dev/conda-forge dependencies: - ipython @@ -13,7 +13,7 @@ dependencies: - xeus-lite - xeus - xeus-python-shell>=0.6.3 - - pyjs >=2,<3 + - pyjs >=4,<5 - libpython - zstd - openssl diff --git a/include/xeus-python/xdebugger.hpp b/include/xeus-python/xdebugger.hpp index a7268818..6c7743ae 100644 --- a/include/xeus-python/xdebugger.hpp +++ b/include/xeus-python/xdebugger.hpp @@ -41,7 +41,7 @@ namespace xpyt using base_type = xeus::xdebugger_base; debugger(xeus::xcontext& context, - const xeus::xconfiguration& config, + const xeus::xkernel_configuration& config, const std::string& user_name, const std::string& session_id, const nl::json& debugger_config); @@ -76,7 +76,7 @@ namespace xpyt XEUS_PYTHON_API std::unique_ptr make_python_debugger(xeus::xcontext& context, - const xeus::xconfiguration& config, + const xeus::xkernel_configuration& config, const std::string& user_name, const std::string& session_id, const nl::json& debugger_config); diff --git a/include/xeus-python/xinterpreter.hpp b/include/xeus-python/xinterpreter.hpp index 86727408..8333331b 100644 --- a/include/xeus-python/xinterpreter.hpp +++ b/include/xeus-python/xinterpreter.hpp @@ -67,7 +67,9 @@ namespace xpyt nl::json kernel_info_request_impl() override; - void shutdown_request_impl() override; + nl::json shutdown_request_impl(bool restart) override; + + nl::json interrupt_request_impl() override; nl::json internal_request_impl(const nl::json& content) override; diff --git a/include/xeus-python/xinterpreter_raw.hpp b/include/xeus-python/xinterpreter_raw.hpp index 3305e072..03532a87 100644 --- a/include/xeus-python/xinterpreter_raw.hpp +++ b/include/xeus-python/xinterpreter_raw.hpp @@ -65,7 +65,9 @@ namespace xpyt nl::json kernel_info_request_impl() override; - void shutdown_request_impl() override; + nl::json shutdown_request_impl(bool restart) override; + + nl::json interrupt_request_impl() override; void set_request_context(xeus::xrequest_context context) override; const xeus::xrequest_context& get_request_context() const noexcept override; diff --git a/src/xcomm.cpp b/src/xcomm.cpp index 5ec5e392..1f4a6a38 100644 --- a/src/xcomm.cpp +++ b/src/xcomm.cpp @@ -82,7 +82,7 @@ namespace xpyt m_comm.on_close(cpp_callback(callback)); } - xeus::xtarget* xcomm::target(const py::object& target_name) const + const xeus::xtarget* xcomm::target(const py::object& target_name) const { return xeus::get_interpreter().comm_manager().target(target_name.cast()); } diff --git a/src/xcomm.hpp b/src/xcomm.hpp index 2a975a83..717b1410 100644 --- a/src/xcomm.hpp +++ b/src/xcomm.hpp @@ -40,7 +40,7 @@ namespace xpyt private: - xeus::xtarget* target(const py::object& target_name) const; + const xeus::xtarget* target(const py::object& target_name) const; xeus::xguid id(const py::kwargs& kwargs) const; cpp_callback_type cpp_callback(const python_callback_type& callback) const; diff --git a/src/xdebugger.cpp b/src/xdebugger.cpp index 700e4702..58d534da 100644 --- a/src/xdebugger.cpp +++ b/src/xdebugger.cpp @@ -43,7 +43,7 @@ using namespace std::placeholders; namespace xpyt { debugger::debugger(xeus::xcontext& context, - const xeus::xconfiguration& config, + const xeus::xkernel_configuration& config, const std::string& user_name, const std::string& session_id, const nl::json& debugger_config) @@ -363,7 +363,7 @@ namespace xpyt } std::unique_ptr make_python_debugger(xeus::xcontext& context, - const xeus::xconfiguration& config, + const xeus::xkernel_configuration& config, const std::string& user_name, const std::string& session_id, const nl::json& debugger_config) diff --git a/src/xdebugpy_client.cpp b/src/xdebugpy_client.cpp index f6825530..bad415dd 100644 --- a/src/xdebugpy_client.cpp +++ b/src/xdebugpy_client.cpp @@ -20,7 +20,7 @@ namespace nl = nlohmann; namespace xpyt { xdebugpy_client::xdebugpy_client(xeus::xcontext& context, - const xeus::xconfiguration& config, + const xeus::xkernel_configuration& config, int socket_linger, const xdap_tcp_configuration& dap_config, const event_callback& cb) diff --git a/src/xdebugpy_client.hpp b/src/xdebugpy_client.hpp index 0f83e5e0..451226fe 100644 --- a/src/xdebugpy_client.hpp +++ b/src/xdebugpy_client.hpp @@ -26,7 +26,7 @@ namespace xpyt using event_callback = base_type::event_callback; xdebugpy_client(xeus::xcontext& context, - const xeus::xconfiguration& config, + const xeus::xkernel_configuration& config, int socket_linger, const xdap_tcp_configuration& dap_config, const event_callback& cb); diff --git a/src/xinterpreter.cpp b/src/xinterpreter.cpp index 58921ce9..4e687b32 100644 --- a/src/xinterpreter.cpp +++ b/src/xinterpreter.cpp @@ -302,7 +302,6 @@ namespace xpyt bool has_debugger = (PY_MAJOR_VERSION != 3) || (PY_MAJOR_VERSION != 13); nl::json rep = xeus::create_info_reply( - "5.5", // protocol_version - overwrited in xeus core "xeus-python", // implementation XPYT_VERSION, // implementation_version "python", // language_name @@ -310,26 +309,28 @@ namespace xpyt "text/x-python", // language_mimetype ".py", // language_file_extension "ipython" + std::to_string(PY_MAJOR_VERSION), // pygments_lexer - R"({"name": "ipython", "version": )" + std::to_string(PY_MAJOR_VERSION) + "}", + nl::json{{"name", "ipython"}, {"version", std::to_string(PY_MAJOR_VERSION)}}, "python", // language_nbconvert_exporter banner, // banner - has_debugger, // debugger help_links // help_links ); - // use a dict, string seems to be not supported by the frontend - rep["language_info"]["codemirror_mode"] = nl::json::object({ - {"name", "ipython"}, - {"version", PY_MAJOR_VERSION} - }); + if (has_debugger) { rep["supported_features"] = nl::json::array({"debugger"}); } + return rep; } - void interpreter::shutdown_request_impl() + nl::json interpreter::shutdown_request_impl(bool /*restart*/) + { + return xeus::create_shutdown_reply(false); + } + + nl::json interpreter::interrupt_request_impl() { + return xeus::create_interrupt_reply(); } nl::json interpreter::internal_request_impl(const nl::json& content) diff --git a/src/xinterpreter_raw.cpp b/src/xinterpreter_raw.cpp index 0282f454..b1115336 100644 --- a/src/xinterpreter_raw.cpp +++ b/src/xinterpreter_raw.cpp @@ -311,7 +311,6 @@ namespace xpyt }); return xeus::create_info_reply( - "5.3", // protocol_version "xeus-python", // implementation XPYT_VERSION, // implementation_version "python", // language_name @@ -319,16 +318,21 @@ namespace xpyt "text/x-python", // language_mimetype ".py", // language_file_extension "ipython" + std::to_string(PY_MAJOR_VERSION), // pygments_lexer - R"({"name": "ipython", "version": )" + std::to_string(PY_MAJOR_VERSION) + "}", // language_codemirror_mode + nl::json{{"name", "ipython"}, {"version", std::to_string(PY_MAJOR_VERSION)}}, "python", // language_nbconvert_exporter banner, // banner - false, // debugger help_links // help_links ); } - void raw_interpreter::shutdown_request_impl() + nl::json raw_interpreter::shutdown_request_impl(bool /*restart*/) { + return xeus::create_shutdown_reply(false); + } + + nl::json raw_interpreter::interrupt_request_impl() + { + return xeus::create_interrupt_reply(); } void raw_interpreter::set_request_context(xeus::xrequest_context context) diff --git a/test/test_debugger.cpp b/test/test_debugger.cpp index 208c07af..23e515f3 100644 --- a/test/test_debugger.cpp +++ b/test/test_debugger.cpp @@ -433,7 +433,7 @@ debugger_client::debugger_client(xeus::xcontext& context, const std::string& connection_file, const std::string& log_file) : m_client(context, "debugger_client", - xeus::load_configuration(connection_file), log_file) + std::get(xeus::load_configuration(connection_file)), log_file) { } @@ -1456,4 +1456,4 @@ TEST_SUITE("debugger") t.notify_done(); } } -} \ No newline at end of file +} diff --git a/test/xeus_client.cpp b/test/xeus_client.cpp index 4f87268b..0d766aef 100644 --- a/test/xeus_client.cpp +++ b/test/xeus_client.cpp @@ -25,7 +25,7 @@ using namespace std::chrono_literals; xeus_logger_client::xeus_logger_client(xeus::xcontext& context, const std::string& user_name, - const xeus::xconfiguration& config, + const xeus::xkernel_configuration& config, const std::string& file_name) : m_user_name(user_name) , m_file_name(file_name) @@ -194,4 +194,4 @@ void xeus_logger_client::log_message(nl::json msg) std::lock_guard guard(m_file_mutex); std::ofstream out(m_file_name, std::ios_base::app); out << msg.dump(4) << std::endl; -} \ No newline at end of file +} diff --git a/test/xeus_client.hpp b/test/xeus_client.hpp index 25ba9fa1..3a584095 100644 --- a/test/xeus_client.hpp +++ b/test/xeus_client.hpp @@ -31,7 +31,7 @@ class xeus_logger_client xeus_logger_client(xeus::xcontext& context, const std::string& user_name, - const xeus::xconfiguration& config, + const xeus::xkernel_configuration& config, const std::string& file_name); virtual ~xeus_logger_client(); @@ -63,4 +63,4 @@ class xeus_logger_client std::mutex m_file_mutex; client_ptr p_client; -}; \ No newline at end of file +};