Skip to content

Conversation

@create-issue-branch
Copy link
Contributor

@create-issue-branch create-issue-branch bot commented Oct 8, 2024

What's Changed?

  • Fixed dynamic switching when there are multiple files
  • Fixed which file runs in pyodide when there are multiple files

closes #1095

@create-issue-branch create-issue-branch bot temporarily deployed to previews/1097/merge October 8, 2024 15:40 Inactive
@loiswells97 loiswells97 changed the base branch from main to pyodide-migration October 8, 2024 15:40
@loiswells97 loiswells97 temporarily deployed to previews/1097/merge October 8, 2024 15:42 — with GitHub Actions Inactive
@loiswells97 loiswells97 temporarily deployed to previews/1097/merge October 8, 2024 16:06 — with GitHub Actions Inactive
@loiswells97 loiswells97 temporarily deployed to previews/1097/merge October 8, 2024 16:08 — with GitHub Actions Inactive
@loiswells97 loiswells97 temporarily deployed to previews/1097/merge October 8, 2024 16:14 — with GitHub Actions Inactive
@loiswells97 loiswells97 marked this pull request as ready for review October 8, 2024 16:20
);
if (hasSkulptOnlyModules || senseHatAlwaysEnabled) {
setUsePyodide(false);
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good solution
Why did you decide to put "break" here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to break out of looping over the components when one is found containing skulpt-only modules. The problem we were having only happened if are multiple components ("files"). If there was a file with skulpt-only imports it would switch to skulpt, but then if it found another file without skulpt-only imports afterwards it would switch back to pyodide and then the code wouldn't run. So we should break out of the loop as soon as we find a file with a skulpt-only import, as we already have enough information to know we need to use skulpt.

@loiswells97 loiswells97 temporarily deployed to previews/1097/merge October 9, 2024 11:45 — with GitHub Actions Inactive
@loiswells97 loiswells97 temporarily deployed to previews/1097/merge October 9, 2024 11:54 — with GitHub Actions Inactive
Copy link
Contributor

@KristinaDudnyk KristinaDudnyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work Lois👏👏👏

@loiswells97 loiswells97 merged commit 17dfe0a into pyodide-migration Oct 9, 2024
7 of 8 checks passed
@loiswells97 loiswells97 deleted the issues/1095-Fix_dynamic_pyodide_switching_with_multiple_files branch October 9, 2024 15:06
@loiswells97 loiswells97 mentioned this pull request Oct 22, 2024
loiswells97 added a commit that referenced this pull request Oct 22, 2024
## [0.28.0] - 2024-10-22 

### Added

- PyodideWorker setup for the editor (#1104)
- Enabling `pyodide` support in the web component (#1090)
- `Pyodide` `matplotlib` support (#1087)
- Tests for running simple programs in `pyodide` and `skulpt` (#1100)
- Fall back to `skulpt` if the host is not `crossOriginIsolated` (#1107)
- `Pyodide` `seaborn` support (#1106)
- `Pyodide` module caching (#1113)

### Changed

- Upgrade to `webpack 5` (#1096)
- Bump `pyodide` to `v0.26.2` (#1098)
- Updated the ImportErrors message (#1105)
- In ErrorMessage component added the way to display html elements in
string (#1105)

### Fixed

- Dynamic runner switching with more than one `python` file (#1097)
- Pyodide running the correct file (`main.py`) when there are multiple
`python` files (#1097)
- Build to include public files (#1112)
- Persisting choice of tabbed/split view when running `python` code
(#1114)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix dynamic pyodide switching with multiple files

3 participants