Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-github-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions environment-wasm-build.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions environment-wasm-host.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,7 +13,7 @@ dependencies:
- xeus-lite
- xeus
- xeus-python-shell>=0.6.3
- pyjs >=2,<3
- pyjs >=4,<5
- libpython
- zstd
- openssl
Expand Down
4 changes: 2 additions & 2 deletions include/xeus-python/xdebugger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -76,7 +76,7 @@ namespace xpyt

XEUS_PYTHON_API
std::unique_ptr<xeus::xdebugger> 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);
Expand Down
4 changes: 3 additions & 1 deletion include/xeus-python/xinterpreter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion include/xeus-python/xinterpreter_raw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/xcomm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>());
}
Expand Down
2 changes: 1 addition & 1 deletion src/xcomm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/xdebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -363,7 +363,7 @@ namespace xpyt
}

std::unique_ptr<xeus::xdebugger> 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)
Expand Down
2 changes: 1 addition & 1 deletion src/xdebugpy_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/xdebugpy_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 10 additions & 9 deletions src/xinterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,34 +302,35 @@ 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
PY_VERSION, // language_version
"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)
Expand Down
12 changes: 8 additions & 4 deletions src/xinterpreter_raw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,24 +311,28 @@ namespace xpyt
});

return xeus::create_info_reply(
"5.3", // protocol_version
"xeus-python", // implementation
XPYT_VERSION, // implementation_version
"python", // language_name
PY_VERSION, // language_version
"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)
Expand Down
4 changes: 2 additions & 2 deletions test/test_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::xkernel_configuration>(xeus::load_configuration(connection_file)), log_file)
{
}

Expand Down Expand Up @@ -1456,4 +1456,4 @@ TEST_SUITE("debugger")
t.notify_done();
}
}
}
}
4 changes: 2 additions & 2 deletions test/xeus_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -194,4 +194,4 @@ void xeus_logger_client::log_message(nl::json msg)
std::lock_guard<std::mutex> guard(m_file_mutex);
std::ofstream out(m_file_name, std::ios_base::app);
out << msg.dump(4) << std::endl;
}
}
4 changes: 2 additions & 2 deletions test/xeus_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -63,4 +63,4 @@ class xeus_logger_client
std::mutex m_file_mutex;

client_ptr p_client;
};
};