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

Remove pytest11 entrypoint and plugin, require tornado 6.1, remove asyncio patch, CI work #339

Merged
merged 27 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
35 changes: 30 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ on:
branches: '*'
jobs:
build:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [ '3.6', '3.7', '3.8' ]
os: [ubuntu, macos, windows]
python-version: [ '3.6', '3.7', '3.8', '3.9', 'pypy3' ]
exclude:
- os: windows
python-version: pypy3
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -20,15 +23,37 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- name: Upgrade packaging dependencies
run: |
pip install --upgrade pip setuptools wheel
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install the Python dependencies
run: |
pip install -e .[test]
pip install -e .[test] codecov
- name: List installed packages
run: |
pip freeze
pip check
- name: Run the tests
run: |
pytest
pytest -vv --cov jupyter_server --cov-branch --cov-report term-missing:skip-covered
- name: Install the Python dependencies for the examples
run: |
cd examples/simple && pip install -e .
- name: Run the tests for the examples
run: |
pytest examples/simple/tests/test_handlers.py
- name: Coverage
run: |
codecov
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include CHANGELOG.md
include setupbase.py

# include everything in package_data
include jupyter_server/**/*
recursive-include jupyter_server *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch - thanks.


# Documentation
graft docs
Expand All @@ -26,3 +26,5 @@ global-exclude *.pyc
global-exclude *.pyo
global-exclude .git
global-exclude .ipynb_checkpoints
global-exclude .pytest_cache
global-exclude .coverage
2 changes: 1 addition & 1 deletion examples/simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ git clone https://github.com/jupyter/jupyter_server && \
cd examples/simple && \
conda create -y -n jupyter-server-example python=3.7 && \
conda activate jupyter-server-example && \
pip install -e .
pip install -e .[test]
```

**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.
Expand Down
7 changes: 5 additions & 2 deletions examples/simple/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ def add_data_files(path):
version = VERSION,
description = 'Jupyter Server Example',
long_description = open('README.md').read(),
python_requires = '>=3.5',
python_requires = '>=3.6',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☠️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm not following the skull & crossbones commentary here, sorry about that. The change seems fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just meant 3.5 is EOL!

install_requires = [
'jupyter_server',
'jinja2',
],
extras_require = {
'test': ['pytest-jupyter'],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not strictly required, but if the example is supposed to be illustrative...

},
include_package_data=True,
cmdclass = cmdclass,
entry_points = {
Expand All @@ -52,4 +55,4 @@ def add_data_files(path):


if __name__ == '__main__':
setup(**setup_args)
setup(**setup_args)
10 changes: 5 additions & 5 deletions examples/simple/tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


@pytest.fixture
def server_config(template_dir):
def jp_server_config(jp_template_dir):
return {
"ServerApp": {
"jpserver_extensions": {
Expand All @@ -12,8 +12,8 @@ def server_config(template_dir):
}


async def test_handler_default(fetch):
r = await fetch(
async def test_handler_default(jp_fetch):
r = await jp_fetch(
'simple_ext1/default',
method='GET'
)
Expand All @@ -22,8 +22,8 @@ async def test_handler_default(fetch):
assert r.body.decode().index('Hello Simple 1 - I am the default...') > -1


async def test_handler_template(fetch):
r = await fetch(
async def test_handler_template(jp_fetch):
r = await jp_fetch(
'simple_ext1/template1/test',
method='GET'
)
Expand Down
Loading