Skip to content

Commit 3ebc27c

Browse files
committed
Upgraded to xeus 6
1 parent 4664544 commit 3ebc27c

12 files changed

Lines changed: 36 additions & 27 deletions

environment-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- ninja
99
- cmake < 4 # TODO: remove pin on CMake
1010
# Host dependencies
11-
- xeus-zmq>=3.1,<4.0
11+
- xeus-zmq>=4,<5
1212
- nlohmann_json=3.12.0
1313
- pybind11>=2.6.1,<3.0
1414
- pybind11_json>=0.2.6,<0.3

environment-wasm-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: xeus-python-wasm-build
22
channels:
3-
- https://prefix.dev/emscripten-forge-dev
3+
- https://prefix.dev/emscripten-forge-4x
44
- conda-forge
55
dependencies:
66
- cmake
7-
- emscripten_emscripten-wasm32==3.1.73
7+
- emscripten_emscripten-wasm32
88
- pip
99
- python=3.13
1010
- yarn

environment-wasm-host.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: xeus-python-wasm-host
22
channels:
3-
- https://prefix.dev/emscripten-forge-dev
3+
- https://prefix.dev/emscripten-forge-4x
44
- https://prefix.dev/conda-forge
55
dependencies:
66
- ipython

include/xeus-python/xinterpreter.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ namespace xpyt
6767

6868
nl::json kernel_info_request_impl() override;
6969

70-
void shutdown_request_impl() override;
70+
nl::json shutdown_request_impl(bool restart) override;
71+
72+
nl::json interrupt_request_impl() override;
7173

7274
nl::json internal_request_impl(const nl::json& content) override;
7375

include/xeus-python/xinterpreter_raw.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ namespace xpyt
6565

6666
nl::json kernel_info_request_impl() override;
6767

68-
void shutdown_request_impl() override;
68+
nl::json shutdown_request_impl(bool restart) override;
69+
70+
nl::json interrupt_request_impl() override;
6971

7072
void set_request_context(xeus::xrequest_context context) override;
7173
const xeus::xrequest_context& get_request_context() const noexcept override;

src/xcomm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ namespace xpyt
8282
m_comm.on_close(cpp_callback(callback));
8383
}
8484

85-
xeus::xtarget* xcomm::target(const py::object& target_name) const
85+
const xeus::xtarget* xcomm::target(const py::object& target_name) const
8686
{
8787
return xeus::get_interpreter().comm_manager().target(target_name.cast<std::string>());
8888
}

src/xcomm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace xpyt
4040

4141
private:
4242

43-
xeus::xtarget* target(const py::object& target_name) const;
43+
const xeus::xtarget* target(const py::object& target_name) const;
4444
xeus::xguid id(const py::kwargs& kwargs) const;
4545
cpp_callback_type cpp_callback(const python_callback_type& callback) const;
4646

src/xinterpreter.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,34 +302,35 @@ namespace xpyt
302302

303303
bool has_debugger = (PY_MAJOR_VERSION != 3) || (PY_MAJOR_VERSION != 13);
304304
nl::json rep = xeus::create_info_reply(
305-
"5.5", // protocol_version - overwrited in xeus core
306305
"xeus-python", // implementation
307306
XPYT_VERSION, // implementation_version
308307
"python", // language_name
309308
PY_VERSION, // language_version
310309
"text/x-python", // language_mimetype
311310
".py", // language_file_extension
312311
"ipython" + std::to_string(PY_MAJOR_VERSION), // pygments_lexer
313-
R"({"name": "ipython", "version": )" + std::to_string(PY_MAJOR_VERSION) + "}",
312+
nl::json{{"name", "ipython"}, {"version", std::to_string(PY_MAJOR_VERSION)}},
314313
"python", // language_nbconvert_exporter
315314
banner, // banner
316-
has_debugger, // debugger
317315
help_links // help_links
318316
);
319-
// use a dict, string seems to be not supported by the frontend
320-
rep["language_info"]["codemirror_mode"] = nl::json::object({
321-
{"name", "ipython"},
322-
{"version", PY_MAJOR_VERSION}
323-
});
317+
324318
if (has_debugger)
325319
{
326320
rep["supported_features"] = nl::json::array({"debugger"});
327321
}
322+
328323
return rep;
329324
}
330325

331-
void interpreter::shutdown_request_impl()
326+
nl::json interpreter::shutdown_request_impl(bool /*restart*/)
327+
{
328+
return xeus::create_shutdown_reply(false);
329+
}
330+
331+
nl::json interpreter::interrupt_request_impl()
332332
{
333+
return xeus::create_interrupt_reply();
333334
}
334335

335336
nl::json interpreter::internal_request_impl(const nl::json& content)

src/xinterpreter_raw.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,24 +311,28 @@ namespace xpyt
311311
});
312312

313313
return xeus::create_info_reply(
314-
"5.3", // protocol_version
315314
"xeus-python", // implementation
316315
XPYT_VERSION, // implementation_version
317316
"python", // language_name
318317
PY_VERSION, // language_version
319318
"text/x-python", // language_mimetype
320319
".py", // language_file_extension
321320
"ipython" + std::to_string(PY_MAJOR_VERSION), // pygments_lexer
322-
R"({"name": "ipython", "version": )" + std::to_string(PY_MAJOR_VERSION) + "}", // language_codemirror_mode
321+
nl::json{{"name", "ipython"}, {"version", std::to_string(PY_MAJOR_VERSION)}},
323322
"python", // language_nbconvert_exporter
324323
banner, // banner
325-
false, // debugger
326324
help_links // help_links
327325
);
328326
}
329327

330-
void raw_interpreter::shutdown_request_impl()
328+
nl::json raw_interpreter::shutdown_request_impl(bool /*restart*/)
331329
{
330+
return xeus::create_shutdown_reply(false);
331+
}
332+
333+
nl::json raw_interpreter::interrupt_request_impl()
334+
{
335+
return xeus::create_interrupt_reply();
332336
}
333337

334338
void raw_interpreter::set_request_context(xeus::xrequest_context context)

test/test_debugger.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ debugger_client::debugger_client(xeus::xcontext& context,
433433
const std::string& connection_file,
434434
const std::string& log_file)
435435
: m_client(context, "debugger_client",
436-
xeus::load_configuration(connection_file), log_file)
436+
std::get<xeus::xkernel_configuration>(xeus::load_configuration(connection_file)), log_file)
437437
{
438438
}
439439

@@ -1456,4 +1456,4 @@ TEST_SUITE("debugger")
14561456
t.notify_done();
14571457
}
14581458
}
1459-
}
1459+
}

0 commit comments

Comments
 (0)