Skip to content

Polish readme.md plus VSIX support #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ tsconfig.watch.json
*.map
src/**
out/**
testbed
testbed
python
node_modules
configs
build
bin
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,58 @@

This project provides a VS Code extension to run Python code in the Web (e.g. vscode.dev) using WebAssembly as an execution engine.

# Index

[Limitations](#limitations)<br>
[Pre-requisites](#pre-requisites)<br>
[Python Environments](#python-environments)<br>
[Versioning](#versioning)<br>
[Contributing](#contributing)<br>
[Trademarks](#trademarks)<br>

## Limitations

The extension's intension is to serve as an experimentation environment to help the VS Code team to gain experiences about running Python code in the Web using WebAssembly technologies. It should not be used to do productive Python development since there are limitation in WebAssembly Python interpreted as well as limitations in VS Code itself.

### Python interpreter limitations

- no pip support.
- no socket support.
- no support for native Python modules.
- no thread support. As a consequence there is no async support either.

### VS Code limitations

- no debug support. You can only run a Python file.

## Pre-requisites

The extension depends on the [Github Repositories](https://marketplace.visualstudio.com/items?itemName=GitHub.remotehub) extensions. It also requires you to authenticate with GitHub.

## Python Environments

The extension uses a pre-configured Python environment based on the [CPython WebAssembly builds](https://github.com/tiran/cpython-wasm-test/releases). The used build is `Python-3.11.0rc1-wasm32-wasi-16.zip`

You can setup your own Python environment, included source wheel Python packages, following these steps:

- create a new GitHub repository.
- download a `wasm-wasi-16` build from https://github.com/tiran/cpython-wasm-test/releases and expand it into the root of the repository
- to add source wheel packages do the following:
- create a `site-packages` folder in the root
- install the package using the following command `pip install my_package --target ./site-packages`. Note that you need to have a Python installation in your OS including pip.
- commit the changes
- change the `python.wasm.runtime` setting to point to your GitHub repository. For example:
```
{
"python.wasm.runtime": "https://github.com/dbaeumer/python-3.11.0rc"
}
```


## Versioning

Odd major, minor or patch version numbers indicate an insider or pre-release. So `1.0.0` is a pre-release, `0.1.0` will be a pre-release as well. `2.0.2` will be a regular release.

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Expand Down
2 changes: 1 addition & 1 deletion src/desktop/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class DesktopLauncher extends BaseLauncher {
}

protected async createMessageConnection(context: ExtensionContext): Promise<MessageConnection<MessageRequests, undefined>> {
const filename = Uri.joinPath(context.extensionUri, './out/desktop/pythonWasmWorker.js').fsPath;
const filename = Uri.joinPath(context.extensionUri, './dist/desktop/pythonWasmWorker.js').fsPath;
this.worker = new Worker(filename);
const channel = new MessageChannel();
const ready = new Promise<void>((resolve, reject) => {
Expand Down