| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
PyScript single core to rule them all
Please read the documentation page to know all the user-facing details around this module.
The working folder (source code of truth) is the ./esm one, while the ./cjs is populated as a dual module and to test (but it's 1:1 code, no transpilation except for imports/exports).
# install all dependencies needed by core
npm iThis project requires some automatic artifact creation to:
Accordingly, to build latest project:
# activate once the Python env (to use pyminify)
. env.sh # or source env.sh
# create all artifacts needed to test core
npm run build
# optionally spin a server with CORS, COOP, and COEP enabled
npm run serverIf no minification is desired or helpful while debugging potential issues, please use NO_MIN=1 in front of the build step:
NO_MIN=1 npm run build
npm run serverBesides spinning the localhost server via npm run server, the npm run dev will watch changes in the ./esm folder and it will build automatically non optimized artifacts out of the box.
To keep it simple, and due to technical differences between what was in PyScript before and what we actually need for core (special headers, multiple interpreters, different bootstrap logic), core integration tests can be performed simply by running:
npm run test:integrationThe package's entry takes care of eventually bootstrapping localhost, starting in parallel all tests, and shutting down the server after, if any was bootstrapped.
The tool to test integration is still playwright but moves things a bit faster (from my side) tests are written in JS.
integration
├ interpreter
│ ├ micropython
│ ├ pyodide
│ ├ ruby-wasm-wasi
│ ├ wasmoon
│ ├ xxx.yy
│ ├ xxx.toml
│ └ utils.js
├ _shared.js
├ micropython.js
├ pyodide.js
├ ruby-wasm-wasi.js
└ wasmoon.js
The test/integration.spec.js file simply loops over folders that match interpreters by name and execute in parallel all tests.
To test manually an integration test, simply npm run server and visit http://localhost:8080/ or http://localhost:8080/test/integration.html to find a list of all integration tests available in the related folder.
As example, reaching http://localhost:8080/test/integration/interpreter/micropython/fetch.html would log in the console and show expectations on the page and this can be easily tested via multiple browsers by simply reaching the very same integration test.
| Back | FazBrowse Home | New Git URL |