Skip to content

Commit 42df870

Browse files
authored
Adopt the Jupyter Releaser, update Jupyter Packaging (#115)
* Update Release docs * Use `maintainer-tools` base setup action * Add changelog markers * Update MANIFEST.in * Update `jupyter-packaging` * Handle version bump with tbump * Add releaser config, update pre-commit * Fix build * Cleanup * Format with prettier * Add check release workflow * Fix lint workflow * Install lab for lint on CI * Add check manifest ignore list * Move to setup.cfg * Upload release artifacts * Fix version handling * Fix tests * More test fixes * Add workflow to enforce labels * Build Binder from source * Force upgrade on Binder * Test on newer versions of Python
1 parent f125e71 commit 42df870

31 files changed

+9032
-4060
lines changed
File renamed without changes.
File renamed without changes.

.github/workflows/build.yml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,11 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v2
1515

16-
- name: Install node
17-
uses: actions/setup-node@v1
18-
with:
19-
node-version: '14.x'
16+
- name: Checkout
17+
uses: actions/checkout@v2
2018

21-
- name: Install Python
22-
uses: actions/setup-python@v2
23-
with:
24-
python-version: '3.7'
25-
architecture: 'x64'
19+
- name: Base Setup
20+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
2621

2722
- name: Install dependencies
2823
run: python -m pip install jupyterlab~=3.0
@@ -38,9 +33,3 @@ jobs:
3833
jupyter nbextension list 2>&1 | grep -ie "jupyter_resource_usage/main.*enabled"
3934
jupyter labextension list 2>&1 | grep -ie "@jupyter-server/resource-usage.*OK"
4035
python -m jupyterlab.browser_check
41-
42-
- name: Lint
43-
run: |
44-
cd packages/labextension/
45-
jlpm
46-
jlpm run lint:check

.github/workflows/check-release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches:
5+
- '*'
6+
pull_request:
7+
branches:
8+
- '*'
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
check_release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- name: Base Setup
21+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
22+
23+
- name: Upgrade packaging dependencies
24+
run: |
25+
pip install --upgrade jupyter-packaging~=0.10 --user
26+
27+
- name: Install Dependencies
28+
run: |
29+
pip install .
30+
31+
- name: Check Release
32+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
33+
with:
34+
token: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Upload Distributions
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: jupyter-resource-usage-releaser-dist-${{ github.run_number }}
40+
path: .jupyter_releaser_checkout/dist

.github/workflows/enforce-labels.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Enforce PR label
2+
3+
on:
4+
pull_request:
5+
types: [labeled, unlabeled, opened, edited, synchronize]
6+
jobs:
7+
enforce-label:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: enforce-triage-label
11+
uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1

.github/workflows/lint.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,31 @@ name: Lint
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- '*'
67
pull_request:
7-
branches: [ master ]
8+
branches:
9+
- '*'
810

911
jobs:
1012
lint:
1113
runs-on: ubuntu-latest
1214
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v2
15-
- name: Install Python
16-
uses: actions/setup-python@v2
17-
with:
18-
python-version: '3.8'
19-
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
python -m pip install black
23-
- name: Lint Python
24-
run: |
25-
black --check .
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Base Setup
19+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip black jupyterlab~=3.0
24+
25+
- name: Lint Python
26+
run: |
27+
black --check .
28+
29+
- name: Lint JS
30+
run: |
31+
jlpm
32+
jlpm run lint:check

.github/workflows/tests.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
16-
python-version: [3.6, 3.7, 3.8]
16+
python-version: ["3.8", "3.9", "3.10"]
1717

1818
steps:
19-
- uses: actions/checkout@v2
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: ${{ matrix.python-version }}
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Base Setup
23+
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
24+
2425
- name: Install dependencies
2526
run: |
26-
python -m pip install --upgrade pip
2727
python -m pip install -e ".[dev]"
28+
2829
- name: Lint with flake8
29-
run: python -m flake8 jupyter_resource_usage
30+
run: |
31+
python -m flake8 jupyter_resource_usage
32+
3033
- name: Test with pytest
3134
run: |
3235
python -m pytest -vvv jupyter_resource_usage --cov=jupyter_resource_usage --junitxml=python_junit.xml --cov-report=xml --cov-branch

.pre-commit-config.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
repos:
22
- repo: https://github.com/asottile/reorder_python_imports
3-
rev: v1.3.5
3+
rev: v1.9.0
44
hooks:
55
- id: reorder-python-imports
66
language_version: python3
7-
- repo: https://github.com/ambv/black
8-
rev: 18.9b0
7+
- repo: https://github.com/psf/black
8+
rev: 20.8b1
99
hooks:
1010
- id: black
11+
- repo: https://gitlab.com/pycqa/flake8
12+
rev: "3.8.4"
13+
hooks:
14+
- id: flake8
1115
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v2.1.0
16+
rev: v3.4.0
1317
hooks:
1418
- id: end-of-file-fixer
1519
- id: check-json
@@ -18,4 +22,3 @@ repos:
1822
- id: check-case-conflict
1923
- id: check-executables-have-shebangs
2024
- id: requirements-txt-fixer
21-
- id: flake8

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
**/node_modules
3+
**/lib
4+
**/package.json
5+
6+
jupyter_resource_usage/labextension
7+
jupyter_resource_usage/static
File renamed without changes.

0 commit comments

Comments
 (0)