Skip to content

Commit 08a1891

Browse files
committed
Attempt to fix Github action.
1 parent 38cb592 commit 08a1891

4 files changed

Lines changed: 24 additions & 15 deletions

File tree

.github/workflows/python-qa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3131
- name: Install system dependencies
3232
run: |
33-
sudo apt-get update && sudo apt-get install -y dmtx-utils zbar-tools imagemagick librsvg2-bin
33+
sudo apt-get update && sudo apt-get install -y dmtx-utils zbar-tools imagemagick librsvg2-bin ghostscript
3434
- name: Install Python dependencies
3535
run: uv sync --frozen --group dev
3636
- name: Lint with ruff

.github/workflows/python-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
2929
- name: Install system dependencies
3030
run: |
31-
sudo apt-get update && sudo apt-get install -y dmtx-utils zbar-tools imagemagick librsvg2-bin
31+
sudo apt-get update && sudo apt-get install -y dmtx-utils zbar-tools imagemagick librsvg2-bin ghostscript
3232
- name: Install Python dependencies
3333
run: uv sync --frozen --group dev
3434
- name: Lint with ruff

pystrich/conftest.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def _read(
4444

4545
@pytest.fixture
4646
def svg_to_png():
47-
path = which("convert")
47+
path = which("rsvg-convert")
4848
if not path:
49-
pytest.skip("ImageMagick `convert` not installed")
49+
pytest.skip("librsvg `rsvg-convert` not installed")
5050

5151
def _convert(
5252
svg_path: "str | os.PathLike[str]",
@@ -55,14 +55,12 @@ def _convert(
5555
subprocess.check_call(
5656
[
5757
path,
58-
"-background",
59-
"white",
60-
"-alpha",
61-
"remove",
62-
"-density",
63-
"150",
64-
os.fspath(svg_path),
58+
"--background-color=white",
59+
"--dpi-x=150",
60+
"--dpi-y=150",
61+
"--output",
6562
os.fspath(png_path),
63+
os.fspath(svg_path),
6664
]
6765
)
6866

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
ARG PYTHON_VERSION=3.13
2-
FROM ghcr.io/astral-sh/uv:python${PYTHON_VERSION}-trixie-slim
2+
# uv binary, pulled from the upstream image so we don't curl-install at build time.
3+
FROM ghcr.io/astral-sh/uv:0.9 AS uv
4+
5+
FROM ubuntu:24.04
6+
7+
COPY --from=uv /uv /uvx /usr/local/bin/
38

49
LABEL org.opencontainers.image.title=pystrich-test
510

11+
ARG PYTHON_VERSION
612
ENV UV_LINK_MODE=copy \
713
UV_COMPILE_BYTECODE=1 \
8-
UV_PROJECT_ENVIRONMENT=/opt/venv
14+
UV_PROJECT_ENVIRONMENT=/opt/venv \
15+
UV_PYTHON=${PYTHON_VERSION} \
16+
DEBIAN_FRONTEND=noninteractive
917

1018
RUN apt-get update \
11-
&& apt-get install -y --no-install-recommends dmtx-utils zbar-tools imagemagick librsvg2-bin ghostscript \
19+
&& apt-get install -y --no-install-recommends \
20+
ca-certificates dmtx-utils zbar-tools imagemagick librsvg2-bin ghostscript \
1221
&& rm -rf /var/lib/apt/lists/*
1322

23+
RUN uv python install ${PYTHON_VERSION}
24+
1425
WORKDIR /src
1526

1627
# Install dependencies first so the layer can be cached across source edits.
@@ -20,4 +31,4 @@ RUN uv sync --frozen --no-install-project --group dev
2031
COPY . .
2132
RUN uv sync --frozen --group dev
2233

23-
CMD ["uv", "run", "--frozen", "pytest"]
34+
CMD ["uv", "run", "--frozen", "pytest"]

0 commit comments

Comments
 (0)