Skip to content

Commit d9694e2

Browse files
authored
Merge branch 'main' into upgrade_jh_4
2 parents c30b593 + d75a5db commit d9694e2

20 files changed

+457
-367
lines changed

.flake8

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1+
# flake8 is used for linting Python code setup to automatically run with
2+
# pre-commit.
3+
#
4+
# ref: https://flake8.pycqa.org/en/latest/user/configuration.html
5+
#
16
[flake8]
2-
# Ignore style and complexity
37
# E: style errors
48
# W: style warnings
59
# C: complexity
6-
# F401: module imported but unused
7-
# F403: import *
8-
# F811: redefinition of unused `name` from line `N`
9-
# F841: local variable assigned but never used
10-
# E402: module level import not at top of file
11-
# I100: Import statements are in the wrong order
12-
# I101: Imported names are in the wrong order. Should be
13-
ignore = E, W, C, F401, F403, F811, F841, E402, I100, I101, D400
10+
# D: docstring warnings (unused pydocstyle extension)
11+
ignore = E, C, W, D

.github/dependabot.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# dependabot.yaml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2+
#
3+
# Notes:
4+
# - Status and logs from dependabot are provided at
5+
# https://github.com/jupyterhub/tmpauthenticator/network/updates.
6+
#
7+
version: 2
8+
updates:
9+
# Maintain dependencies in our GitHub Workflows
10+
- package-ecosystem: github-actions
11+
directory: /
12+
labels: [ci]
13+
schedule:
14+
interval: monthly
15+
time: "05:00"
16+
timezone: Etc/UTC

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v3
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
1717
with:
1818
python-version: "3.x"
1919

.github/workflows/test.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This is a GitHub workflow defining a set of jobs with a set of steps.
2+
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
3+
#
4+
name: Test
5+
6+
on:
7+
pull_request:
8+
paths-ignore:
9+
- "**.md"
10+
- ".github/workflows/*.yaml"
11+
- "!.github/workflows/test.yaml"
12+
push:
13+
paths-ignore:
14+
- "**.md"
15+
- ".github/workflows/*.yaml"
16+
- "!.github/workflows/test.yaml"
17+
branches-ignore:
18+
- "dependabot/**"
19+
- "pre-commit-ci-update-config"
20+
tags: ["**"]
21+
workflow_dispatch:
22+
23+
jobs:
24+
pytest:
25+
name: Run pytest
26+
runs-on: ${{ matrix.runs-on || 'ubuntu-22.04' }}
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
# test oldest supported version
33+
- python-version: "3.6"
34+
pip-install-spec: "jupyterhub==1.5.1 sqlalchemy==1.*"
35+
runs-on: ubuntu-20.04 # python 3.6 is only available in 20.04
36+
37+
- python-version: "3.7"
38+
pip-install-spec: "jupyterhub==2.* sqlalchemy==1.*"
39+
- python-version: "3.8"
40+
pip-install-spec: "jupyterhub==3.*"
41+
- python-version: "3.10"
42+
pip-install-spec: "jupyterhub==4.*"
43+
- python-version: "3.11"
44+
pip-install-spec: "jupyterhub==4.*"
45+
- python-version: "3.12"
46+
pip-install-spec: "jupyterhub==4.*"
47+
48+
# test unreleased jupyterhub, failures tolerated
49+
- python-version: "3.X"
50+
pip-install-spec: "git+https://github.com/jupyterhub/jupyterhub"
51+
allow-failure: true
52+
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: actions/setup-node@v4
56+
with:
57+
node-version: "18"
58+
- uses: actions/setup-python@v5
59+
with:
60+
python-version: "${{ matrix.python-version }}"
61+
62+
- name: Install Node dependencies
63+
run: |
64+
npm install -g configurable-http-proxy
65+
66+
- name: Install Python dependencies
67+
run: |
68+
pip install --upgrade pip
69+
pip install ${{ matrix.pip-install-spec }}
70+
pip install -e ".[test]"
71+
72+
- name: List dependencies
73+
run: |
74+
pip freeze
75+
76+
- name: pytest
77+
run: |
78+
pytest
79+
80+
# GitHub action reference: https://github.com/codecov/codecov-action
81+
- uses: codecov/codecov-action@v4

