You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create README for examples to make them simple to run (#9)
* Create a README for examples to make them easy to run
* Fix spelling
* Simplify running instructions, refactor dependencies
* Exclude examples from annotations rules, sort imports
* Apply pyproject-fmt rules
---------
Co-authored-by: Lucian Knock <[email protected]>
All examples (except Django) include Inline Script Metadata (PEP 723), allowing them to be run with [uv](https://docs.astral.sh/uv/) without first installing dependencies.
6
+
7
+
### General Instructions
8
+
9
+
Navigate to the specific example directory and run:
10
+
11
+
```sh
12
+
uv run <script-name>
13
+
```
14
+
15
+
For example:
16
+
-`cd examples/fastapi && uv run app.py`
17
+
-`cd examples/fasthtml && uv run simple.py`
18
+
-`cd examples/sanic && uv run app.py`
19
+
20
+
### Django
21
+
22
+
The Django example has its own `pyproject.toml` with dependencies. Navigate to the Django directory and run:
23
+
24
+
```sh
25
+
uv run manage.py runserver
26
+
```
27
+
28
+
## Alternative: Running with `pip`
29
+
30
+
If you prefer using `pip`, you can create a virtual environment and install the dependencies listed in each script's metadata comments manually:
31
+
32
+
```sh
33
+
python -m venv .venv
34
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
0 commit comments