Skip to content

Commit 7226d36

Browse files
authored
Update docs to use latest ipywidgets + jupyterlite-xeus (#359)
* Update docs * Update CI * Update CI take 2 * Update CI take 3 * Update CI take 4 * Not silencing errors * Update docs env * Yay
1 parent 975beb3 commit 7226d36

File tree

7 files changed

+54
-24
lines changed

7 files changed

+54
-24
lines changed

.github/workflows/check-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919

2020
- name: Base Setup
2121
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
@@ -27,7 +27,7 @@ jobs:
2727
version_spec: next
2828

2929
- name: Upload Distributions
30-
uses: actions/upload-artifact@v2
30+
uses: actions/upload-artifact@v4
3131
with:
3232
name: ipycanvas-releaser-dist-${{ github.run_number }}
3333
path: .jupyter_releaser_checkout/dist

.github/workflows/main.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ jobs:
2424

2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v4
2828

2929
- name: Install Conda environment with Micromamba
30-
uses: mamba-org/provision-with-micromamba@main
30+
uses: mamba-org/setup-micromamba@v1
3131
with:
3232
environment-name: ipycanvas-dev
3333
environment-file: dev-environment.yml
3434
channels: conda-forge
35-
extra-specs: |
35+
create-args: >-
3636
python=${{ matrix.python-version }}
3737
3838
- name: Test PEP8
@@ -46,15 +46,15 @@ jobs:
4646
steps:
4747

4848
- name: Checkout
49-
uses: actions/checkout@v2
49+
uses: actions/checkout@v4
5050

5151
- name: Install Conda environment with Micromamba
52-
uses: mamba-org/provision-with-micromamba@main
52+
uses: mamba-org/setup-micromamba@v1
5353
with:
5454
environment-name: ipycanvas-dev
5555
environment-file: dev-environment.yml
5656
channels: conda-forge
57-
extra-specs: |
57+
create-args: >-
5858
python=${{ matrix.python-version }}
5959
6060
@@ -65,7 +65,7 @@ jobs:
6565
sha256sum * | tee SHA256SUMS
6666
6767
- name: Upload builds
68-
uses: actions/upload-artifact@v2
68+
uses: actions/upload-artifact@v4
6969
with:
7070
name: dist ${{ github.run_number }}
7171
path: ./dist
@@ -86,18 +86,18 @@ jobs:
8686
steps:
8787

8888
- name: Checkout
89-
uses: actions/checkout@v2
89+
uses: actions/checkout@v4
9090

9191
- name: Install Conda environment with Micromamba
92-
uses: mamba-org/provision-with-micromamba@main
92+
uses: mamba-org/setup-micromamba@v1
9393
with:
9494
environment-name: ipycanvas-dev
9595
environment-file: dev-environment.yml
9696
channels: conda-forge
97-
extra-specs: |
97+
create-args: >-
9898
python=${{ matrix.python-version }}
9999
100-
- uses: actions/download-artifact@v2
100+
- uses: actions/download-artifact@v4
101101
with:
102102
name: dist ${{ github.run_number }}
103103
path: ./dist
@@ -150,7 +150,7 @@ jobs:
150150

151151
- name: Upload Playwright Test report
152152
if: always()
153-
uses: actions/upload-artifact@v3
153+
uses: actions/upload-artifact@v4
154154
with:
155155
name: ipycanvas-playwright-tests
156156
path: |

.github/workflows/update_galata_references.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
steps:
2727
- name: Checkout
28-
uses: actions/checkout@v2
28+
uses: actions/checkout@v4
2929
with:
3030
token: ${{ secrets.GITHUB_TOKEN }}
3131

@@ -41,14 +41,15 @@ jobs:
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242

4343
- name: Install Conda environment with Micromamba
44-
uses: mamba-org/provision-with-micromamba@main
44+
uses: mamba-org/setup-micromamba@v1
4545
with:
4646
environment-name: ipycanvas-dev
4747
environment-file: dev-environment.yml
4848
channels: conda-forge
49-
extra-specs: |
49+
create-args: >-
5050
python=${{ matrix.python-version }}
5151
52+
5253
- name: Install the package
5354
run: pip install -vv .
5455

docs/build-environment.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ channels:
55

66
dependencies:
77
- ipycanvas
8-
- mamba
9-
# This is needed for building ipycanvas from source for the emscripten env
8+
- micromamba
109
- yarn
1110
# Docs requirements
1211
- pydata-sphinx-theme
1312
- jupyterlite-sphinx
14-
- jupyterlite-xeus-python >=0.9.2,<0.10
13+
- jupyterlite-core
14+
- jupyterlite-xeus
1515
- jupyterlab-night

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon", "jupyterlite_sphinx"]
33

44
jupyterlite_dir = "."
5+
jupyterlite_silence = False
56

67
master_doc = "index"
78
source_suffix = ".rst"

docs/environment.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: ipycanvas
22
channels:
33
- https://repo.mamba.pm/emscripten-forge
4-
- https://repo.mamba.pm/conda-forge
4+
- conda-forge
55
dependencies:
6+
- xeus-python
67
- pillow
78
- numpy
8-
- ipywidgets
9+
- ipywidgets>=8.1.3
910
- pip:
1011
- ..

docs/index.rst

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,35 @@ You can try ipycanvas, without the need of installing anything on your computer,
1616

1717
Or you can run it directly in your browser using JupyterLite!!
1818

19-
.. image:: https://jupyterlite.rtfd.io/en/latest/_static/badge.svg
20-
:target: https://ipycanvas.readthedocs.io/en/latest/lite/lab
19+
.. replite::
20+
:kernel: xpython
21+
:height: 600px
22+
23+
from math import pi
24+
25+
from ipycanvas import Canvas
26+
27+
canvas = Canvas(width=1600, height=1200, layout=dict(width="100%"))
28+
29+
canvas.fill_style = "#8ee05e"
30+
canvas.fill_rect(0, 0, canvas.width, canvas.height)
31+
32+
canvas.fill_style = "#f5f533"
33+
canvas.fill_circle(canvas.width / 2.0, canvas.height / 2.0, 500)
34+
35+
canvas.stroke_style = "black"
36+
canvas.line_width = 30
37+
canvas.stroke_circle(canvas.width / 2.0, canvas.height / 2.0, 500)
38+
39+
canvas.fill_style = "black"
40+
canvas.fill_circle(canvas.width / 2.7, canvas.height / 3.0, 100) # Right eye
41+
canvas.stroke_arc(canvas.width / 2.0, canvas.height / 2.0, 400, 0, pi, False) # Mouth
42+
canvas.stroke_arc(
43+
canvas.width - canvas.width / 2.7, canvas.height / 2.7, 100, 0, pi, True
44+
) # Left eye
45+
46+
canvas
47+
2148

2249
Questions?
2350
----------

0 commit comments

Comments
 (0)