Skip to content
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

WIP Support asynchronous contents managers #1021

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Jupytext ChangeLog
==================

1.17.0-dev (2023-??)
-------------------

**Fixed**
- Jupytext's contents manager can be derived from asynchronous contents manager (now the default since `jupyter_server==2.0.0`) ([#1020](https://github.com/mwouts/jupytext/issues/1020))


1.16.0-dev (2023-10-??)
-------------------

Expand Down
22 changes: 4 additions & 18 deletions jupyterlab/jupyterlab_jupytext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,13 @@ def load_jupyter_server_extension(app): # pragma: no cover
# The contents manager was set at NotebookApp.init_configurables

# Let's change the contents manager class
base_class = app.contents_manager_class
if "async" in base_class.__name__.lower():
app.log.warning(
"[Jupytext Server Extension] Async contents managers like {} "
"are not supported at the moment "
"(https://github.com/mwouts/jupytext/issues/1020). "
"We will derive a contents manager from LargeFileManager instead.".format(
base_class.__name__
)
)
from jupyter_server.services.contents.largefilemanager import ( # noqa
LargeFileManager,
)

base_class = LargeFileManager

app.log.info(
"[Jupytext Server Extension] Deriving a JupytextContentsManager "
"from {}".format(base_class.__name__)
"from {}".format(app.contents_manager_class.__name__)
)
app.contents_manager_class = build_jupytext_contents_manager_class(
app.contents_manager_class
)
app.contents_manager_class = build_jupytext_contents_manager_class(base_class)

try:
# And rerun selected init steps from https://github.com/jupyter/notebook/blob/
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Documentation = "https://jupytext.readthedocs.io"
# Test related dependencies
test = [
"pytest",
"pytest-asyncio",
"pytest-randomly"
]
test-functional = [
Expand Down Expand Up @@ -184,6 +185,7 @@ ignore = [
]

[tool.pytest.ini_options]
asyncio_mode = "auto"
markers = [
"requires_black",
"requires_isort",
Expand Down
Loading
Loading