Skip to content

Commit 708358b

Browse files
committed
Merge branch 'main' into feature/0.18.0-nano
2 parents d3e9d25 + 250c480 commit 708358b

File tree

98 files changed

+3685
-1515
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3685
-1515
lines changed

.circleci/config.yml

+89-13
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
- restore_cache:
4343
keys:
44-
- -{{ checksum "Makefile.envs" }}-v20201205-
44+
- -{{ checksum "Makefile.envs" }}-v20201205-
4545

4646
- run:
4747
name: build emsdk
@@ -88,7 +88,6 @@ jobs:
8888
paths:
8989
- .
9090

91-
9291
- store_artifacts:
9392
path: /root/repo/build/
9493

@@ -102,7 +101,7 @@ jobs:
102101

103102
- restore_cache:
104103
keys:
105-
- -{{ checksum "Makefile.envs" }}-v20201205-
104+
- -{{ checksum "Makefile.envs" }}-v20201205-
106105

107106
- run:
108107
name: build packages
@@ -161,7 +160,7 @@ jobs:
161160
- run:
162161
name: stack-size
163162
command: |
164-
pytest -s benchmark/stack_usage.py | sed -n 's/## //pg' || true
163+
pytest -s benchmark/stack_usage.py | sed -n 's/## //pg'
165164
166165
test-emsdk:
167166
<<: *defaults
@@ -207,7 +206,6 @@ jobs:
207206
npm install
208207
npm test
209208
210-
211209
benchmark:
212210
<<: *defaults
213211
steps:
@@ -252,7 +250,7 @@ jobs:
252250
- run:
253251
name: Deploy to pyodide-cdn2.iodide.io
254252
command: |
255-
find build/ -type f -exec sh -c "echo \"Compressing {}\"; gzip {}; mv {}.gz {};" \;
253+
find build/ -type f -print0 | xargs -0 -n1 -I@ bash -c "echo \"Compressing @\"; gzip @; mv @.gz @;"
256254
aws s3 sync build/ "s3://pyodide-cdn2.iodide.io/v${CIRCLE_TAG}/full/" --exclude '*.data' --cache-control 'max-age=30758400, immutable, public' --content-encoding 'gzip' # 1 year cache
257255
aws s3 sync build/ "s3://pyodide-cdn2.iodide.io/v${CIRCLE_TAG}/full/" --exclude '*' --include '*.data' --cache-control 'max-age=30758400, immutable, public' --content-type 'application/wasm' --content-encoding 'gzip' # 1 year
258256
# update 301 redirect for the /latest/* route.
@@ -281,7 +279,7 @@ jobs:
281279
- run:
282280
name: Deploy to pyodide-cdn2.iodide.io
283281
command: |
284-
find build/ -type f -exec sh -c "echo \"Compressing {}\"; gzip {}; mv {}.gz {};" \;
282+
find build/ -type f -print0 | xargs -0 -n1 -I@ bash -c "echo \"Compressing @\"; gzip @; mv @.gz @;"
285283
aws s3 rm --recursive "s3://pyodide-cdn2.iodide.io/dev/full/"
286284
aws s3 sync build/ "s3://pyodide-cdn2.iodide.io/dev/full/" --exclude '*.data' --cache-control 'max-age=3600, public' --content-encoding 'gzip' # 1 hour cache
287285
aws s3 sync build/ "s3://pyodide-cdn2.iodide.io/dev/full/" --exclude '*' --include '*.data' --cache-control 'max-age=3600, public' --content-type 'application/wasm' --content-encoding 'gzip' # 1 hour cache
@@ -290,55 +288,133 @@ workflows:
290288
version: 2
291289
build-and-deploy:
292290
jobs:
293-
- lint
294-
- test-docs
295-
- test-python
296-
- build-core
291+
- lint:
292+
filters:
293+
tags:
294+
only: /.*/
295+
296+
- test-docs:
297+
filters:
298+
tags:
299+
only: /.*/
300+
301+
- test-python:
302+
filters:
303+
tags:
304+
only: /.*/
305+
306+
- build-core:
307+
filters:
308+
tags:
309+
only: /.*/
310+
297311
- build-packages:
298312
requires:
299313
- build-core
314+
filters:
315+
tags:
316+
only: /.*/
317+
300318
- test-main:
301319
name: test-core-chrome
302-
test-params: -k chrome src packages/micropip
320+
test-params: -k "chrome and not webworker" src packages/micropip
303321
requires:
304322
- build-core
323+
filters:
324+
tags:
325+
only: /.*/
326+
305327
- test-main:
306328
name: test-core-firefox
307-
test-params: -k firefox src packages/micropip
329+
test-params: -k "firefox and not webworker" src packages/micropip
308330
requires:
309331
- build-core
332+
filters:
333+
tags:
334+
only: /.*/
335+
310336
- test-main:
311337
name: test-core-node
312338
test-params: -k node src packages/micropip
313339
requires:
314340
- build-core
341+
filters:
342+
tags:
343+
only: /.*/
344+
345+
- test-main:
346+
name: test-core-chrome-webworker
347+
test-params: -k chrome src/tests/test_webworker.py
348+
requires:
349+
- test-core-chrome
350+
filters:
351+
tags:
352+
only: /.*/
353+
354+
- test-main:
355+
name: test-core-firefox-webworker
356+
test-params: -k firefox src/tests/test_webworker.py
357+
requires:
358+
- test-core-firefox
359+
filters:
360+
tags:
361+
only: /.*/
362+
315363
- test-main:
316364
name: test-packages-chrome
317365
test-params: -k chrome packages/test* packages/*/test*
318366
requires:
319367
- build-packages
368+
filters:
369+
tags:
370+
only: /.*/
371+
320372
- test-main:
321373
name: test-packages-firefox
322374
test-params: -k firefox packages/test* packages/*/test*
323375
requires:
324376
- build-packages
377+
filters:
378+
tags:
379+
only: /.*/
380+
325381
- test-main:
326382
name: test-packages-node
327383
test-params: -k "node and not numpy" packages/test* packages/*/test*
328384
requires:
329385
- build-packages
386+
filters:
387+
tags:
388+
only: /.*/
389+
330390
- test-emsdk:
331391
requires:
332392
- build-core
393+
filters:
394+
tags:
395+
only: /.*/
396+
333397
- test-js:
334398
requires:
335399
- build-core
400+
filters:
401+
tags:
402+
only: /.*/
403+
336404
- benchmark-stack-size:
337405
requires:
338406
- build-core
407+
filters:
408+
tags:
409+
only: /.*/
410+
339411
- benchmark:
340412
requires:
341413
- build-packages
414+
filters:
415+
tags:
416+
only: /.*/
417+
342418
- deploy-release:
343419
requires:
344420
- lint

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ emsdk/emsdk
2525
geckodriver.log
2626
node_modules
2727
packages/.artifacts
28-
packages/*/build.log
28+
packages/*/build.log*
2929
packages/build-logs
3030
dist/