.github/workflows/test.yml

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

.pre-commit-config.yaml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,50 @@
99
# - Register git hooks: pre-commit install --install-hooks
1010
#
1111
repos:
12+
# Autoformat: Python code, syntax patterns are modernized
13+
- repo: https://github.com/asottile/pyupgrade
14+
rev: v3.15.0
15+
hooks:
16+
- id: pyupgrade
17+
args:
18+
- --py38-plus
19+
20+
# Autoformat: Python code
21+
- repo: https://github.com/PyCQA/autoflake
22+
rev: v2.2.1
23+
hooks:
24+
- id: autoflake
25+
# args ref: https://github.com/PyCQA/autoflake#advanced-usage
26+
args:
27+
- --in-place
28+
29+
# Autoformat: Python code
30+
- repo: https://github.com/pycqa/isort
31+
rev: 5.13.2
32+
hooks:
33+
- id: isort
34+
1235
# Autoformat: Python code
1336
- repo: https://github.com/psf/black
14-
rev: "22.12.0"
37+
rev: "24.1.1"
1538
hooks:
1639
- id: black
17-
args:
18-
- --target-version=py36
19-
- --target-version=py37
20-
- --target-version=py38
21-
- --target-version=py39
22-
- --target-version=py310
23-
- --target-version=py311
2440

2541
# Autoformat: markdown, yaml
2642
- repo: https://github.com/pre-commit/mirrors-prettier
27-
rev: v3.0.0-alpha.4
43+
rev: v4.0.0-alpha.8
2844
hooks:
2945
- id: prettier
3046

3147
# Lint: Python code
3248
- repo: https://github.com/PyCQA/flake8
33-
rev: "6.0.0"
49+
rev: "7.0.0"
3450
hooks:
3551
- id: flake8
3652

3753
# Misc...
3854
- repo: https://github.com/pre-commit/pre-commit-hooks
39-
rev: v4.4.0
55+
rev: v4.5.0
4056
# ref: https://github.com/pre-commit/pre-commit-hooks#hooks-available
4157
hooks:
4258
# Autoformat: Makes sure files end in a newline and only a newline.

MANIFEST.in

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

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# batchspawner for Jupyterhub
22

