Skip to content

Commit 2a5be36

Browse files
authored
Merge pull request #551 from minrk/pyproject
add PEP 621 build info, require Python 3.10
2 parents 280ab74 + c944d00 commit 2a5be36

File tree

11 files changed

+82
-126
lines changed

11 files changed

+82
-126
lines changed

.github/workflows/test.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
# jupyterhub 4 works with pytest-asyncio 0.25
3535
# but requires some deprecated features,
3636
# so don't let it upgrade further
37-
- python-version: "3.9"
37+
- python-version: "3.10"
3838
pip-install-spec: "jupyterhub==4.* sqlalchemy==1.* pytest-asyncio==0.25.*"
3939
- python-version: "3.11"
4040
pip-install-spec: "jupyterhub==4.* pytest-asyncio==0.25.*"
@@ -52,15 +52,14 @@ jobs:
5252
python-version: ${{ matrix.python-version }}
5353
- uses: actions/setup-node@v6
5454
with:
55-
node-version: "18"
55+
node-version: "20"
5656

5757
- name: setup docker swarm
5858
run: docker swarm init
5959

6060
- name: Install Python dependencies
6161
run: |
62-
pip install ${{ matrix.pip-install-spec }}
63-
pip install -e "." -r dev-requirements.txt
62+
pip install ${{ matrix.pip-install-spec }} -e ".[test]"
6463
6564
- name: List Python dependencies
6665
run: |

.pre-commit-config.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ repos:
1212
rev: v3.21.2
1313
hooks:
1414
- id: pyupgrade
15-
args:
16-
- --py38-plus
1715

1816
# Autoformat: Python code
1917
- repo: https://github.com/PyCQA/autoflake
@@ -45,8 +43,8 @@ repos:
4543
- setuptools
4644

4745
# Autoformat: markdown, yaml
48-
- repo: https://github.com/pre-commit/mirrors-prettier
49-
rev: v4.0.0-alpha.8
46+
- repo: https://github.com/rbubley/mirrors-prettier
47+
rev: v3.7.3
5048
hooks:
5149
- id: prettier
5250

MANIFEST.in

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

dev-requirements.txt

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

examples/internal-ssl/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM jupyterhub/jupyterhub:5
22

3-
COPY pyproject.toml setup.py requirements.txt /src/dockerspawner/
4-
COPY dockerspawner /src/dockerspawner/dockerspawner
5-
RUN pip install /src/dockerspawner
3+
# install dockerspawner from this repo
4+
# alternatively: pip install dockerspawner to get the stable release
5+
COPY ./ dockerspawner /src/dockerspawner
6+
RUN pip install --no-cache /src/dockerspawner
67

78
COPY examples/internal-ssl/jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py

examples/simple/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG JUPYTERHUB_VERSION=1.3
1+
ARG JUPYTERHUB_VERSION=5
22
FROM jupyterhub/jupyterhub:$JUPYTERHUB_VERSION
33
COPY requirements.txt /tmp/requirements.txt
44
RUN python3 -m pip install --no-cache -r /tmp/requirements.txt

examples/simple/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
dockerspawner
2-
jupyterhub-dummyauthenticator

examples/swarm/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# base image: jupyterhub
22
# this is built by docker-compose
33
# from the root of this repo
4-
ARG JUPYTERHUB_VERSION=2.2
4+
ARG JUPYTERHUB_VERSION=5
55
FROM jupyterhub/jupyterhub:${JUPYTERHUB_VERSION}
66
# install dockerspawner from the current repo
7-
ADD . /tmp/dockerspawner
7+
COPY . /tmp/dockerspawner
88
RUN pip install --no-cache /tmp/dockerspawner
99
# load example configuration
10-
ADD examples/swarm/jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py
10+
COPY examples/swarm/jupyterhub_config.py /srv/jupyterhub/jupyterhub_config.py

pyproject.toml

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,64 @@
1+
[build-system]
2+
requires = [
3+
"hatchling",
4+
]
5+
build-backend = "hatchling.build"
6+
7+
[project]
8+
name = "dockerspawner"
9+
dynamic = [
10+
"version",
11+
]
12+
description = "Dockerspawner: A custom spawner for JupyterHub using Docker"
13+
readme = "README.md"
14+
requires-python = ">=3.10"
15+
license = "BSD-3-Clause"
16+
authors = [
17+
{ name = "Jupyter Development Team", email = "[email protected]" },
18+
]
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Intended Audience :: Developers",
22+
"Intended Audience :: System Administrators",
23+
"Intended Audience :: Science/Research",
24+
"Programming Language :: Python",
25+
"Programming Language :: Python :: 3",
26+
"Operating System :: POSIX",
27+
"Framework :: Jupyter",
28+
]
29+
keywords = [
30+
"docker",
31+
"jupyter",
32+
"jupyterhub",
33+
]
34+
dependencies = [
35+
"docker",
36+
"escapism",
37+
"jupyterhub>=4",
38+
]
39+
40+
[project.urls]
41+
Documentation = "https://jupyterhub-dockerspawner.readthedocs.io"
42+
Source = "https://github.com/jupyterhub/dockerspawner"
43+
Issues = "https://github.com/jupyterhub/dockerspawner/issues"
44+
45+
[project.optional-dependencies]
46+
test = [
47+
"psutil",
48+
"pytest",
49+
"pytest-asyncio>=0.25",
50+
"pytest-cov",
51+
]
52+
53+
[project.entry-points."jupyterhub.spawners"]
54+
docker = "dockerspawner:DockerSpawner"
55+
docker-system-user = "dockerspawner:SystemUserSpawner"
56+
docker-swarm = "dockerspawner:SwarmSpawner"
57+
58+
[tool.hatch.version]
59+
path = "dockerspawner/_version.py"
60+
61+
162
# autoflake is used for autoformatting Python code
263
#
364
# ref: https://github.com/PyCQA/autoflake#readme
@@ -23,11 +84,6 @@ profile = "black"
2384
#
2485
[tool.black]
2586
skip-string-normalization = true
26-
target_version = [
27-
"py39",
28-
"py310",
29-
"py311",
30-
]
3187

3288

3389
# pytest is used for running Python based tests
@@ -38,15 +94,17 @@ target_version = [
3894
addopts = "--verbose --color=yes --durations=10 --maxfail=1"
3995
asyncio_mode = "auto"
4096
asyncio_default_fixture_loop_scope = "module"
41-
testpaths = ["tests"]
97+
testpaths = [
98+
"tests",
99+
]
42100
# These markers are registered to avoid warnings triggered by importing from
43101
# jupyterhub.tests.test_api.
44102
markers = [
45-
"role",
46-
"user",
47-
"slow",
48-
"group",
49-
"services",
103+
"role",
104+
"user",
105+
"slow",
106+
"group",
107+
"services",
50108
]
51109

52110

requirements.txt

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

0 commit comments

Comments
 (0)