Skip to content

Commit

Permalink
Merge branch 'main' into console-redirect-textio
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Dec 21, 2024
2 parents 45eec92 + 0065e61 commit fec4e7e
Show file tree
Hide file tree
Showing 359 changed files with 4,067 additions and 2,017 deletions.
43 changes: 35 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defaults: &defaults
# Note: when updating the docker image version,
# make sure there are no extra old versions lying around.
# (e.g. `rg -F --hidden <old_tag>`)
- image: pyodide/pyodide-env:20240312-chrome122-firefox122
- image: pyodide/pyodide-env:20241106-chrome130-firefox132
environment:
- EMSDK_NUM_CORES: 3
EMCC_CORES: 3
Expand All @@ -29,6 +29,8 @@ jobs:
- DISABLE_DYLINK: << parameters.disable_dylink >>
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init

- restore_cache:
keys:
Expand Down Expand Up @@ -132,6 +134,8 @@ jobs:
resource_class: large
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init

- attach_workspace:
at: .
Expand Down Expand Up @@ -190,6 +194,8 @@ jobs:
resource_class: large
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init

- attach_workspace:
at: .
Expand Down Expand Up @@ -219,6 +225,8 @@ jobs:
<<: *defaults
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init

- attach_workspace:
at: .
Expand Down Expand Up @@ -246,6 +254,8 @@ jobs:
<<: *defaults
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init

- attach_workspace:
at: .
Expand Down Expand Up @@ -329,7 +339,8 @@ jobs:
command: |
make npm-link
pip install -r requirements.txt
pytest -s benchmark/stack_usage.py --rt node,chrome,firefox | sed -n 's/## //pg'
# TODO(cclauss): Re-add 'firefox' below.
pytest -s benchmark/stack_usage.py --rt node,chrome | sed -n 's/## //pg'
test-js:
<<: *defaults
Expand Down Expand Up @@ -578,11 +589,27 @@ workflows:
tags:
only: /.*/

- build-packages:
name: build-static-libraries
packages: "tag:static_library"
requires:
- build-core
filters:
tags:
only: /.*/
post-steps:
- persist_to_workspace:
root: .
paths:
- ./packages
- ./dist

- build-packages:
name: build-libraries
packages: "tag:library"
requires:
- build-core
- build-static-libraries
filters:
tags:
only: /.*/
Expand Down Expand Up @@ -659,7 +686,7 @@ workflows:

- test-main:
name: test-core-chrome-nodylink
test-params: --runtime=chrome-no-host -m 'not requires_dynamic_linking' -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=chrome-no-host -m 'not requires_dynamic_linking' -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/ packages/buffer-test/
requires:
- build-core-nodylink
filters:
Expand All @@ -668,7 +695,7 @@ workflows:

- test-main:
name: test-core-firefox-nodylink
test-params: --runtime=firefox-no-host -m 'not requires_dynamic_linking' -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=firefox-no-host -m 'not requires_dynamic_linking' -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/ packages/buffer-test/
requires:
- build-core-nodylink
filters:
Expand All @@ -677,7 +704,7 @@ workflows:

- test-main:
name: test-core-node-nodylink
test-params: --runtime=node-no-host -m 'not requires_dynamic_linking' -k "not cmdline_runner" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=node-no-host -m 'not requires_dynamic_linking' -k "not cmdline_runner" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/ packages/buffer-test/
requires:
- build-core-nodylink
filters:
Expand All @@ -686,7 +713,7 @@ workflows:

- test-main:
name: test-core-chrome
test-params: --runtime=chrome-no-host -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=chrome-no-host -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/ packages/buffer-test/
requires:
- build-core
filters:
Expand All @@ -695,7 +722,7 @@ workflows:

- test-main:
name: test-core-firefox
test-params: --runtime=firefox-no-host -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=firefox-no-host -k "not webworker" src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/ packages/buffer-test/
requires:
- build-core
filters:
Expand All @@ -704,7 +731,7 @@ workflows:

- test-main:
name: test-core-node
test-params: --runtime=node-no-host src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/
test-params: --runtime=node-no-host src packages/micropip packages/fpcast-test packages/sharedlib-test-py/ packages/cpp-exceptions-test/ packages/buffer-test/
requires:
- build-core
filters:
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Docker",
// keep in sync with "run_docker"
"image": "pyodide/pyodide-env:20240312-chrome122-firefox122",
"image": "pyodide/pyodide-env:20241106-chrome130-firefox132",
"remoteUser": "root",
"onCreateCommand": ".devcontainer/onCreate-docker.sh"
}
32 changes: 24 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,27 @@ jobs:
needs: get_python_version
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
python-version: ${{ needs.get_python_version.outputs.PYVERSION }}
- name: Install requirements
shell: bash -l {0}
run: |
mkdir test-results
python3 -m pip install -r requirements.txt -r requirements-deploy.txt
make pyodide_build
python3 -m pip install -r requirements.txt -r requirements-deploy.txt
- name: Run tests
shell: bash -l {0}
run: |
PYODIDE_ROOT=. pytest \
--junitxml=test-results/junit.xml \
--verbose \
--runtime=host \
--cov=pyodide_build --cov=pyodide \
--cov=pyodide \
src packages/_tests tools/
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false