3-
[![GitHub Workflow Status - Test](https://img.shields.io/github/workflow/status/jupyterhub/batchspawner/Test?logo=github&label=tests)](https://github.com/jupyterhub/batchspawner/actions)
4-
[![Latest PyPI version](https://img.shields.io/pypi/v/batchspawner?logo=pypi&logoColor=white)](https://pypi.python.org/pypi/batchspawner)
5-
[![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/jupyterhub/batchspawner/issues)
6-
[![Discourse](https://img.shields.io/badge/help_forum-discourse-blue?logo=discourse)](https://discourse.jupyter.org/c/jupyterhub)
7-
[![Gitter](https://img.shields.io/badge/social_chat-gitter-blue?logo=gitter)](https://gitter.im/jupyterhub/jupyterhub)
3+
[![Latest PyPI version](https://img.shields.io/pypi/v/batchspawner?logo=pypi)](https://pypi.python.org/pypi/batchspawner)
4+
[![Latest conda-forge version](https://img.shields.io/conda/vn/conda-forge/batchspawner?logo=conda-forge)](https://anaconda.org/conda-forge/batchspawner)
5+
[![GitHub Workflow Status - Test](https://img.shields.io/github/actions/workflow/status/jupyterhub/batchspawner/test.yaml?logo=github&label=tests)](https://github.com/jupyterhub/batchspawner/actions)
6+
[![Test coverage of code](https://codecov.io/gh/jupyterhub/batchspawner/branch/main/graph/badge.svg)](https://codecov.io/gh/jupyterhub/batchspawner)
7+
[![Issue tracking - GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/jupyterhub/batchspawner/issues)
8+
[![Help forum - Discourse](https://img.shields.io/badge/help_forum-discourse-blue?logo=discourse)](https://discourse.jupyter.org/c/jupyterhub)
89
[![Contribute](https://img.shields.io/badge/I_want_to_contribute!-grey?logo=jupyter)](https://github.com/jupyterhub/batchspawner/blob/master/CONTRIBUTING.md)
910

1011
This is a custom spawner for [Jupyterhub](https://jupyterhub.readthedocs.io/) that is designed for installations on clusters using batch scheduling software.
@@ -15,6 +16,10 @@ This package formerly included WrapSpawner and ProfilesSpawner, which provide me
1516

1617
## Installation
1718

19+
> **⚠ NOTE**
20+
>
21+
> If you are using JupyterHub 3+ then you currently must install from the main branch, for example by `pip install https://github.com/jupyterhub/batchspawner/archive/main.zip`, due to a [bug that is resolved but not yet released](https://github.com/jupyterhub/batchspawner/issues/277).
22+
1823
1. from root directory of this repo (where setup.py is), run `pip install -e .`
1924

2025
If you don't actually need an editable version, you can simply run

RELEASE.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# How to make a release
2+
3+
`batchspawner` is a package available on [PyPI] and on [conda-forge].
4+
5+
These are the instructions on how to make a release.
6+
7+
## Pre-requisites
8+
9+
- Push rights to this GitHub repository
10+
11+
## Steps to make a release
12+
13+
1. Create a PR updating `CHANGELOG.md` with [github-activity] and continue when
14+
its merged.
15+
16+
Advice on this procedure can be found in [this team compass
17+
issue](https://github.com/jupyterhub/team-compass/issues/563).
18+
19+
2. Checkout main and make sure it is up to date.
20+
21+
```shell
22+
git checkout main
23+
git fetch origin main
24+
git reset --hard origin/main
25+
```
26+
27+
3. Update the version, make commits, and push a git tag with `tbump`.
28+
29+
```shell
30+
pip install tbump
31+
```
32+
33+
`tbump` will ask for confirmation before doing anything.
34+
35+
```shell
36+
# Example versions to set: 1.0.0, 1.0.0b1
37+
VERSION=
38+
tbump ${VERSION}
39+
```
40+
41+
Following this, the [CI system] will build and publish a release.
42+
43+
4. Reset the version back to dev, e.g. `1.0.1.dev` after releasing `1.0.0`.
44+
45+
```shell
46+
# Example version to set: 1.0.1.dev
47+
NEXT_VERSION=
48+
tbump --no-tag ${NEXT_VERSION}.dev
49+
```
50+
51+
5. Following the release to PyPI, an automated PR should arrive within 24 hours
52+
to [conda-forge/batchspawner-feedstock] with instructions on releasing to
53+
conda-forge. You are welcome to volunteer doing this, but aren't required as
54+
part of making this release to PyPI.
55+
56+
[github-activity]: https://github.com/executablebooks/github-activity
57+
[pypi]: https://pypi.org/project/batchspawner/
58+
[ci system]: https://github.com/jupyterhub/batchspawner/actions/workflows/release.yaml
59+
[conda-forge]: https://anaconda.org/conda-forge/batchspawner
60+
[conda-forge/batchspawner-feedstock]: https://github.com/conda-forge/batchspawner-feedstock

batchspawner/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
from .batchspawner import *
2-
from . import api
1+
from . import api # noqa
2+
from ._version import __version__, version_info # noqa
3+
from .batchspawner import * # noqa

0 commit comments

Comments
 (0)