Skip to content

Commit 5c31111

Browse files
authored
Merge pull request #339 from bollwyvl/gh-337-no-entrypoint
Remove pytest11 entrypoint and plugin, require tornado 6.1, remove asyncio patch, CI work
2 parents b5997a6 + 2ce063a commit 5c31111

File tree

9 files changed

+99
-398
lines changed

9 files changed

+99
-398
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ on:
66
branches: '*'
77
jobs:
88
build:
9-
runs-on: ${{ matrix.os }}
9+
runs-on: ${{ matrix.os }}-latest
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
os: [ubuntu-latest, macos-latest, windows-latest]
14-
python-version: [ '3.6', '3.7', '3.8' ]
13+
os: [ubuntu, macos, windows]
14+
python-version: [ '3.6', '3.7', '3.8', '3.9', 'pypy3' ]
15+
exclude:
16+
- os: windows
17+
python-version: pypy3
1518
steps:
1619
- name: Checkout
1720
uses: actions/checkout@v1
@@ -20,15 +23,37 @@ jobs:
2023
with:
2124
python-version: ${{ matrix.python-version }}
2225
architecture: 'x64'
26+
- name: Upgrade packaging dependencies
27+
run: |
28+
pip install --upgrade pip setuptools wheel
29+
- name: Get pip cache dir
30+
id: pip-cache
31+
run: |
32+
echo "::set-output name=dir::$(pip cache dir)"
33+
- name: Cache pip
34+
uses: actions/cache@v1
35+
with:
36+
path: ${{ steps.pip-cache.outputs.dir }}
37+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
38+
restore-keys: |
39+
${{ runner.os }}-pip-${{ matrix.python-version }}-
40+
${{ runner.os }}-pip-
2341
- name: Install the Python dependencies
2442
run: |
25-
pip install -e .[test]
43+
pip install -e .[test] codecov
44+
- name: List installed packages
45+
run: |
46+
pip freeze
47+
pip check
2648
- name: Run the tests
2749
run: |
28-
pytest
50+
pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
2951
- name: Install the Python dependencies for the examples
3052
run: |
3153
cd examples/simple && pip install -e .
3254
- name: Run the tests for the examples
3355
run: |
3456
pytest examples/simple/tests/test_handlers.py
57+
- name: Coverage
58+
run: |
59+
codecov

MANIFEST.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include CHANGELOG.md
66
include setupbase.py
77

88
# include everything in package_data
9-
include jupyter_server/**/*
9+
recursive-include jupyter_server *
1010

1111
# Documentation
1212
graft docs
@@ -26,3 +26,5 @@ global-exclude *.pyc
2626
global-exclude *.pyo
2727
global-exclude .git
2828
global-exclude .ipynb_checkpoints
29+
global-exclude .pytest_cache
30+
global-exclude .coverage

examples/simple/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ git clone https://github.com/jupyter/jupyter_server && \
1212
cd examples/simple && \
1313
conda create -y -n jupyter-server-example python=3.7 && \
1414
conda activate jupyter-server-example && \
15-
pip install -e .
15+
pip install -e .[test]
1616
```
1717

1818
**OPTIONAL** If you want to build the Typescript code, you need [npm](https://www.npmjs.com) on your local environement. Compiled javascript is provided as artifact in this repository, so this Typescript build step is optional. The Typescript source and configuration have been taken from https://github.com/markellekelly/jupyter-server-example.

examples/simple/setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ def add_data_files(path):
3434
version = VERSION,
3535
description = 'Jupyter Server Example',
3636
long_description = open('README.md').read(),
37-
python_requires = '>=3.5',
37+
python_requires = '>=3.6',
3838
install_requires = [
3939
'jupyter_server',
4040
'jinja2',
4141
],
42+
extras_require = {
43+
'test': ['pytest-jupyter'],
44+
},
4245
include_package_data=True,
4346
cmdclass = cmdclass,
4447
entry_points = {
@@ -52,4 +55,4 @@ def add_data_files(path):
5255

5356

5457
if __name__ == '__main__':
55-
setup(**setup_args)
58+
setup(**setup_args)

examples/simple/tests/test_handlers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
@pytest.fixture
5-
def server_config(template_dir):
5+
def jp_server_config(jp_template_dir):
66
return {
77
"ServerApp": {
88
"jpserver_extensions": {
@@ -12,8 +12,8 @@ def server_config(template_dir):
1212
}
1313

1414

15-
async def test_handler_default(fetch):
16-
r = await fetch(
15+
async def test_handler_default(jp_fetch):
16+
r = await jp_fetch(
1717
'simple_ext1/default',
1818
method='GET'
1919
)
@@ -22,8 +22,8 @@ async def test_handler_default(fetch):
2222
assert r.body.decode().index('Hello Simple 1 - I am the default...') > -1
2323

2424

25-
async def test_handler_template(fetch):
26-
r = await fetch(
25+
async def test_handler_template(jp_fetch):
26+
r = await jp_fetch(
2727
'simple_ext1/template1/test',
2828
method='GET'
2929
)

0 commit comments

Comments
 (0)