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
Copy file name to clipboardExpand all lines: README.md
+3-32Lines changed: 3 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,13 @@
1
-
# Vendoring Packages: FastAPI + Jinja2 Example
1
+
# Python Workers: FastMCP Example
2
2
3
-
*Note: You must have Python Packages enabled on your account for built-in packages to work. Request Access to our Closed Beta using [This Form](https://forms.gle/FcjjhV3YtPyjRPaL8)*
4
-
5
-
This is an example of a Python Worker that uses a built-in package (FastAPI) with a vendored package (Jinja2).
3
+
This is an example of a Python Worker that uses the FastMCP package.
6
4
7
5
## Adding Packages
8
6
9
-
Built-in packages can be selected from [this list](https://developers.cloudflare.com/workers/languages/python/packages/#supported-packages) and added to your `requirements.txt` file. These can be used with no other explicit install step.
10
-
11
7
Vendored packages are added to your source files and need to be installed in a special manner. The Python Workers team plans to make this process automatic in the future, but for now, manual steps need to be taken.
12
8
13
9
### Vendoring Packages
14
10
15
-
[//]: #(NOTE: when updating the instructions below, be sure to also update the vendoring.yml CI workflow)
16
-
17
11
First, install Python3.12 and pip for Python 3.12.
18
12
19
13
*Currently, other versions of Python will not work - use 3.12!*
@@ -30,34 +24,11 @@ Within our virtual environment, install the pyodide CLI:
30
24
.venv/bin/pyodide venv .venv-pyodide
31
25
```
32
26
33
-
Next, add packages to your vendor.txt file. Here we'll add jinja2
34
-
```
35
-
jinja2
36
-
```
37
-
38
-
Lastly, add these packages to your source files at `src/vendor`. For any additional packages, re-run this command.
27
+
Lastly, download the vendored packages. For any additional packages, re-run this command.
0 commit comments