-
Notifications
You must be signed in to change notification settings - Fork 79
async-kernel #697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JohanMabille
merged 158 commits into
jupyter-xeus:main
from
DerThorsten:async_and_fixes2
Apr 14, 2026
Merged
async-kernel #697
Changes from all commits
Commits
Show all changes
158 commits
Select commit
Hold shift + click to select a range
b33908f
Fix context errors
IsabelParedes 0adb618
Working build
IsabelParedes 7ec1dce
Working without debugger
IsabelParedes 71cf45c
Not working
IsabelParedes 6526c65
Partially working
IsabelParedes f167fdb
Working
IsabelParedes f1290dc
Rename xhook
IsabelParedes ca0b1fd
Move hook
IsabelParedes b94c546
Add uvw dependency
IsabelParedes e4241b3
Ignore pybind11 visibility warning
IsabelParedes edad43f
Clean hook
IsabelParedes 8c685c6
Clean main
IsabelParedes 3de5865
Fix hook implementaion
IsabelParedes c7be18d
merged
DerThorsten 44f8a31
updates
DerThorsten 8a7cc27
remove mac-13
DerThorsten 0a8469f
movin find uv related code to non-emscripten branch
DerThorsten 3f93c9b
working
DerThorsten 9a3468b
libuv
DerThorsten 9dd02a4
libuv
DerThorsten 565eb44
path
DerThorsten 8924b65
path
DerThorsten 1d5b863
path
DerThorsten 1b69129
widgets
DerThorsten 88494df
build xeus-uv
DerThorsten 04488e4
add uvloop
DerThorsten 6fcedf2
debugger
DerThorsten f992408
debugger
DerThorsten 3ec1f4e
remove xeus-uv after building
DerThorsten f064138
special win env
DerThorsten f7d0707
use winloop
DerThorsten 3c93e82
debug
DerThorsten 2b9c47f
move
DerThorsten 6f93c42
debug
DerThorsten 14b7b79
native runner
DerThorsten e653348
native runner
DerThorsten 996ffce
native runner
DerThorsten 4ebb635
native runner
DerThorsten 3cde4bb
remove uv
DerThorsten 30484fb
fix debugger bug
DerThorsten 762d3e9
fix raw kernel
DerThorsten 72bbf92
fix raw kernel
DerThorsten c6bca8a
use one global dict
DerThorsten d819940
fixes
DerThorsten f157b1e
time based win
DerThorsten ef0d671
time based win
DerThorsten 8e7be86
time based win
DerThorsten e2e91b8
first c++ tests
DerThorsten 6942240
remove activation
DerThorsten 85f110b
remove activation
DerThorsten 659aa42
remove activation
DerThorsten edcc4d9
remove activation
DerThorsten ba03df8
remove activation
DerThorsten 5148f51
dont build extension
DerThorsten 887888e
use dummy in stop
DerThorsten c9debbb
activate
DerThorsten 72dec6f
build extension again
DerThorsten 3abd2f0
build extension again
DerThorsten 97e12ba
use reader
DerThorsten 090f535
use reader
DerThorsten 428bb9f
use reader
DerThorsten 6059c30
use reader
DerThorsten 835ec30
fix
DerThorsten 23f05ea
fix
DerThorsten 5960c82
fix
DerThorsten 7a1fa8f
fix
DerThorsten 604613d
fix
DerThorsten cf4bbfa
fixes
DerThorsten 1315e04
fixes
DerThorsten d1afdb4
fixes
DerThorsten 5d9972f
fixes
DerThorsten eb76726
fixes
DerThorsten 5f00b20
fixes
DerThorsten 091a8bf
fixes
DerThorsten 4214603
fixes
DerThorsten 264f7a5
fixes
DerThorsten ffb3b0f
more
DerThorsten 13778ee
more
DerThorsten b9a9826
more
DerThorsten ae16a96
more
DerThorsten 4f667a5
more
DerThorsten 2bd30a8
more
DerThorsten acf7c65
more
DerThorsten 0b69b19
more
DerThorsten 51c4967
more
DerThorsten e7f6550
more
DerThorsten d99c17b
more
DerThorsten ef0820d
more
DerThorsten 97edd8d
more
DerThorsten abcdf81
more info
DerThorsten 50bbcfc
more info
DerThorsten ec209c6
even more
DerThorsten a234d29
even more
DerThorsten fc2e031
even more
DerThorsten 550fffc
no more specta
DerThorsten c6d6595
no more specta
DerThorsten 7b79068
no more specta
DerThorsten 210127f
no more specta
DerThorsten 0307683
no more specta
DerThorsten 03baf67
no more specta
DerThorsten 65ae1af
win experiment
DerThorsten e7f717d
win experiment
DerThorsten efaca54
win experiment
DerThorsten 329b34a
use selector event loop
DerThorsten 3ee6bc8
win experiment
DerThorsten 7f438e9
win experiment
DerThorsten 15abfed
adding default runner to xeus python st. we can add cout stuff
DerThorsten 69ab3dc
missing break
DerThorsten a569228
cleanup
DerThorsten 6ad6c05
applied #685 to async pr
Klaim 79b7d72
added missing boost dependency
Klaim 7804a3a
ignore root build dirs
Klaim 64e2281
added missing boost packages dependencies
Klaim cc82bb0
non-buisy
DerThorsten e908f93
retrigger-ci
DerThorsten eb4b0ed
try buisy
DerThorsten 051a65f
socket
DerThorsten 2007176
socket
DerThorsten 4e71e00
Merge branch 'main' into async
DerThorsten 2c40c73
merged
DerThorsten 42dfadc
hidden
DerThorsten d6a1d1c
add missing method
DerThorsten bfded75
hidden macro
DerThorsten 853bafa
win fix
DerThorsten 300bad8
debug duct tape and more info
Klaim b9cf567
removed msvc-specific instruction
Klaim 039101a
tests wait for xpython's ready message instead of sleep
Klaim 673d238
debug duct tape and more info
Klaim c698cc2
fi
DerThorsten b753ade
fix
DerThorsten 86eb2da
x6
DerThorsten f5aa385
one minute
DerThorsten b7f6310
added eval
DerThorsten 9622204
run tests 20 times for win
DerThorsten 89b4450
powershell syntax
DerThorsten 1974d29
use default runner
DerThorsten 34146ce
publich error
DerThorsten 04d479e
clean internal request impl
DerThorsten 3fed2e9
remoev unused file in cmake
DerThorsten a862341
fix info request
DerThorsten 596836c
fix typo like errors
DerThorsten 60837d8
trigger run
DerThorsten e0cc7ec
cleanup
DerThorsten 8ec9c63
cleaner fix: lock python's GIL when destroying the debugger
Klaim 5ae5475
cleanup python path deduction unicode-friendly (on windows) and absol…
Klaim 85eb7cc
Merge branch 'main' into async_and_fixes2
DerThorsten adceb3f
removed buisy loop
DerThorsten 70e2782
Merge branch 'async_and_fixes2' of github.com:DerThorsten/xeus-python…
DerThorsten 8ded1c2
cleanup path
DerThorsten 4d0d193
cleanup pass 2
DerThorsten 3996c0e
toplevel await test
DerThorsten 0911a62
cleanup
DerThorsten 8e6f079
cleanup
DerThorsten bdb912e
cleanup
DerThorsten 263c228
cleanup
DerThorsten e401352
trigger ci
DerThorsten 67de522
using released xeus-python-shell
DerThorsten cb9aaf0
using released xeus-python-shell
DerThorsten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,5 @@ dependencies: | |
| - jupyterlite-core >0.6 | ||
| - jupyter_server | ||
| - jupyterlite-xeus | ||
| - # widgets | ||
| - ipywidgets | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| /*************************************************************************** | ||
| * Copyright (c) 2024, Isabel Paredes * | ||
| * Copyright (c) 2024, QuantStack * | ||
| * * | ||
| * Distributed under the terms of the BSD 3-Clause License. * | ||
| * * | ||
| * The full license is in the file LICENSE, distributed with this software. * | ||
| ****************************************************************************/ | ||
|
|
||
| #include "xeus_python_config.hpp" | ||
| #include "xeus/xkernel.hpp" | ||
| #include "pybind11/pybind11.h" | ||
|
|
||
| namespace py = pybind11; | ||
| namespace nl = nlohmann; | ||
|
|
||
| namespace xpyt | ||
| { | ||
|
|
||
| XEUS_PYTHON_API XPYT_FORCE_PYBIND11_EXPORT xeus::xkernel::server_builder make_async_server_factory(py::dict globals); | ||
|
|
||
| } // namespace xeus |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| /*************************************************************************** | ||
| * Copyright (c) 2026, Thorsten Beier * | ||
| * Copyright (c) 2018, Martin Renou, Johan Mabille, Sylvain Corlay, and * | ||
| * Wolf Vollprecht * | ||
| * Copyright (c) 2018, QuantStack * | ||
|
|
@@ -26,7 +27,7 @@ | |
| #include "xeus/xinterpreter.hpp" | ||
| #include "xeus/xhelper.hpp" | ||
|
|
||
| #include "xeus-zmq/xserver_zmq_split.hpp" | ||
| #include "xeus-zmq/xserver_zmq.hpp" | ||
| #include "xeus-zmq/xzmq_context.hpp" | ||
|
|
||
| #include "pybind11/embed.h" | ||
|
|
@@ -38,10 +39,10 @@ | |
| #include "xeus-python/xpaths.hpp" | ||
| #include "xeus-python/xeus_python_config.hpp" | ||
| #include "xeus-python/xutils.hpp" | ||
| #include "xeus-python/xaserver.hpp" | ||
|
|
||
| namespace py = pybind11; | ||
|
|
||
|
|
||
| int main(int argc, char* argv[]) | ||
| { | ||
| if (xeus::should_print_version(argc, argv)) | ||
|
|
@@ -111,6 +112,10 @@ int main(int argc, char* argv[]) | |
| std::cerr << "Error:" << status.err_msg << std::endl; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why removing this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I confused it with debugging info while cleaning, adding it back now |
||
|
|
||
| // Instantiating the Python interpreter | ||
| py::scoped_interpreter guard{}; | ||
| py::gil_scoped_acquire acquire; | ||
|
|
||
| // Setting argv | ||
| wchar_t** argw = new wchar_t*[size_t(argc)]; | ||
| for(auto i = 0; i < argc; ++i) | ||
|
|
@@ -130,22 +135,23 @@ int main(int argc, char* argv[]) | |
| } | ||
| delete[] argw; | ||
|
|
||
| // Instantiating the Python interpreter | ||
| py::scoped_interpreter guard; | ||
|
|
||
| std::unique_ptr<xeus::xcontext> context = xeus::make_zmq_context(); | ||
|
|
||
| // we want to use **the same global dict everywhere** | ||
| py::dict globals = py::globals(); | ||
|
|
||
| // Instantiating the xeus xinterpreter | ||
| bool raw_mode = xpyt::extract_option("-r", "--raw", argc, argv); | ||
| using interpreter_ptr = std::unique_ptr<xeus::xinterpreter>; | ||
| interpreter_ptr interpreter; | ||
| if (raw_mode) | ||
| { | ||
| interpreter = interpreter_ptr(new xpyt::raw_interpreter()); | ||
| interpreter = interpreter_ptr(new xpyt::raw_interpreter(globals)); | ||
| } | ||
| else | ||
| { | ||
| interpreter = interpreter_ptr(new xpyt::interpreter()); | ||
| interpreter = interpreter_ptr(new xpyt::interpreter(globals)); | ||
| } | ||
|
|
||
| using history_manager_ptr = std::unique_ptr<xeus::xhistory_manager>; | ||
|
|
@@ -163,6 +169,24 @@ int main(int argc, char* argv[]) | |
| nl::json debugger_config; | ||
| debugger_config["python"] = executable; | ||
|
|
||
|
|
||
| // Factory to create the debugger with the global dict | ||
| auto make_the_debugger = [globals]( | ||
| xeus::xcontext& context, | ||
| const xeus::xkernel_configuration& config, | ||
| const std::string& user_name, | ||
| const std::string& session_id, | ||
| const nl::json& debugger_config) -> std::unique_ptr<xeus::xdebugger> | ||
| { | ||
| return xpyt::make_python_debugger( | ||
| globals, | ||
| context, | ||
| config, | ||
| user_name, | ||
| session_id, | ||
| debugger_config); | ||
| }; | ||
|
|
||
| if (!connection_filename.empty()) | ||
| { | ||
| xeus::xconfiguration config = xeus::load_configuration(connection_filename); | ||
|
|
@@ -171,31 +195,33 @@ int main(int argc, char* argv[]) | |
| xeus::get_user_name(), | ||
| std::move(context), | ||
| std::move(interpreter), | ||
| xeus::make_xserver_shell_main, | ||
| xpyt::make_async_server_factory(globals), | ||
| std::move(hist), | ||
| xeus::make_console_logger(xeus::xlogger::msg_type, | ||
| xeus::make_file_logger(xeus::xlogger::content, "xeus.log")), | ||
| xpyt::make_python_debugger, | ||
| make_the_debugger, | ||
| debugger_config); | ||
|
|
||
| std::clog << | ||
| "Starting xeus-python kernel...\n\n" | ||
| "If you want to connect to this kernel from an other client, you can use" | ||
| " the " + connection_filename + " file." | ||
| << std::endl; | ||
|
|
||
|
|
||
| std::cout << "Starting kernel..." << std::endl; | ||
| kernel.start(); | ||
| std::cout << "Kernel stopped." << std::endl; | ||
| } | ||
| else | ||
| { | ||
| std::clog << "Instantiating kernel" << std::endl; | ||
| xeus::xkernel kernel(xeus::get_user_name(), | ||
| std::move(context), | ||
| std::move(interpreter), | ||
| xeus::make_xserver_shell_main, | ||
| xpyt::make_async_server_factory(globals), | ||
| std::move(hist), | ||
| nullptr, | ||
| xpyt::make_python_debugger, | ||
| make_the_debugger, | ||
| debugger_config); | ||
|
|
||
| std::cout << "Getting config" << std::endl; | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to be done in this PR, but I think we should refactor the visibility of the symbols:
__attribute__((visibility("default"))on Unix platforms.And then remove
XPYT_FORCE_PYBIND11_EXPORTandXEUS_PYTHON_HIDDEN