Skip to content

Commit a7ea239

Browse files
committed
breaking: require py37+ and jupyterhub 1.5.1+, test jupyterhub 4
1 parent 1d8163b commit a7ea239

File tree

5 files changed

+58
-97
lines changed

5 files changed

+58
-97
lines changed

.github/workflows/test.yaml

Lines changed: 38 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# This is a GitHub workflow defining a set of jobs with a set of steps.
2-
# ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
2+
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
33
#
44
name: Test
55

66
on:
77
pull_request:
88
paths-ignore:
99
- "**.md"
10-
- "**.yml"
11-
- "**.yaml"
12-
- "!.github/workflows/test.yml"
10+
- ".github/workflows/*.yaml"
11+
- "!.github/workflows/test.yaml"
1312
push:
1413
paths-ignore:
1514
- "**.md"
16-
- "**.yml"
17-
- "**.yaml"
18-
- "!.github/workflows/test.yml"
15+
- ".github/workflows/*.yaml"
16+
- "!.github/workflows/test.yaml"
1917
branches-ignore:
2018
- "dependabot/**"
2119
- "pre-commit-ci-update-config"
@@ -24,65 +22,55 @@ on:
2422

2523
jobs:
2624
pytest:
27-
name: "Run pytest"
28-
runs-on: ubuntu-20.04
29-
continue-on-error: ${{ matrix.allow_failure }}
25+
name: Run pytest
26+
runs-on: ubuntu-22.04
27+
3028
strategy:
31-
# Keep running even if one variation of the job fail
3229
fail-fast: false
3330
matrix:
34-
python-version:
35-
- "3.6"
36-
- "3.10"
37-
JHUB_VER:
38-
- "1.0.0"
39-
- "1.5.1"
40-
- "2.3.1"
41-
allow_failure: [false]
42-
43-
exclude:
44-
# JupyterHub 1.3.0 requires python 3.6+
45-
- JHUB_VER: "1.3.0"
46-
python-version: "3.5"
47-
# JupyterHub 0.9.6 used a deprecated sqlalchemy feature removed in py3.9 environment
48-
- JHUB_VER: "0.9.6"
49-
python-version: "3.9"
5031
include:
51-
- JHUB_VER: "main"
52-
python-version: "3.9"
53-
allow_failure: true
54-
- JHUB_VER: "3.0.0"
55-
python-version: "3.9"
56-
allow_failure: true
32+
# test oldest supported version
33+
- python-version: "3.7"
34+
pip-install-spec: "jupyterhub==1.5.1 sqlalchemy==1.*"
35+
36+
- python-version: "3.8"
37+
pip-install-spec: "jupyterhub==2.* sqlalchemy==1.*"
38+
- python-version: "3.10"
39+
pip-install-spec: "jupyterhub==3.*"
40+
- python-version: "3.11"
41+
pip-install-spec: "jupyterhub==4.*"
42+
43+
# test unreleased jupyterhub, failures tolerated
44+
- python-version: "3.X"
45+
pip-install-spec: "git+https://github.com/jupyterhub/jupyterhub"
46+
allow-failure: true
5747

5848
steps:
5949
- uses: actions/checkout@v3
60-
- name: Set up Python ${{ matrix.python-version }}
61-
uses: actions/setup-python@v3
50+
- uses: actions/setup-node@v3
51+
with:
52+
node-version: "18"
53+
- uses: actions/setup-python@v4
6254
with:
6355
python-version: "${{ matrix.python-version }}"
6456

