Skip to content

Commit 9cb3f0d

Browse files
committed
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 9cb3f0d

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-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

+10-11
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ 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+
12+
RUN uv pip sync --system pyproject.toml
13+
14+
COPY src/ src/
15+
COPY tests/ tests/
16+
COPY scripts/ scripts/
17+
COPY flake8.cfg .
18+
COPY deploy.sh .
2019

21-
CMD uv run /code/src/component.py
20+
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)