Skip to content

Commit f59c85a

Browse files
Add support for ReactPy v2.x (#54)
* Refactoring related to ReactPy v2.0.0 --------- Co-authored-by: Archmonger <16909269+Archmonger@users.noreply.github.com>
1 parent 898c8fd commit f59c85a

27 files changed

+211
-232
lines changed
Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: Test
1+
name: Check
22

33
on:
44
push:
55
branches:
66
- main
77
pull_request:
88
branches:
9-
- main
9+
- "*"
1010
schedule:
11-
- cron: "0 0 * * *"
11+
- cron: "0 0 * * 0"
1212

1313
jobs:
1414
python-source:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: ["3.9", "3.10", "3.11", "3.12"]
18+
python-version: ["3.11", "3.12", "3.13", "3.14"]
1919
steps:
2020
- uses: actions/checkout@v4
2121
- uses: oven-sh/setup-bun@v2
@@ -95,3 +95,38 @@ jobs:
9595
run: pip install --upgrade pip hatch uv
9696
- name: Run Python type checker
9797
run: hatch run python:type_check
98+
99+
javascript:
100+
runs-on: ubuntu-latest
101+
steps:
102+
- uses: actions/checkout@v4
103+
- uses: oven-sh/setup-bun@v2
104+
with:
105+
bun-version: latest
106+
- uses: actions/setup-python@v5
107+
with:
108+
python-version: 3.x
109+
- name: Install Python Dependencies
110+
run: pip install --upgrade pip hatch uv
111+
- name: Run Tests
112+
run: hatch run javascript:check
113+
docs:
114+
runs-on: ubuntu-latest
115+
steps:
116+
- uses: actions/checkout@v4
117+
with:
118+
fetch-depth: 0
119+
- uses: oven-sh/setup-bun@v2
120+
with:
121+
bun-version: latest
122+
- uses: actions/setup-python@v5
123+
with:
124+
python-version: 3.x
125+
- name: Install Python Dependencies
126+
run: pip install --upgrade pip hatch uv
127+
- name: Check documentation links
128+
run: hatch run docs:linkcheck
129+
- name: Check docs build
130+
run: hatch run docs:build
131+
- name: Check docs examples
132+
run: hatch fmt docs --check

.github/workflows/publish-develop-docs.yml renamed to .github/workflows/publish-develop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Publish Develop Docs
1+
name: Publish Develop
22
on:
33
push:
44
branches:
55
- main
66
jobs:
7-
publish-develop-docs:
7+
docs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4

.github/workflows/publish-latest-docs.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/publish-python.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish Release
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
docs:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: oven-sh/setup-bun@v2
14+
with:
15+
bun-version: latest
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: 3.x
19+
- name: Install dependencies
20+
run: pip install --upgrade pip hatch uv
21+
- name: Configure Git
22+
run: |
23+
git config user.name github-actions
24+
git config user.email github-actions@github.com
25+
- name: Publish ${{ github.event.release.name }} Docs
26+
run: hatch run docs:deploy_latest ${{ github.ref_name }}
27+
concurrency:
28+
group: publish-docs
29+
30+
python:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: oven-sh/setup-bun@v2
35+
with:
36+
bun-version: latest
37+
- name: Set up Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: "3.x"
41+
- name: Install dependencies
42+
run: pip install --upgrade pip hatch uv
43+
- name: Build Package
44+
run: hatch build --clean
45+
- name: Publish to PyPI
46+
env:
47+
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
48+
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
49+
run: hatch publish --yes

.github/workflows/test-docs.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/test-javascript.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Don't forget to remove deprecated code on each major release!
1919

2020
## [Unreleased]
2121

22-
- Nothing (yet)!
22+
### Changed
23+
24+
- Bump required ReactPy version to `2.x`
2325

2426
## [2.0.0] - 2025-06-14
2527

docs/examples/python/nested_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ def all_messages():
4646

4747
messages = []
4848
for msg in last_messages.values():
49-
_link = link(
49+
msg_link = link(
5050
{"to": f"/messages/with/{'-'.join(msg['with'])}"},
5151
f"Conversation with: {', '.join(msg['with'])}",
5252
)
5353
msg_from = f"{'' if msg['from'] is None else '🔴'} {msg['message']}"
54-
messages.append(html.li({"key": msg["id"]}, html.p(_link), msg_from))
54+
messages.append(html.li({"key": msg["id"]}, html.p(msg_link), msg_from))
5555

5656
return html.div(
5757
html.h1("All Messages 💬"),

docs/examples/python/use_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@component
77
def user():
88
params = use_params()
9-
return html._(html.h1(f"User {params['id']} 👤"), html.p("Nothing (yet)."))
9+
return html(html.h1(f"User {params['id']} 👤"), html.p("Nothing (yet)."))
1010

1111

1212
@component

0 commit comments

Comments
 (0)