Skip to content

Commit 8ec20b7

Browse files
committed
Add CI workflow for pyright
1 parent 1070b80 commit 8ec20b7

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

.github/workflows/test-python.yml

+15
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,18 @@ jobs:
4646
run: pip install --upgrade pip hatch uv
4747
- name: Check Python formatting
4848
run: hatch fmt src tests --check
49+
50+
python-types:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: oven-sh/setup-bun@v2
55+
with:
56+
bun-version: latest
57+
- uses: actions/setup-python@v5
58+
with:
59+
python-version: 3.x
60+
- name: Install Python Dependencies
61+
run: pip install --upgrade pip hatch uv
62+
- name: Check Python formatting
63+
run: hatch run python:type_check

docs/src/about/contributing.md

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ By utilizing `hatch`, the following commands are available to manage the develop
6262
| `hatch fmt --formatter` | Run only formatters |
6363
| `hatch run javascript:check` | Run the JavaScript linter/formatter |
6464
| `hatch run javascript:fix` | Run the JavaScript linter/formatter and write fixes to disk |
65+
| `hatch run python:type_check` | Run the Python type checker |
6566

6667
??? tip "Configure your IDE for linting"
6768

pyproject.toml

+10
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,16 @@ linkcheck = [
185185
deploy_latest = ["cd docs && mike deploy --push --update-aliases {args} latest"]
186186
deploy_develop = ["cd docs && mike deploy --push develop"]
187187

188+
################################
189+
# >>> Hatch Python Scripts <<< #
190+
################################
191+
192+
[tool.hatch.envs.python]
193+
extra-dependencies = ["django-stubs", "channels-redis", "pyright"]
194+
195+
[tool.hatch.envs.python.scripts]
196+
type_check = ["pyright src"]
197+
188198
############################
189199
# >>> Hatch JS Scripts <<< #
190200
############################

0 commit comments

Comments
 (0)