Skip to content

Commit fed39ae

Browse files
committed
chore(common): initial commit
0 parents  commit fed39ae

4 files changed

Lines changed: 43 additions & 0 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Cloud Foundry UV Python Buildpack
2+
3+
The current cloud foundry [python-buildpack](https://github.com/cloudfoundry/python-buildpack) doesn't support modern python tools, such as [uv](https://docs.astral.sh/uv/), so I created this custom buildpack to bridge the gap.
4+

bin/compile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
# Compile script for Python buildpack with uv support
3+
4+
set -e
5+
BUILD_DIR=$1
6+
CACHE_DIR=$2
7+
ENV_DIR=$3
8+
9+
cd "$BUILD_DIR"
10+
11+
# Install Python if not present (optional: add logic here)
12+
13+
# Detect and install uv
14+
if grep -q '\[tool.uv\]' pyproject.toml || grep -q '\[project\]' pyproject.toml; then
15+
echo "Detected uv. Installing dependencies with uv."
16+
pip install uv
17+
uv pip install -r requirements.txt || uv pip install
18+
else
19+
echo "No supported dependency manager found."
20+
exit 1
21+
fi
22+

bin/detect

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
# Detect script for Python buildpack with uv support
3+
4+
if [ -f "pyproject.toml" ]; then
5+
echo "python-uv"
6+
exit 0
7+
fi
8+
9+
exit 1

bin/release

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
# Release script for Python buildpack with uv support
3+
4+
cat <<EOF
5+
---
6+
default_process_types:
7+
web: python app.py
8+
EOF

0 commit comments

Comments
 (0)