Skip to content

Commit 928cb72

Browse files
authored
Update to Jupyter Packaging 10, adopt the releaser (#38)
* Update to Jupyter Packaging 10, adopt the releaser * Add tornado to build deps * Add jupyterlab dependency * add classifiers * Fix manifest * skip link check for now * Add back Binder * Update manifest ignore list * Rename to binder * fix pip install * Link the lab extensions * pip install . on binder
1 parent 6f64da4 commit 928cb72

File tree

11 files changed

+150
-49
lines changed

11 files changed

+150
-49
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ jobs:
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v2
15+
1516
- name: Install node
1617
uses: actions/setup-node@v1
1718
with:
18-
node-version: '12.x'
19+
node-version: '14.x'
20+
1921
- name: Install Python
2022
uses: actions/setup-python@v2
2123
with:
22-
python-version: '3.7'
24+
python-version: '3.9'
2325
architecture: 'x64'
2426

25-
2627
- name: Setup pip cache
2728
uses: actions/cache@v2
2829
with:
@@ -35,6 +36,7 @@ jobs:
3536
- name: Get yarn cache directory path
3637
id: yarn-cache-dir-path
3738
run: echo "::set-output name=dir::$(yarn cache dir)"
39+
3840
- name: Setup yarn cache
3941
uses: actions/cache@v2
4042
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
@@ -45,7 +47,8 @@ jobs:
4547
yarn-
4648
4749
- name: Install dependencies
48-
run: python -m pip install -U jupyterlab~=3.0 jupyter_packaging~=0.7.9
50+
run: python -m pip install -U jupyterlab~=3.0 jupyter-packaging~=0.10
51+
4952
- name: Build the extension
5053
run: |
5154
jlpm

.github/workflows/check-release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Check Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
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: Install Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.9
24+
architecture: 'x64'
25+
26+
- name: Install node
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: '14.x'
30+
31+
- name: Get pip cache dir
32+
id: pip-cache
33+
run: |
34+
echo "::set-output name=dir::$(pip cache dir)"
35+
36+
- name: Cache pip
37+
uses: actions/cache@v1
38+
with:
39+
path: ${{ steps.pip-cache.outputs.dir }}
40+
key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }}
41+
restore-keys: |
42+
${{ runner.os }}-pip-
43+
44+
- name: Cache checked links
45+
uses: actions/cache@v2
46+
with:
47+
path: ~/.cache/pytest-link-check
48+
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
49+
restore-keys: |
50+
${{ runner.os }}-linkcheck-
51+
52+
- name: Upgrade packaging dependencies
53+
run: |
54+
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user
55+
56+
- name: Install Dependencies
57+
run: |
58+
pip install .
59+
60+
- name: Check Release
61+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
65+
- name: Upload Distributions
66+
uses: actions/upload-artifact@v2
67+
with:
68+
name: jupyterlab-snippets-releaser-dist-${{ github.run_number }}
69+
path: .jupyter_releaser_checkout/dist

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Changelog
2+
3+
<!-- <START NEW CHANGELOG ENTRY> -->
4+
5+
## 0.4.0
6+
7+
### Changes
8+
9+
- Don't list hidden folder #25
10+
- Correct hidden folder removal #26
11+
- Port to JupyterLab 3 #33
12+
13+
Many thanks @fcollonval for the contributions!
14+
15+
<!-- <END NEW CHANGELOG ENTRY> -->

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
include LICENSE
2-
include README.md
2+
include *.md
33
include pyproject.toml
44
include jupyter-config/jupyterlab-snippets.json
55

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![Github Actions Status](https://github.com/QuantStack/jupyterlab-snippets/workflows/Build/badge.svg)
44
[![Version](https://img.shields.io/pypi/v/jupyterlab-snippets.svg)](https://pypi.python.org/project/jupyterlab-snippets)
55
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/jupyterlab-snippets.svg)](https://anaconda.org/conda-forge/jupyterlab-snippets)
6-
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/QuantStack/jupyterlab-snippets/stable?urlpath=lab/tree/binder/notebook.ipynb)
6+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/QuantStack/jupyterlab-snippets/stable?urlpath=lab/tree/binder/example.ipynb)
77

88
Snippets Extension for JupyterLab.
99

binder/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ dependencies:
1616
# labextension build dependencies
1717
- nodejs >=14,<15
1818
- pip
19-
- wheel
19+
- wheel
File renamed without changes.

binder/postBuild

100755100644
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env sh
22
""" perform a development install of jupyterlab-snippets
3-
43
On Binder, this will run _after_ the environment has been fully created from
54
the environment.yml in this directory.
65
"""
@@ -32,7 +31,7 @@ cd ..
3231
python -m pip check
3332

3433
# install the labextension
35-
python -m pip install -e .
34+
python -m pip install .
3635

3736
# verify the environment the extension didn't break anything
3837
python -m pip check
@@ -45,4 +44,4 @@ jupyter labextension list
4544

4645

4746
echo "JupyterLab with jupyterlab-snippets is ready to run with:"
48-
echo " jupyter lab"
47+
echo " jupyter lab"

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,5 +88,14 @@
8888
"extension": true,
8989
"outputDir": "jupyterlab_snippets/labextension"
9090
},
91+
"jupyter-releaser": {
92+
"skip": ["check-links"],
93+
"hooks": {
94+
"before-build-npm": [
95+
"python -m pip install jupyterlab~=3.1",
96+
"jlpm"
97+
]
98+
}
99+
},
91100
"styleModule": "style/index.js"
92101
}

pyproject.toml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
[build-system]
2-
requires = ["jupyter_packaging~=0.7.9", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["jupyter_packaging~=0.10", "jupyterlab~=3.0", "tornado~=6.1"]
3+
build-backend = "jupyter_packaging.build_api"
4+
5+
[license]
6+
file="LICENSE"
7+
8+
[tool.jupyter-packaging.options]
9+
skip-if-exists = ["jupyterlab_snippets/labextension/static/style.js"]
10+
ensured-targets = ["jupyterlab_snippets/labextension/static/style.js", "jupyterlab_snippets/labextension/package.json"]
11+
12+
[tool.jupyter-packaging.builder]
13+
factory = "jupyter_packaging.npm_builder"
14+
15+
[tool.jupyter-packaging.build-args]
16+
build_cmd = "build:prod"
17+
npm = ["jlpm"]
18+
19+
[tool.check-manifest]
20+
ignore = ["binder/**", "*.json", "*.ipynb", "*.gif", "yarn.lock", ".*", "jupyterlab_snippets/labextension/**", "jupyter-boilerplate-converter/**"]
21+

0 commit comments

Comments
 (0)