-
-
Notifications
You must be signed in to change notification settings - Fork 329
Expand file tree
/
Copy pathpost-create.sh
More file actions
executable file
·58 lines (42 loc) · 1.38 KB
/
post-create.sh
File metadata and controls
executable file
·58 lines (42 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
set -euo pipefail
# Workaround for hatch/virtualenv incompatibility
python3 -m pip install --upgrade "virtualenv==20.25.1"
# Install core ReactPy dependencies
pip install fastjsonschema requests lxml anyio typing-extensions
# Install ASGI dependencies for server functionality
pip install orjson asgiref asgi-tools servestatic uvicorn fastapi
# Optional: Install additional servers
pip install flask sanic tornado
export BUN_INSTALL="${BUN_INSTALL:-$HOME/.bun}"
export PATH="$BUN_INSTALL/bin:$PATH"
if [[ -f /etc/apt/sources.list.d/yarn.list ]]; then
echo "Refreshing Yarn APT keyring..."
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg \
| gpg --dearmor \
| sudo tee /usr/share/keyrings/yarn-archive-keyring.gpg >/dev/null
fi
if ! command -v hatch >/dev/null 2>&1; then
echo "Installing Hatch..."
python3 -m pip install --user hatch
fi
if ! command -v bun >/dev/null 2>&1; then
echo "Installing Bun..."
curl -fsSL https://bun.sh/install | bash
fi
echo "Building JavaScript packages..."
hatch run javascript:build --dev
echo "Building Python package..."
hatch build --clean
echo "Running ReactPy smoke test..."
hatch run python - <<'PY'
from reactpy import component, html
@component
def test_component():
return html.div([
html.h1("Test"),
html.p("ReactPy is working"),
])
vdom = test_component()
print(type(vdom).__name__)
PY