Skip to content

Commit 68bcc97

Browse files
committedMar 5, 2025·
single python env 🐍
use just a single python env so that all image packages, this component's packages and user packages can be imported flawlessly
1 parent def8628 commit 68bcc97

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed
 

‎.github/workflows/push.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ jobs:
128128
run: |
129129
docker load --input /tmp/${{ env.KBC_DEVELOPERPORTAL_APP }}.tar
130130
docker image ls -a
131-
docker run ${{ env.KBC_DEVELOPERPORTAL_APP }}:latest uv run flake8 . --config=flake8.cfg
131+
docker run ${{ env.KBC_DEVELOPERPORTAL_APP }}:latest uv run --active flake8 . --config=flake8.cfg
132132
echo "Running unit-tests..."
133-
docker run ${{ env.KBC_DEVELOPERPORTAL_APP }}:latest uv run python -m unittest discover
133+
docker run ${{ env.KBC_DEVELOPERPORTAL_APP }}:latest uv run --active python -m unittest discover
134134
135135
tests-kbc:
136136
name: Run KBC Tests

‎Dockerfile

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ FROM quay.io/keboola/docker-custom-python:latest
55

66
RUN pip install uv
77

8-
# COPY requirements.txt /code/requirements.txt
9-
# COPY requirements-tests.txt /code/requirements-tests.txt
10-
COPY pyproject.toml /code/pyproject.toml
11-
128
WORKDIR /code/
13-
RUN uv sync
149

15-
COPY /src /code/src/
16-
COPY /tests /code/tests/
17-
COPY /scripts /code/scripts/
18-
COPY flake8.cfg /code/flake8.cfg
19-
COPY deploy.sh /code/deploy.sh
10+
COPY pyproject.toml .
11+
COPY uv.lock .
12+
13+
RUN uv pip sync --system pyproject.toml
14+
15+
COPY src/ src/
16+
COPY tests/ tests/
17+
COPY scripts/ scripts/
18+
COPY flake8.cfg .
19+
COPY deploy.sh .
2020

21-
CMD uv run /code/src/component.py
21+
CMD uv run --active /code/src/component.py

‎scripts/build_n_test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
22
set -e
33

4-
uv run flake8 --config=flake8.cfg
5-
uv run python -m unittest discover
4+
uv run --active flake8 --config=flake8.cfg
5+
uv run --active python -m unittest discover

0 commit comments

Comments
 (0)
Please sign in to comment.