2018-02-24 17:52:47 +00:00
|
|
|
# Pyodide
|
|
|
|
|
2018-06-05 01:11:32 +00:00
|
|
|
[![Build Status](https://circleci.com/gh/iodide-project/pyodide.png)](https://circleci.com/gh/iodide-project/pyodide)
|
2018-03-30 18:10:03 +00:00
|
|
|
|
2018-06-07 19:50:53 +00:00
|
|
|
The Python scientific stack, compiled to WebAssembly.
|
|
|
|
|
|
|
|
It provides transparent conversion of objects between Javascript and Python and
|
|
|
|
a sharing of global namespaces. When inside a browser, this means Python has
|
|
|
|
full access to the Web APIs.
|
2018-02-23 19:34:33 +00:00
|
|
|
|
2018-06-07 19:43:04 +00:00
|
|
|
See [the demo](https://iodide.io/pyodide-demo/python.html)
|
|
|
|
|
2018-02-23 19:34:33 +00:00
|
|
|
# Building
|
|
|
|
|
|
|
|
These instructions were tested on Linux. OSX should be substantively the same.
|
|
|
|
|
2018-06-07 19:43:04 +00:00
|
|
|
Make sure the prerequisites for [emsdk](https://github.com/juj/emsdk) are installed.
|
2018-02-23 19:34:33 +00:00
|
|
|
|
2018-06-19 14:56:17 +00:00
|
|
|
Additional build prerequisites are:
|
|
|
|
|
|
|
|
- [lessc](https://lesscss.org/) to compile less to css.
|
|
|
|
- [uglifyjs](https://github.com/mishoo/UglifyJS) to minify Javascript builds.
|
2018-04-26 15:04:28 +00:00
|
|
|
|
2018-03-30 17:08:06 +00:00
|
|
|
Type `make`.
|
2018-02-23 19:34:33 +00:00
|
|
|
|
2018-03-30 17:08:06 +00:00
|
|
|
(The build downloads and builds a local, patched version of emsdk, then
|
2018-06-07 19:43:04 +00:00
|
|
|
downloads and builds Python and third-party packages).
|
2018-03-30 14:51:13 +00:00
|
|
|
|
|
|
|
# Testing
|
|
|
|
|
|
|
|
1. Install the following dependencies into the default Python installation:
|
|
|
|
|
|
|
|
`pip install pytest selenium`
|
|
|
|
|
|
|
|
2. Install [geckodriver](https://github.com/mozilla/geckodriver/releases) somewhere
|
|
|
|
on your `PATH`.
|
|
|
|
|
|
|
|
3. `make test`
|
2018-04-11 14:17:02 +00:00
|
|
|
|
|
|
|
# Benchmarking
|
|
|
|
|
|
|
|
1. Install the same dependencies as for testing.
|
|
|
|
|
|
|
|
2. `make benchmark`
|
2018-06-14 18:19:08 +00:00
|
|
|
|
|
|
|
# Linting
|
|
|
|
|
|
|
|
1. Python is linted with `flake8`. C and Javascript are linted with `clang-format`.
|
|
|
|
|
|
|
|
2. `make lint`
|