Skip to content

Commit

Permalink
Add support for Jupyter Server v2 (#110)
Browse files Browse the repository at this point in the history
* Add support for Jupyter Server v2

* Fix install test dep in CI

* Install the test dep at the right place

* Fix using `is_hidden`
  • Loading branch information
fcollonval committed Jan 8, 2023
1 parent f83d39c commit 4ea514d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies
run: python -m pip install jupyterlab pytest pytest-tornasync==0.6.0.post2
run: python -m pip install jupyterlab pytest "pytest-jupyter[server]>=0.6.0"
- name: Build the extension
run: |
jlpm
Expand Down
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

pytest_plugins = ["jupyter_server.pytest_plugin"]
pytest_plugins = ["pytest_jupyter.jupyter_server"]


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion jupyter_archive/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async def get(self, archive_path, include_body=False):
self.check_xsrf_cookie()
cm = self.contents_manager

if cm.is_hidden(archive_path) and not cm.allow_hidden:
if await ensure_async(cm.is_hidden(archive_path)) and not cm.allow_hidden:
self.log.info("Refusing to serve hidden file, via 404 Error")
raise web.HTTPError(404)

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
cmdclass=cmdclass,
packages=setuptools.find_packages(),
install_requires=[
"jupyter_server>=1.6,<2",
"jupyter_server>=1.21,<3",
],
extra_requires={"test": ["pytest", "pytest-tornasync"]},
extra_requires={"test": ["pytest", "pytest-jupyter[server]>=0.6.0"]},
zip_safe=False,
include_package_data=True,
python_requires=">=3.6,<4",
Expand All @@ -79,6 +79,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 3",
Expand Down

0 comments on commit 4ea514d

Please sign in to comment.