Skip to content

Commit 670071c

Browse files
authored
feat: move python env setup to full UV flow (#185)
1 parent aa36275 commit 670071c

9 files changed

Lines changed: 41 additions & 11 deletions

File tree

.licenses/arduino-app-bricks/pip/langsmith.dep.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---
22
name: langsmith
3-
version: 0.7.38
3+
version: 0.8.0
44
type: pip
55
summary: Client library to connect to the LangSmith Observability and Evaluation Platform.
66
homepage: https://smith.langchain.com/
77
license: mit
8-
licenses: |
8+
licenses:
9+
- sources: LICENSE
10+
text: |
911
MIT License
1012
1113
Copyright (c) 2023 LangChain

Taskfile.dist.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ tasks:
4444
- apt-get install -y --no-install-recommends --no-install-suggests libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
4545
- apt-get install -y --no-install-recommends --no-install-suggests libjpeg62-turbo-dev libpng-dev libtiff-dev libwebp-dev libopenblas-dev liblapacke-dev
4646
- apt-get install -y --no-install-recommends --no-install-suggests libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
47-
- pip install build
48-
- pip install -e ".[dev]"
47+
- pip install --no-cache-dir build
48+
- pip install --no-cache-dir -e ".[dev]"
4949

5050
doc:
5151
desc: Generate documentation

containers/python-apps-base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ COPY ./streamlit/config.toml /home/app/.streamlit/config.toml
1212
COPY ./*.sh /
1313
COPY ./arduino*.whl /app/
1414
RUN bash -c 'WHL_FILES=(/app/*.whl) && uv pip install --system --no-cache-dir "${WHL_FILES[@]}"[all]'; \
15-
rm /app/*.whl; \
15+
rm /app/*.whl; \
1616
# fix permissions for /home/app
1717
chown arduino:arduino -R /home/app; \
1818
chmod 777 -R /home/app; \

containers/python-apps-base/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ if [ "$1" = "provision" ]; then
123123
arduino-bricks-list-modules --provision-compose
124124
else
125125
if grep -q "arduino:streamlit_ui" "$APP_YAML"; then
126+
if ! uv pip show streamlit > /dev/null 2>&1; then
127+
echo "streamlit not found, installing..."
128+
uv pip install --no-cache-dir --link-mode=copy pyarrow==20.0.0 streamlit
129+
fi
126130
exec streamlit run --server.port 7000 "$PYTHON_SCRIPT"
127131
else
128132
echo "======== App is starting ============================"
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
uv
21
pandas==2.3.2
32
pillow
43
pyyaml
54
requests
65
pyalsaaudio==0.11.0
7-
pyarrow==20.0.0
8-
streamlit
96
pyzbar
107
cryptography
118
pyaudio

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ web_ui = [
6464
"cryptography",
6565
]
6666
streamlit_ui = [
67-
"streamlit",
67+
# Deps are a pre-requirement
6868
]
6969
mood_detector = [
7070
"nltk",

src/arduino/app_internal/core/module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ def _update_compose_release_version(
337337
substitution = "-runner:" + release_version
338338
# First replace branch-name style tags (e.g. dev-next, feature-foo); branch names start with a letter
339339
updated_content = re.sub(r"-runner:[a-zA-Z][a-zA-Z0-9._/-]*", substitution, updated_content)
340-
# Then replace semver style tags (e.g. 1.2.3)
341-
updated_content = re.sub(r"-runner:[0-9]+\.[0-9]+\.[0-9]+", substitution, updated_content)
340+
# Then replace semver style tags (e.g. 1.2.3, 1.2.3rc1)
341+
updated_content = re.sub(r"-runner:[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?", substitution, updated_content)
342342

343343
substitution = release_version
344344
updated_content = re.sub(r"\${APPSLAB_VERSION:\-([^}]+)?}", substitution, updated_content)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
models-runner:
3+
image: ${DOCKER_REGISTRY_BASE:-ghcr.io/arduino/}app-bricks/ei-models-runner:0.10.0rc1
4+
ports:
5+
- "${BIND_ADDRESS:-127.0.0.1}:${BIND_PORT:-8100}:8100"

tests/arduino/app_core/test_docker_compose_utils.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,28 @@ def test_release_branch_tag_to_branch_tag_ai():
198198
os.remove(new_path)
199199

200200

201+
def test_release_rc_semver_to_semver_ai():
202+
"""Test that an rc semver tag (e.g. 0.10.0rc1) is fully replaced, leaving no rc suffix behind."""
203+
compose_file_path = "tests/arduino/app_core/brick_compose_ai_rc.yaml"
204+
release_version = "1.0.0"
205+
with open(compose_file_path, "r") as file:
206+
content = file.read()
207+
assert "ei-models-runner:0.10.0rc1" in content
208+
new_path = _update_compose_release_version(
209+
compose_file_path=compose_file_path,
210+
release_version=release_version,
211+
append_suffix=True,
212+
only_ai_containers=True,
213+
)
214+
with open(new_path, "r") as file:
215+
content = file.read()
216+
assert "ei-models-runner:1.0.0" in content
217+
assert "rc1" not in content
218+
import os
219+
220+
os.remove(new_path)
221+
222+
201223
def test_release_no_runner_skipped():
202224
"""Test that a compose file without any -runner image is left untouched when only_ai_containers=True."""
203225
compose_file_path = "tests/arduino/app_core/brick_compose_test_data.yaml"

0 commit comments

Comments
 (0)