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
+35Lines changed: 35 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,41 @@ The current cloud foundry [python-buildpack](https://github.com/cloudfoundry/pyt
6
6
7
7
## How to use
8
8
9
+
10
+
### Defining the initialization script
11
+
12
+
This buildpack detects uv-managed apps when both `pyproject.toml` and `uv.lock` are present.
13
+
14
+
At staging time, `bin/compile` exports the locked dependencies from `uv.lock`, installs them into `.python_packages`, and writes a `.profile.d/python.sh` file so the app can import those staged packages at runtime. If the app uses a `src/` layout, that `src/` directory is also added to `PYTHONPATH`.
15
+
16
+
At release time, `bin/release` chooses the web command in this order:
17
+
18
+
1. If the app has a `Procfile`, the buildpack does not generate a default process type and Cloud Foundry uses the `Procfile`.
19
+
2. If `pyproject.toml` exists and `[project.scripts]` contains a script named exactly the same as `[project].name`, that script is used.
20
+
3. Otherwise, if `[project.scripts]` contains a `start` script, that script is used.
21
+
4. Otherwise, if `main.py` exists, the buildpack uses `python3 main.py`.
22
+
5. Otherwise, if `app.py` exists, the buildpack uses `python3 app.py`.
23
+
6. If none of the above are present, the buildpack emits an empty `web` process and you must provide your own entrypoint.
24
+
25
+
For `pyproject.toml` scripts, the buildpack converts a console-script target such as:
26
+
27
+
```toml
28
+
[project]
29
+
name = "my-app"
30
+
31
+
[project.scripts]
32
+
my-app = "server.main:run"
33
+
start = "server.main:start"
34
+
```
35
+
36
+
into a process command like:
37
+
38
+
```sh
39
+
python3 -c "from server.main import run; run()"
40
+
```
41
+
42
+
In the example above, `my-app` wins over `start` because it matches `[project].name`.
43
+
9
44
## Testing Locally
10
45
11
46
Run the buildpack test flow from the repository root:
assert_file_contains "$TEST_ROOT/pip.log""--no-deps --target $site_packages_dir -r $export_file""compile should install exported dependencies into the staged site-packages directory"
0 commit comments