Skip to content

Commit 53f5488

Browse files
authored
Synchronize CI with other reactive-python repos (#48)
1 parent 28d60a2 commit 53f5488

12 files changed

+109
-83
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
branches:
55
- main
66
jobs:
7-
deploy:
7+
publish-develop-docs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
@@ -17,14 +17,12 @@ jobs:
1717
with:
1818
python-version: 3.x
1919
- name: Install dependencies
20-
run: |
21-
pip install --upgrade hatch uv
20+
run: pip install --upgrade pip hatch uv
2221
- name: Configure Git
2322
run: |
2423
git config user.name github-actions
2524
git config user.email [email protected]
2625
- name: Publish Develop Docs
27-
run: |
28-
hatch run docs:deploy_develop
26+
run: hatch run docs:deploy_develop
2927
concurrency:
3028
group: publish-docs

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ jobs:
1818
python-version: 3.x
1919
- name: Install dependencies
2020
run: |
21-
pip install --upgrade hatch uv
21+
pip install --upgrade pip hatch uv
2222
- name: Configure Git
2323
run: |
2424
git config user.name github-actions
2525
git config user.email [email protected]
26-
- name: Publish Develop Docs
27-
run: |
28-
hatch run docs:deploy_latest ${{ github.ref_name }}
26+
- name: Publish ${{ github.event.release.name }} Docs
27+
run: hatch run docs:deploy_latest ${{ github.ref_name }}
2928
concurrency:
3029
group: publish-docs

.github/workflows/publish-py.yaml

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

.github/workflows/publish-python.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Python
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-python:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: oven-sh/setup-bun@v2
13+
with:
14+
bun-version: latest
15+
- name: Set up Python
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: Build Package
22+
run: hatch build --clean
23+
- name: Publish to PyPI
24+
env:
25+
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
26+
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
27+
run: hatch publish --yes

.github/workflows/test-docs.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ jobs:
2424
with:
2525
python-version: 3.x
2626
- name: Install Python Dependencies
27-
run: |
28-
pip3 --quiet install --upgrade hatch uv ruff
27+
run: pip install --upgrade pip hatch uv
28+
- name: Check documentation links
29+
run: hatch run docs:linkcheck
2930
- name: Check docs build
30-
run: |
31-
hatch run docs:build
32-
hatch run docs:linkcheck
31+
run: hatch run docs:build
3332
- name: Check docs examples
34-
run: |
35-
ruff check docs/examples/python/
33+
run: hatch fmt docs --check
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Style
1+
name: Test
22

33
on:
44
push:
@@ -9,7 +9,7 @@ on:
99
- main
1010

1111
jobs:
12-
test-style:
12+
javascript:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
@@ -18,10 +18,8 @@ jobs:
1818
bun-version: latest
1919
- uses: actions/setup-python@v5
2020
with:
21-
python-version: "3.x"
21+
python-version: 3.x
2222
- name: Install Python Dependencies
23-
run: |
24-
pip3 install hatch uv
23+
run: pip install --upgrade pip hatch uv
2524
- name: Run Tests
26-
run: |
27-
hatch fmt --check
25+
run: hatch run javascript:check

.github/workflows/test-src.yml renamed to .github/workflows/test-python.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- cron: "0 0 * * *"
1212

1313
jobs:
14-
source:
14+
python-source:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
@@ -26,8 +26,7 @@ jobs:
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
- name: Install Python Dependencies
29-
run: |
30-
pip3 install hatch uv
29+
run: pip install --upgrade pip hatch uv
3130
- name: Run Tests
3231
run: |
3332
hatch test --cover --python ${{ matrix.python-version }}
@@ -40,18 +39,18 @@ jobs:
4039
if-no-files-found: error
4140
include-hidden-files: true
4241
retention-days: 7
43-
coverage:
42+
43+
python-coverage:
4444
needs:
45-
- source
45+
- python-source
4646
runs-on: ubuntu-latest
4747
steps:
4848
- uses: actions/checkout@v4
49-
- name: Use Latest Python
50-
uses: actions/setup-python@v5
49+
- uses: actions/setup-python@v5
5150
with:
5251
python-version: "3.x"
5352
- name: Install Python Dependencies
54-
run: python -m pip install --upgrade coverage[toml]
53+
run: pip install --upgrade coverage[toml]
5554
- name: Download data
5655
uses: actions/download-artifact@v4
5756
with:
@@ -66,3 +65,18 @@ jobs:
6665
with:
6766
name: coverage-report
6867
path: htmlcov
68+
69+
python-formatting:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: oven-sh/setup-bun@v2
74+
with:
75+
bun-version: latest
76+
- uses: actions/setup-python@v5
77+
with:
78+
python-version: "3.x"
79+
- name: Install Python Dependencies
80+
run: pip install --upgrade pip hatch uv
81+
- name: Check Python formatting
82+
run: hatch fmt src tests --check

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ Using the following categories, list your changes in this order:
3434

3535
## [Unreleased]
3636

37-
- Nothing (yet)!
37+
### Changed
38+
39+
- Set upper limit on ReactPy version to `<2.0.0`.
3840

3941
## [1.0.3] - 2024-11-21
4042

docs/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@ site_description: It's React-Router, but in Python.
145145
copyright: '&copy;<div id="year"> </div> <script> document.getElementById("year").innerHTML = new Date().getFullYear(); </script>Reactive Python and affiliates.<div class="legal-footer-right">This project has no affiliation to ReactJS or Meta Platforms, Inc.</div>'
146146
repo_url: https://github.com/reactive-python/reactpy-router
147147
site_url: https://reactive-python.github.io/reactpy-router
148-
repo_name: ReactPy Router (GitHub)
148+
repo_name: ReactPy Router
149149
edit_uri: edit/main/docs/src/
150150
docs_dir: src

docs/src/about/contributing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ If you plan to make code changes to this repository, you will need to install th
55
- [Git](https://git-scm.com/downloads)
66
- [Python 3.9+](https://www.python.org/downloads/)
77
- [Hatch](https://hatch.pypa.io/latest/)
8+
- [Bun](https://bun.sh/)
89

910
Once you finish installing these dependencies, you can clone this repository:
1011

@@ -40,6 +41,8 @@ By utilizing `hatch`, the following commands are available to manage the develop
4041
| `hatch fmt --check` | Run all linters and formatters, but do not save fixes to the disk |
4142
| `hatch fmt --linter` | Run only linters |
4243
| `hatch fmt --formatter` | Run only formatters |
44+
| `hatch run javascript:check` | Run the JavaScript linter/formatter |
45+
| `hatch run javascript:fix` | Run the JavaScript linter/formatter and write fixes to disk |
4346

4447
??? tip "Configure your IDE for linting"
4548

@@ -54,6 +57,7 @@ By utilizing `hatch`, the following commands are available to manage the develop
5457
| `hatch run docs:serve` | Start the [`mkdocs`](https://www.mkdocs.org/) server to view documentation locally |
5558
| `hatch run docs:build` | Build the documentation |
5659
| `hatch run docs:linkcheck` | Check for broken links in the documentation |
60+
| `hatch fmt docs --check` | Run linter on code examples in the documentation |
5761

5862
### Environment Management
5963

0 commit comments

Comments
 (0)