Compare commits

...

2 commits

Author SHA1 Message Date
pre-commit-ci[bot]
022f3b42c5 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-07-21 22:33:21 +00:00
Bas Nijholt
79fa01a235 Fix webapp for Shinylive deployment by separating requirements
Shinylive/Pyodide was failing because it tried to install packages that
are already pre-built in Pyodide (like matplotlib and its C-extension
dependencies).

Changes:
- Split requirements into two files:
  - requirements.txt: Minimal deps for Shinylive (only astral, shiny, shinyswatch)
  - requirements-dev.txt: Full deps for local development (includes matplotlib)
- Update README to use requirements-dev.txt for local development
- Update GitHub workflow to use requirements-dev.txt
- Remove matplotlib version pinning as Pyodide provides it

This fixes the "Can't find a pure Python 3 wheel for 'contourpy'" error
when loading the webapp at https://basnijholt.github.io/adaptive-lighting/
2025-07-21 15:33:07 -07:00
5 changed files with 111 additions and 108 deletions

View file

@ -39,7 +39,7 @@ jobs:
- name: Install Dependencies
run: |
pip install -r webapp/requirements.txt
pip install -r webapp/requirements-dev.txt
pip install shinylive
- name: Build the WebAssembly app

View file

@ -2,7 +2,7 @@ To run this app locally, install the requirements and run `shiny run`.
```
$ cd webapp
$ pip install -r requirements.txt
$ pip install -r requirements-dev.txt
$ shiny run
```

103
webapp/requirements-dev.txt Normal file
View file

@ -0,0 +1,103 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.txt.in --output-file requirements-dev.txt
anyio==4.9.0
# via
# starlette
# watchfiles
appdirs==1.4.4
# via shiny
asgiref==3.9.1
# via shiny
astral==2.2
# via -r requirements.txt.in
click==8.2.1
# via
# shiny
# uvicorn
contourpy==1.3.1
# via matplotlib
cycler==0.12.1
# via matplotlib
fonttools==4.58.5
# via matplotlib
h11==0.16.0
# via uvicorn
htmltools==0.6.0
# via
# shiny
# shinyswatch
idna==3.10
# via anyio
kiwisolver==1.4.8
# via matplotlib
linkify-it-py==2.0.3
# via shiny
markdown-it-py==3.0.0
# via
# mdit-py-plugins
# shiny
matplotlib==3.8.4
# via -r requirements.txt.in
mdit-py-plugins==0.4.2
# via shiny
mdurl==0.1.2
# via markdown-it-py
narwhals==1.46.0
# via shiny
numpy==2.3.1
# via
# contourpy
# matplotlib
orjson==3.10.18
# via shiny
packaging==25.0
# via
# htmltools
# matplotlib
# shiny
# shinyswatch
pillow==11.3.0
# via matplotlib
prompt-toolkit==3.0.51
# via
# questionary
# shiny
pyparsing==3.2.3
# via matplotlib
python-dateutil==2.9.0.post0
# via matplotlib
python-multipart==0.0.20
# via shiny
pytz==2023.3.post1
# via astral
questionary==2.1.0
# via shiny
setuptools==80.9.0
# via shiny
shiny==1.4.0
# via
# -r requirements.txt.in
# shinyswatch
shinyswatch==0.9.0
# via -r requirements.txt.in
six==1.17.0
# via python-dateutil
sniffio==1.3.1
# via anyio
starlette==0.47.1
# via shiny
typing-extensions==4.14.1
# via
# htmltools
# shiny
# shinyswatch
uc-micro-py==1.0.3
# via linkify-it-py
uvicorn==0.35.0
# via shiny
watchfiles==1.1.0
# via shiny
wcwidth==0.2.13
# via prompt-toolkit
websockets==15.0.1
# via shiny

View file

@ -1,105 +1,6 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements.txt.in --output-file requirements.txt
anyio==4.9.0
# via
# starlette
# watchfiles
appdirs==1.4.4
# via shiny
asgiref==3.9.1
# via shiny
# Minimal requirements for Shinylive deployment
# Only packages not pre-installed in Pyodide
# matplotlib and dependencies are already in Pyodide
astral==2.2
# via -r requirements.txt.in
click==8.2.1
# via
# shiny
# uvicorn
contourpy==1.3.1
# via
# -r requirements.txt.in
# matplotlib
cycler==0.12.1
# via matplotlib
fonttools==4.58.5
# via matplotlib
h11==0.16.0
# via uvicorn
htmltools==0.6.0
# via
# shiny
# shinyswatch
idna==3.10
# via anyio
kiwisolver==1.4.8
# via matplotlib
linkify-it-py==2.0.3
# via shiny
markdown-it-py==3.0.0
# via
# mdit-py-plugins
# shiny
matplotlib==3.8.4
# via -r requirements.txt.in
mdit-py-plugins==0.4.2
# via shiny
mdurl==0.1.2
# via markdown-it-py
narwhals==1.46.0
# via shiny
numpy==2.3.1
# via
# contourpy
# matplotlib
orjson==3.10.18
# via shiny
packaging==25.0
# via
# htmltools
# matplotlib
# shiny
# shinyswatch
pillow==11.3.0
# via matplotlib
prompt-toolkit==3.0.51
# via
# questionary
# shiny
pyparsing==3.2.3
# via matplotlib
python-dateutil==2.9.0.post0
# via matplotlib
python-multipart==0.0.20
# via shiny
pytz==2023.3.post1
# via astral
questionary==2.1.0
# via shiny
setuptools==80.9.0
# via shiny
shiny==1.4.0
# via
# -r requirements.txt.in
# shinyswatch
shinyswatch==0.9.0
# via -r requirements.txt.in
six==1.17.0
# via python-dateutil
sniffio==1.3.1
# via anyio
starlette==0.47.1
# via shiny
typing-extensions==4.14.1
# via
# htmltools
# shiny
# shinyswatch
uc-micro-py==1.0.3
# via linkify-it-py
uvicorn==0.35.0
# via shiny
watchfiles==1.1.0
# via shiny
wcwidth==0.2.13
# via prompt-toolkit
websockets==15.0.1
# via shiny
shiny
shinyswatch

View file

@ -1,5 +1,4 @@
astral==2.2
matplotlib==3.8.4
contourpy==1.3.1
matplotlib
shinyswatch
shiny