Skip to content

Commit

Permalink
Default to LargeFileManager when base class is async (#1022)
Browse files Browse the repository at this point in the history
* Default to LargeFileManager when base class is async
* Python 3.6 is not found anymore on ubuntu-latest
* flake8 was moved to github
* Use skip rather than xfail #906
  • Loading branch information
mwouts authored Dec 11, 2022
1 parent 393f231 commit 4d0e9a8
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }}
strategy:
matrix:
python-version: [ 3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [ 3.7, 3.8, 3.9, "3.10", "3.11"]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repos:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']

- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment:
after_n_builds: 12
after_n_builds: 11

coverage:
status:
Expand Down
8 changes: 8 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Jupytext ChangeLog
==================

1.14.3 (2022-12-11)
-------------------

**Fixed**
- When the default contents manager is _async_ (i.e. `jupyter_server>=2.0.0`), the Jupyter server extension for Jupytext derives a contents manager from `LargeFileManager` instead, as async contents managers are not supported by Jupytext at the moment ([#1020](https://github.com/mwouts/jupytext/issues/1020))
- We have made adjustments on the CI as flake8 was moved to GitHub, and Python 3.6 is not available anymore on `ubuntu-latest`


1.14.2 (2022-11-12)
-------------------

Expand Down
22 changes: 18 additions & 4 deletions jupytext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,27 @@ 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(app.contents_manager_class.__name__)
)
app.contents_manager_class = build_jupytext_contents_manager_class(
app.contents_manager_class
"from {}".format(base_class.__name__)
)
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: 1 addition & 1 deletion jupytext/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Jupytext's version number"""

__version__ = "1.14.2"
__version__ = "1.14.3"
2 changes: 1 addition & 1 deletion tests/test_auto_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_auto_from_kernelspecs_works(nb_file):
expected_ext = ".fsx"
auto_ext = auto_ext_from_metadata(nb.metadata)
if auto_ext == ".sage":
pytest.xfail(
pytest.skip(
"Sage notebooks have Python in their language_info metadata, see #727"
)
assert auto_ext == expected_ext
Expand Down

0 comments on commit 4d0e9a8

Please sign in to comment.