Skip to content

Commit e23ed39

Browse files
committed
Add a workflow to test the packaging
1 parent 95500a0 commit e23ed39

File tree

1 file changed

+108
-0
lines changed

1 file changed

+108
-0
lines changed

.github/workflows/packaging.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Packaging
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: '*'
8+
9+
env:
10+
PIP_DISABLE_PIP_VERSION_CHECK: 1
11+
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: Install node
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: '14.x'
26+
- name: Install Python
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: '3.9'
30+
architecture: 'x64'
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip wheel
34+
python -m pip install setuptools jupyter_packaging "jupyterlab>=3,<4"
35+
- name: Build PyPI distributions for ipywidgets
36+
run: |
37+
python setup.py sdist bdist_wheel
38+
- name: Build PyPI distributions for jupyterlab_widgets
39+
run: |
40+
jlpm
41+
jlpm run build
42+
cd jupyterlab_widgets
43+
python setup.py sdist bdist_wheel
44+
cp ./dist/* ../dist
45+
- name: Build checksum file
46+
run: |
47+
cd dist
48+
sha256sum * | tee SHA256SUMS
49+
- name: Upload distributions
50+
uses: actions/upload-artifact@v2
51+
with:
52+
name: dist ${{ github.run_number }}
53+
path: ./dist
54+
55+
install:
56+
runs-on: ${{ matrix.os }}-latest
57+
needs: [build]
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
os: [ubuntu, macos, windows]
62+
python: ['3.6', '3.9']
63+
include:
64+
- python: '3.6'
65+
dist: 'ipywidgets*.tar.gz'
66+
- python: '3.9'
67+
dist: 'ipywidgets*.whl'
68+
- python: '3.9'
69+
dist: 'jupyterlab_widgets*.tar.gz'
70+
- os: windows
71+
py_cmd: python
72+
- os: macos
73+
py_cmd: python3
74+
- os: ubuntu
75+
py_cmd: python
76+
steps:
77+
- name: Install Python
78+
uses: actions/setup-python@v2
79+
with:
80+
python-version: ${{ matrix.python }}
81+
architecture: 'x64'
82+
- uses: actions/download-artifact@v2
83+
with:
84+
name: dist ${{ github.run_number }}
85+
path: ./dist
86+
- name: Install the prerequisites
87+
run: |
88+
${{ matrix.py_cmd }} -m pip install pip wheel
89+
- name: Install the package
90+
run: |
91+
cd dist
92+
${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
93+
- name: Validate environment
94+
run: |
95+
${{ matrix.py_cmd }} -m pip freeze
96+
${{ matrix.py_cmd }} -m pip check
97+
- name: Validate the install
98+
run: |
99+
${{ matrix.py_cmd }} -m pip install jupyterlab~=3.0
100+
101+
jupyter labextension list
102+
jupyter labextension list 2>&1 | grep -ie "@jupyter-widgets/jupyterlab-manager.*enabled.*ok" -
103+
104+
- name: Check the Classic Notebook extension is installed
105+
if: matrix.dist != 'jupyterlab_widgets*.tar.gz'
106+
run: |
107+
jupyter nbextension list
108+
jupyter nbextension list 2>&1 | grep -ie "jupyter-js-widgets/extension.*enabled" -

0 commit comments

Comments
 (0)