Skip to content

Commit e34445d

Browse files
committed
Rename Pyodide platform argument to Emscripten
The sitecustomize.py injected at pip-resolution time monkey-patches `platform.system()` to the platform argument value. Renaming `Pyodide` to `Emscripten` aligns that value with what `platform.system()` actually returns in a real Pyodide runtime, so PEP 508 markers like `platform_system != 'Emscripten'` work consistently in both the build-time and in-browser micropip paths.
1 parent a2d24b2 commit e34445d

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/serious_python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ To package Python files for the specific platform:
8585
dart run serious_python:main package app/src -p {platform}
8686
```
8787

88-
where `{platform}` can be one of the following: `Android`, `iOS`, `macOS`, `Windows`, `Linux` or `Pyodide`.
88+
where `{platform}` can be one of the following: `Android`, `iOS`, `macOS`, `Windows`, `Linux` or `Emscripten`.
8989

9090
By default, the command creates `app/app.zip` asset, but you can change its path/name with `--asset` argument:
9191

src/serious_python/bin/package_command.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const platforms = {
4545
"x86_64": {"tag": "android-24-x86_64", "mac_ver": ""},
4646
"x86": {"tag": "android-24-x86", "mac_ver": ""}
4747
},
48-
"Pyodide": {
48+
"Emscripten": {
4949
"": {"tag": "pyodide-2024.0-wasm32", "mac_ver": ""}
5050
},
5151
"Darwin": {
@@ -96,7 +96,7 @@ class PackageCommand extends Command {
9696
PackageCommand() {
9797
argParser.addOption('platform',
9898
abbr: "p",
99-
allowed: ["iOS", "Android", "Pyodide", "Windows", "Linux", "Darwin"],
99+
allowed: ["iOS", "Android", "Emscripten", "Windows", "Linux", "Darwin"],
100100
mandatory: true,
101101
help: "Install dependencies for specific platform, e.g. 'Android'.");
102102
argParser.addMultiOption('arch',
@@ -195,13 +195,13 @@ class PackageCommand extends Command {
195195
}
196196

197197
bool isMobile = (platform == "iOS" || platform == "Android");
198-
bool isWeb = platform == "Pyodide";
198+
bool isWeb = platform == "Emscripten";
199199

200200
var junkFiles = isMobile ? junkFilesMobile : junkFilesDesktop;
201201

202202
// Extra indexs
203203
List<String> extraPyPiIndexes = [mobilePyPiUrl];
204-
if (platform == "Pyodide") {
204+
if (platform == "Emscripten") {
205205
pyodidePyPiServer = await startSimpleServer();
206206
extraPyPiIndexes.add(
207207
"http://${pyodidePyPiServer.address.host}:${pyodidePyPiServer.port}/simple");
@@ -430,7 +430,7 @@ class PackageCommand extends Command {
430430
}
431431

432432
// copy site packages to temp dir for web platform
433-
if (platform == "Pyodide" && requirements.isNotEmpty) {
433+
if (platform == "Emscripten" && requirements.isNotEmpty) {
434434
final sitePackagesSrcDir = Directory(sitePackagesRoot);
435435
if (await sitePackagesSrcDir.exists()) {
436436
stdout.writeln("Copying site packages to app archive");

src/serious_python/example/flet_example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dart run serious_python:main package app/src -p Linux --requirements -r,app/src/
3737
For web:
3838

3939
```
40-
dart run serious_python:main package app/src -p Pyodide --requirements -r,app/src/requirements.txt
40+
dart run serious_python:main package app/src -p Emscripten --requirements -r,app/src/requirements.txt
4141
```
4242

4343
Important: to make `serious_python` work in your own Android app:

src/serious_python/example/run_example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dart run serious_python:main package app/src -p Linux -r -r -r app/src/requireme
4040
For Pyodide:
4141

4242
```
43-
dart run serious_python:main package app/src -p Pyodide -r -r -r app/src/requirements.txt
43+
dart run serious_python:main package app/src -p Emscripten -r -r -r app/src/requirements.txt
4444
```
4545

4646
For Android:

0 commit comments

Comments
 (0)