Skip to content

Commit c218e07

Browse files
authored
Update to hatch-based build system and fix CI (#541)
* Update to hatch-based build system and fix CI * Temporarily fix pre-commit hooks * Limit to Python 3.9 to 3.12 * Exclude text from Matplotlib UI image comparison tests * Fix test matrix * Install from sdist on python 3.11 not 3.12 to avoid compiling zmq
1 parent 238d796 commit c218e07

39 files changed

+2958
-4338
lines changed

setup.cfg renamed to .flake8

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
[bdist_wheel]
2-
universal=1
3-
4-
[metadata]
5-
license_file = LICENSE
6-
71
[flake8]
8-
exclude = docs, _version.py, .eggs, example
2+
exclude = docs, _version.py, .eggs, example node_modules
93
max-line-length = 88
104
docstring-convention = "numpy"
115
extend-ignore =

.github/workflows/docs.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ defaults:
77
run:
88
shell: bash -l {0}
99
jobs:
10-
build:
10+
build_docs:
1111
runs-on: ubuntu-20.04
1212
steps:
1313
- uses: actions/checkout@v2
1414
- name: Install Conda environment with Micromamba
15-
uses: mamba-org/provision-with-micromamba@main
15+
uses: mamba-org/setup-micromamba@v1
1616
with:
17-
environment-name: ipympl-dev
1817
environment-file: dev-environment.yml
19-
channels: conda-forge
2018
- name: Install
2119
run: python -m pip install -v .[docs]
2220
- name: Build

.github/workflows/main.yml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,17 @@ jobs:
1818
build:
1919
runs-on: ubuntu-latest
2020
steps:
21-
2221
- name: Checkout
2322
uses: actions/checkout@v2
2423

2524
- name: Install Conda environment with Micromamba
26-
uses: mamba-org/provision-with-micromamba@main
25+
uses: mamba-org/setup-micromamba@v1
2726
with:
28-
environment-name: ipympl-dev
29-
environment-file: dev-environment.yml
30-
channels: conda-forge
27+
environment-file: dev-environment.yml
3128

3229
- name: Build packages
3330
run: |
34-
python setup.py sdist bdist_wheel
31+
python -m build
3532
cd dist
3633
sha256sum * | tee SHA256SUMS
3734
@@ -49,25 +46,30 @@ jobs:
4946
fail-fast: false
5047
matrix:
5148
os: [ubuntu, macos]
52-
python: ['3.10', '3.9']
53-
mpl-version: ['3.5', 'latest']
49+
python: ['3.9', '3.12']
50+
mpl-version: ['latest']
51+
dist: ['ipympl*.whl']
5452
include:
55-
- python: '3.10'
56-
dist: 'ipympl*.tar.gz'
57-
- python: '3.9'
53+
# Earliest supported Matplotlib, needs python <= 3.10
54+
- os: ubuntu
55+
python: '3.9'
56+
mpl-version: '3.5'
5857
dist: 'ipympl*.whl'
58+
# Install from sdist not wheel
59+
- os: ubuntu
60+
python: '3.11'
61+
mpl-version: 'latest'
62+
dist: 'ipympl*.tar.gz'
5963

6064
steps:
6165
- name: Checkout
6266
uses: actions/checkout@v2
6367

6468
- name: Install Conda environment with Micromamba
65-
uses: mamba-org/provision-with-micromamba@main
69+
uses: mamba-org/setup-micromamba@v1
6670
with:
67-
environment-name: ipympl-dev
6871
environment-file: dev-environment.yml
69-
channels: conda-forge
70-
extra-specs: |
72+
create-args: >-
7173
python=${{ matrix.python }}
7274
7375
- if: matrix.mpl-version == 'latest'
@@ -104,18 +106,18 @@ jobs:
104106
run: jupyter labextension list 2>&1 | grep jupyter-matplotlib
105107

106108
- name: Run pytest
107-
run: pytest .
109+
run: pytest -v .
108110

109111
- name: Install Galata test dependencies
110112
if: matrix.os == 'ubuntu'
111113
run: |
112-
yarn install
113-
yarn playwright install chromium
114+
jlpm install
115+
jlpm playwright install chromium
114116
working-directory: ui-tests
115117

116118
- name: Launch JupyterLab
117119
if: matrix.os == 'ubuntu'
118-
run: yarn run start:detached
120+
run: jlpm start:detached
119121
working-directory: ui-tests
120122

121123
- name: Wait for JupyterLab
@@ -127,7 +129,7 @@ jobs:
127129

128130
- name: Run UI Tests
129131
if: matrix.os == 'ubuntu'
130-
run: yarn run test
132+
run: jlpm test
131133
working-directory: ui-tests
132134

133135
- name: Upload UI Test artifacts
@@ -150,7 +152,7 @@ jobs:
150152
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
151153
OS: ${{ matrix.os }}
152154
PYTHON: ${{ matrix.python }}
153-
MATPLOLIBT: ${{ matrix.mpl-version }}
155+
MATPLOTLIB: ${{ matrix.mpl-version }}
154156
RUN_ID: ${{ github.run_id }}
155157
TITLE: '[test-bot] Scheduled Tests are failing'
156158
with:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
3939
- name: Publish the NPM package
4040
run: |
41-
yarn install && yarn run build
41+
jlpm install && jlpm build
4242
npm publish
4343
env:
4444
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/update_galata_references.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,22 @@ jobs:
3333
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3434

3535
- name: Install Conda environment with Micromamba
36-
uses: mamba-org/provision-with-micromamba@main
36+
uses: mamba-org/setup-micromamba@v1
3737
with:
38-
environment-name: ipympl-dev
3938
environment-file: dev-environment.yml
40-
python-version: 3.9
41-
auto-activate-base: false
42-
channels: conda-forge
43-
39+
create-args: >-
40+
python=3.9
4441
- name: Install ipympl
4542
run: pip install .
4643

4744
- name: Install Galata
4845
run: |
49-
yarn install
50-
yarn playwright install chromium
46+
jlpm install
47+
jlpm playwright install chromium
5148
working-directory: ui-tests
5249

5350
- name: Launch JupyterLab
54-
run: yarn run start:detached
51+
run: jlpm start:detached
5552
working-directory: ui-tests
5653

5754
- name: Wait for JupyterLab
@@ -61,7 +58,7 @@ jobs:
6158
timeout: 20000
6259

6360
- name: Generate updated Galata References
64-
run: yarn run test:update
61+
run: jlpm test:update
6562
working-directory: ui-tests
6663

6764
- name: Compress screenshots

.pre-commit-config.yaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
- id: autoflake
1919
args: ["--in-place", "--remove-all-unused-imports", "--ignore-init-module-imports", "--remove-unused-variables"]
2020
- repo: https://github.com/PyCQA/isort
21-
rev: 5.10.1
21+
rev: 5.13.2
2222
hooks:
2323
- id: isort
2424
- repo: https://github.com/psf/black
@@ -36,17 +36,17 @@ repos:
3636
- id: prettier
3737
types: [ts]
3838

39-
- repo: https://github.com/pre-commit/mirrors-eslint
40-
rev: 'v8.19.0'
41-
hooks:
42-
- id: eslint
43-
files: \.ts$ # *.ts
44-
types: [file]
45-
additional_dependencies:
46-
- eslint
47-
- prettier
48-
- typescript
49-
- '@typescript-eslint/eslint-plugin'
50-
- '@typescript-eslint/parser'
51-
- 'eslint-config-prettier'
52-
- 'eslint-plugin-prettier'
39+
# - repo: https://github.com/pre-commit/mirrors-eslint
40+
# rev: 'v8.19.0'
41+
# hooks:
42+
# - id: eslint
43+
# files: \.ts$ # *.ts
44+
# types: [file]
45+
# additional_dependencies:
46+
# - eslint
47+
# - prettier
48+
# - typescript
49+
# - '@typescript-eslint/eslint-plugin'
50+
# - '@typescript-eslint/parser'
51+
# - 'eslint-config-prettier'
52+
# - 'eslint-plugin-prettier'

MANIFEST.in

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ notebook / lab frontend. For lab, this is done by the command:
105105

106106
```bash
107107
jupyter labextension develop --overwrite .
108-
yarn run build
108+
jlpm build
109109
```
110110

111111
For classic notebook, you need to run:
@@ -122,7 +122,7 @@ If you use JupyterLab to develop then you can watch the source directory and run
122122

123123
```bash
124124
# Watch the source directory in one terminal, automatically rebuilding when needed
125-
yarn run watch
125+
jlpm watch
126126
# Run JupyterLab in another terminal
127127
jupyter lab
128128
```

dev-environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ channels:
44
dependencies:
55
- pip
66
- yarn
7-
- jupyter-packaging
87
- jupyterlab=3
98
- ipywidgets>=7.6
109
- pillow

docs/_static/custom.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/* Fix numpydoc format delimiters */
22
.classifier:before {
3-
font-style: normal;
4-
margin: 0.5em;
5-
content: ":";
3+
font-style: normal;
4+
margin: 0.5em;
5+
content: ':';
66
}
77

88
/* override table no-wrap */
99
.wy-table-responsive table td,
1010
.wy-table-responsive table th {
11-
white-space: normal;
11+
white-space: normal;
1212
}

0 commit comments

Comments
 (0)