Skip to content

Commit 7b80cf9

Browse files
authored
Backport PR #16314: Run Python tests on MacOS with Python 12, replace canvas with jest-canvas-mock (#16501)
1 parent d3897d2 commit 7b80cf9

File tree

13 files changed

+85
-86
lines changed

13 files changed

+85
-86
lines changed

docs/source/developer/contributing.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -271,19 +271,6 @@ Notes:
271271
called something else (such as "python3") then parts of the build
272272
will fail. You may wish to build in a conda environment, or make an
273273
alias.
274-
- Some of the packages used in the development environment require
275-
Python 3.0 or higher. If you encounter an ImportError during the
276-
installation, make sure Python 3.0+ is installed. Also, try using the
277-
Python 3.0+ version of ``pip`` or ``pip3 install -e .`` command to
278-
install JupyterLab from the forked repository.
279-
- If you see an error that says ``Call to 'pkg-config pixman-1 --libs'
280-
returned exit status 127 while in binding.gyp`` while running the
281-
``pip install`` command above, you may be missing packages required
282-
by ``canvas``. On macOS with Homebrew, you can add these packages by
283-
running
284-
``brew install pkg-config cairo pango libpng jpeg giflib librsvg``.
285-
If you are using mamba or conda, you can install the necessary packages
286-
with `conda install -c conda-forge pkg-config glib pango pixman`.
287274
- The ``jlpm`` command is a JupyterLab-provided, locked version of the
288275
`yarn <https://classic.yarnpkg.com/en/>`__ package manager. If you have
289276
``yarn`` installed already, you can use the ``yarn`` command when
Lines changed: 1 addition & 1 deletion
Loading

galata/test/galata/benchmarkReporter.spec.ts-snapshots/test-galata-linux.svg

Lines changed: 1 addition & 1 deletion
Loading

packages/csvviewer/jest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
/*
2+
* Copyright (c) Jupyter Development Team.
3+
* Distributed under the terms of the Modified BSD License.
4+
*/
5+
16
const func = require('@jupyterlab/testutils/lib/jest-config');
7+
const config = func(__dirname);
28
module.exports = func(__dirname);
9+
config['setupFiles'].push('jest-canvas-mock');
10+
module.exports = config;

packages/csvviewer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
"devDependencies": {
5757
"@jupyterlab/testutils": "^3.6.7",
5858
"@types/jest": "^26.0.10",
59-
"canvas": "^2.6.1",
6059
"csv-spectrum": "^1.0.0",
6160
"jest": "^26.4.2",
61+
"jest-canvas-mock": "^2.5.2",
6262
"rimraf": "~3.0.0",
6363
"ts-jest": "^26.3.0",
6464
"typedoc": "~0.21.2",

packages/debugger/jest.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1+
/*
2+
* Copyright (c) Jupyter Development Team.
3+
* Distributed under the terms of the Modified BSD License.
4+
*/
5+
16
const func = require('@jupyterlab/testutils/lib/jest-config');
2-
module.exports = func(__dirname);
7+
const config = func(__dirname);
8+
config['setupFiles'].push('jest-canvas-mock');
9+
module.exports = config;

packages/debugger/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
"@types/jest": "^26.0.10",
8585
"@types/react-dom": "^17.0.0",
8686
"@types/text-encoding": "^0.0.35",
87-
"canvas": "^2.6.1",
8887
"jest": "^26.4.2",
88+
"jest-canvas-mock": "^2.5.2",
8989
"jest-junit": "^11.1.0",
9090
"jest-raw-loader": "^1.0.1",
9191
"jest-summary-reporter": "^0.0.2",

packages/terminal/jest.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1+
/*
2+
* Copyright (c) Jupyter Development Team.
3+
* Distributed under the terms of the Modified BSD License.
4+
*/
5+
16
const func = require('@jupyterlab/testutils/lib/jest-config');
2-
module.exports = func(__dirname);
7+
const config = func(__dirname);
8+
config['setupFiles'].push('jest-canvas-mock');
9+
module.exports = config;

packages/terminal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
"devDependencies": {
5656
"@jupyterlab/testutils": "^3.6.7",
5757
"@types/jest": "^26.0.10",
58-
"canvas": "^2.6.1",
5958
"jest": "^26.4.2",
59+
"jest-canvas-mock": "^2.5.2",
6060
"rimraf": "~3.0.0",
6161
"ts-jest": "^26.3.0",
6262
"typedoc": "~0.21.2",

packages/vega5-extension/jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
*/
55

66
const func = require('@jupyterlab/testutils/lib/jest-config');
7-
module.exports = func(__dirname);
7+
const config = func(__dirname);
8+
config['setupFiles'].push('jest-canvas-mock');
9+
module.exports = config;

0 commit comments

Comments
 (0)