Skip to content
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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ epython extmodule.epy --backend=cpython

Produces a compiled extension module for the given Python backend.

## Docker Development
----------------------

Install Docker, then run:

`docker build -t epython-wasm -f ./development/Dockerfile .`

From the root of the repository.

To run the interactive session:

`docker run -p 8008:8000 -t epython-wasm:latest `

# Development

Expand Down
38 changes: 38 additions & 0 deletions development/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM pyodide/pyodide:0.20.0

# Switch shell to bash
SHELL ["/bin/bash", "-c"]

# Setup epyhton-dev
RUN mkdir -p /epython/ &&\
mkdir -p /epython/epython/

# Copy Development Files
COPY ./development/environment.yaml .
COPY ./epython/* /epython/epython/
COPY setup.py /epython/
COPY README.md /epython/
COPY tests /epyhton/

# Add Conda to PATH
ENV PATH /opt/conda/bin:$PATH

# Install Miniconda
RUN wget --quiet "https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh" -O ~/miniconda.sh &&\
/bin/bash ~/miniconda.sh -q -b -p /opt/conda &&\
conda init &&\
conda env update --quiet -f ./environment.yaml &&\
echo "conda activate epython-dev" >> /root/.bashrc

ENV PATH /opt/conda/envs/epyhton-dev/bin:$PATH

SHELL ["conda", "run", "-n", "epython-dev", "/bin/bash", "-c"]

RUN cd /epython/ && pip install . &&\
cd /src/pyodide/ && pip install -e pyodide-build

ENV PYTHONPATH /src/pyodide/pyodide-build/:$PYTHONPATH

RUN cd ./pyodide/ && make

CMD ["python", "-m", "pyodide_build", "serve"]
8 changes: 8 additions & 0 deletions development/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: epython-dev
channels:
- conda-forge
dependencies:
- python==3.9
- pydantic
- pip
- pyyaml