.pre-commit-config.yaml

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,38 @@
11
exclude: '^.*patches|.*\.cgi$'
22
default_language_version:
3-
python : "3.9"
3+
python: "3.9"
44
repos:
5-
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
66
rev: v2.3.0
77
hooks:
8-
- id: check-yaml
9-
- id: end-of-file-fixer
10-
- id: trailing-whitespace
11-
- repo: https://github.com/psf/black
8+
- id: check-yaml
9+
- id: end-of-file-fixer
10+
- id: trailing-whitespace
11+
- repo: https://github.com/psf/black
1212
rev: 20.8b1
1313
hooks:
14-
- id: black
15-
- repo: https://gitlab.com/pycqa/flake8
14+
- id: black
15+
- repo: https://gitlab.com/pycqa/flake8
1616
rev: 3.7.8
1717
hooks:
18-
- id: flake8
18+
- id: flake8
1919
types: [file, python]
2020
# only check for unused imports, as the rest is done by black
2121
args: [--select=F401]
22-
- repo: https://github.com/pre-commit/mirrors-mypy
22+
- repo: https://github.com/pre-commit/mirrors-mypy
2323
rev: v0.812
2424
hooks:
25-
- id: mypy
25+
- id: mypy
2626
args:
2727
- --ignore-missing-imports
28-
- repo: local
28+
- repo: local
2929
hooks:
30-
- id: clang-format
30+
- id: clang-format
3131
name: clang-format-6.0
3232
language: system
3333
entry: ./tools/clang-format-precommit.sh
34+
35+
- repo: https://github.com/pre-commit/mirrors-prettier
36+
rev: "v2.3.2" # Use the sha / tag you want to point at
37+
hooks:
38+
- id: prettier

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,12 @@ lint: node_modules/.installed
144144
find src -type f -regex '.*\.\(c\|h\)' \
145145
| xargs clang-format-6.0 -output-replacements-xml \
146146
| (! grep '<replacement ')
147-
npx prettier --check `find src -type f -name '*.js' -not -name '*.gen.js'`
148-
npx prettier --check `find src -type f -name '*.html'`
147+
npx prettier --check src --ignore-path '*.gen.*'
149148
black --check .
150149
mypy --ignore-missing-imports \
151150
pyodide-build/pyodide_build/ \
152151
src/ \
153-
packages/micropip/micropip/ \
152+
packages/micropip/src/ \
154153
packages/*/test* \
155154
conftest.py \
156155
docs

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
</a>
55
</div>
66

7-
7+
[![NPM Latest Release](https://img.shields.io/npm/v/pyodide)](https://www.npmjs.com/package/pyodide)
8+
[![PyPI Latest Release](https://img.shields.io/pypi/v/pyodide-build.svg)](https://pypi.org/project/pyodide-build/)
89
[![Build Status](https://circleci.com/gh/pyodide/pyodide.png)](https://circleci.com/gh/pyodide/pyodide)
910
[![Documentation Status](https://readthedocs.org/projects/pyodide/badge/?version=stable)](https://pyodide.readthedocs.io/?badge=stable)
1011

@@ -53,8 +54,8 @@ technical resources. These include:
5354
recommended for Windows and macOS users and for Linux users who prefer a
5455
Debian-based Docker image with the dependencies already installed.
5556

56-
5757
## History
58+
5859
Pyodide was created in 2018 by [Michael Droettboom](https://github.com/mdboom)
5960
at Mozilla as part of the [Iodide
6061
project](https://github.com/iodide-project/iodide). Iodide is an experimental

benchmark/stack_usage.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
def print_info():
66
headings = [
77
"browser",
8+
"py_limit",
89
"py_usage",
910
"js_depth",
1011
"py_depth",
1112
"js_depth/py_usage",
1213
"js_depth/py_depth",
1314
]
14-
fmt = "## {{:{:d}s}} {{:{:d}.2f}} {{:{:d}g}} {{:{:d}g}} {{:{:d}g}} {{:{:d}g}}".format(
15+
fmt = "## {{:{:d}s}} {{:{:d}g}} {{:{:d}.2f}} {{:{:d}g}} {{:{:d}g}} {{:{:d}g}} {{:{:d}g}}".format(
1516
*map(len, headings)
1617
)
1718
printed_heading = False
@@ -31,20 +32,21 @@ def print_info(*args):
3132
def test_stack_usage(selenium, print_info):
3233
res = selenium.run_js(
3334
"""
34-
window.measure_available_js_stack_depth = () => {
35+
self.measure_available_js_stack_depth = () => {
3536
let depth = 0;
3637
function recurse() { depth += 1; recurse(); }
3738
try { recurse(); } catch (err) { }
3839
return depth;
3940
};
41+
let py_limit = pyodide.runPython("import sys; sys.getrecursionlimit()");
4042
let py_usage = pyodide.runPython(`
4143
from js import measure_available_js_stack_depth
4244
def recurse(n):
4345
return measure_available_js_stack_depth() if n==0 else recurse(n-1)
4446
(recurse(0)-recurse(100))/100
4547
`);
4648
let js_depth = measure_available_js_stack_depth();
47-
window.py_depth = [0];
49+
self.py_depth = [0];
4850
try {
4951
pyodide.runPython(`
5052
import sys
@@ -59,6 +61,7 @@ def infiniterecurse():
5961
6062
py_depth = py_depth[0];
6163
return [
64+
py_limit,
6265
py_usage,
6366
js_depth,
6467
py_depth,

0 commit comments

Comments
 (0)