65-
- name: Install dependencies
57+
- name: Install Node dependencies
6658
run: |
67-
python -m pip install --upgrade pip
68-
python -m pip install pytest
69-
pip install -r requirements.txt
70-
pip list
59+
npm install -g configurable-http-proxy
7160
72-
- name: Install nodejs dependencies
61+
- name: Install Python dependencies
7362
run: |
74-
sudo npm install -g configurable-http-proxy
63+
pip install --upgrade pip
64+
pip install ${{ matrix.pip-install-spec }}
65+
pip install -e ".[test]"
7566
76-
# We need to check compatibility with different versions of the JH API,
77-
# including latest development. For that, we also need to pull in the
78-
# development dependencies of that old JH version (but we don't need
79-
# conda/npm for our tests).
80-
- name: install JupyterHub
67+
- name: List dependencies
8168
run: |
82-
git clone --quiet --branch ${{ matrix.JHUB_VER }} https://github.com/jupyterhub/jupyterhub.git ./jupyterhub
83-
pip install -r ./jupyterhub/dev-requirements.txt
84-
pip install ./jupyterhub
69+
pip freeze
8570
8671
- name: pytest
8772
run: |
8873
pytest --verbose --color=yes --last-failed --cov batchspawner batchspawner/tests
74+
75+
# GitHub action reference: https://github.com/codecov/codecov-action
76+
- uses: codecov/codecov-action@v3

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
include *.md
22
include LICENSE
33
include version.py
4-
include requirements.txt

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools", "wheel"]
3+
build-backend = "setuptools.build_meta"

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

setup.py

100755100644
Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,28 @@
1-
#!/usr/bin/env python
2-
# coding: utf-8
3-
4-
# Copyright (c) Jupyter Development Team.
5-
# Distributed under the terms of the Modified BSD License.
6-
7-
# -----------------------------------------------------------------------------
8-
# Minimal Python version sanity check (from IPython/Jupyterhub)
9-
# -----------------------------------------------------------------------------
10-
11-
from __future__ import print_function
12-
13-
import os
14-
import sys
15-
161
from setuptools import setup
17-
from glob import glob
182

19-
pjoin = os.path.join
20-
here = os.path.abspath(os.path.dirname(__file__))
3+
with open("README.md") as f:
4+
long_description = f.read()
215

226
# Get the current package version.
237
version_ns = {}
24-
with open(pjoin(here, "version.py")) as f:
8+
with open("version.py") as f:
259
exec(f.read(), {}, version_ns)
2610

27-
with open(pjoin(here, "README.md"), encoding="utf-8") as f:
28-
long_desc = f.read()
29-
30-
setup_args = dict(
11+
setup(
3112
name="batchspawner",
3213
entry_points={
3314
"console_scripts": ["batchspawner-singleuser=batchspawner.singleuser:main"],
3415
},
3516
packages=["batchspawner"],
3617
version=version_ns["__version__"],
3718
description="""Batchspawner: A spawner for Jupyterhub to spawn notebooks using batch resource managers.""",
38-
long_description=long_desc,
19+
long_description=long_description,
3920
long_description_content_type="text/markdown",
4021
author="Michael Milligan, Andrea Zonca, Mike Gilbert",
4122
author_email="milligan@umn.edu",
4223
url="http://jupyter.org",
4324
license="BSD",
4425
platforms="Linux, Mac OS X",
45-
python_requires="~=3.5",
4626
keywords=["Interactive", "Interpreter", "Shell", "Web", "Jupyter"],
4727
classifiers=[
4828
"Intended Audience :: Developers",
@@ -58,22 +38,16 @@
5838
"About Jupyterhub": "http://jupyterhub.readthedocs.io/en/latest/",
5939
"Jupyter Project": "http://jupyter.org",
6040
},
41+
python_requires=">=3.7",
42+
install_require={
43+
"async_generator>=1.8",
44+
"jinja2",
45+
"jupyterhub>=1.5.1",
46+
},
47+
extras_require={
48+
"test": [
49+
"pytest",
50+
"pytest-cov",
51+
],
52+
},
6153
)
62-
63-
# setuptools requirements
64-
if "setuptools" in sys.modules:
65-
setup_args["install_requires"] = install_requires = []
66-
with open("requirements.txt") as f:
67-
for line in f.readlines():
68-
req = line.strip()
69-
if not req or req.startswith(("-e", "#")):
70-
continue
71-
install_requires.append(req)
72-
73-
74-
def main():
75-
setup(**setup_args)
76-
77-
78-
if __name__ == "__main__":
79-
main()

0 commit comments

Comments
 (0)