Expand All @@ -68,7 +70,8 @@ jobs:

steps:
- uses: actions/checkout@v4

with:
submodules: recursive
- name: Cache ccache output
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -169,6 +172,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Download build artifact
uses: actions/download-artifact@v4
Expand All @@ -188,7 +193,7 @@ jobs:
pip install -r requirements.txt -r requirements-deploy.txt
make pyodide_build
- uses: pyodide/pyodide-actions/install-browser@v1
- uses: pyodide/pyodide-actions/install-browser@v2
with:
runner: ${{ matrix.runner }}
browser: ${{ matrix.browser }}
Expand Down Expand Up @@ -242,9 +247,20 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- id: check-build-trigger
name: Check build trigger
run: bash tools/check_build_trigger.sh
- name: Check build trigger
id: check-build-trigger
shell: bash
run: |
set -e -x
COMMIT_MSG=$(git log --no-merges -1 --oneline)
# The scipy tests will be triggered on push or on pull_request when the commit
# message contains "[scipy]"
if [[ "$GITHUB_EVENT_NAME" == push ||
"$COMMIT_MSG" =~ \[scipy\] ]]; then
echo "trigger=true" >> "$GITHUB_OUTPUT"
fi
test-scipy:
runs-on: ${{ matrix.os }}
Expand Down
57 changes: 37 additions & 20 deletions .github/workflows/update_cross_build_releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ on:
workflow_dispatch:
inputs:
version:
description: "Version number"
description: "Version number to update to. This should not contain the 'v' prefix, since our releases on GitHub do not have it."
required: true

env:
version: ${{ github.event_name == 'release' && github.event.release.tag_name || github.event.inputs.version }}

jobs:
update_cross_build_releases:
runs-on: ubuntu-latest
steps:
- name: Checkout
# Note: we check out the main branch so that the cross-build metadata
# file is always updated on top of the latest state of the repository.
- name: Checkout main branch
uses: actions/checkout@v4
with:
submodules: recursive
ref: main

- uses: actions/setup-python@v5
with:
Expand All @@ -25,32 +33,41 @@ jobs:
python -m pip install --upgrade pip
make pyodide_build
- name: Get version number (release)
if: github.event_name == 'release'
run: |
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Get version number (workflow_dispatch)
if: github.event_name == 'workflow_dispatch'
run: |
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Update cross-build metadata file
id: update_cross_build_metadata
working-directory: tools
run: |
python update_cross_build_releases.py "${{ env.VERSION }}"
python update_cross_build_releases.py "${{ env.version }}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update cross-build metadata file for version ${{ env.VERSION }} [skip ci]
title: Update cross-build metadata file for version ${{ env.VERSION }}
commit-message: Update cross-build metadata file for version ${{ env.version }} [skip ci]
title: Update cross-build metadata file for version ${{ env.version }}
body: |
This PR updates the cross-build metadata file for version ${{ env.VERSION }}
branch: update-cross-build-metadata-${{ env.VERSION }}
This PR updates the cross-build metadata file for the new version ${{ env.version }}.
Requesting a review from the @pyodide/core team.
branch: update-cross-build-metadata-${{ env.version }}
base: main
branch-suffix: timestamp
draft: true
add-paths: |
pyodide-cross-build-environments.json

- name: Create an issue if the update fails
if: failure() || steps.update_cross_build_metadata.outcome == 'failure'
uses: dacbd/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Update cross-build metadata file for version ${{ env.VERSION }} failed
body: |
## Description
The update of the cross-build metadata file for version ${{ env.VERSION }} failed.
## Additional information
Please check the logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
for more information and update the metadata file manually if necessary.
labels:
assignees: ${{ github.actor }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ pytest-pyodide
tools/symlinks
xbuildenv/
.pyodide-xbuildenv*
DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "pyodide-build"]
path = pyodide-build
url = https://github.com/pyodide/pyodide-build
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ repos:
name: mypy-tests
args: [--ignore-missing-imports]
files: ^(packages/|docs|/conftest.py|src/tests)
exclude: (^packages/.*/setup.py|/src|^packages/aiohttp/aiohttp_patch.py$)
exclude: (^packages/.*/setup.py|/src|^packages/aiohttp/aiohttp_patch.py$|^packages/zfpy/test_zfpy.py$)
additional_dependencies: *mypy-deps

- repo: https://github.com/pre-commit/mirrors-prettier
Expand Down
Loading

0 comments on commit fec4e7e

Please sign in to comment.