aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-03-05 23:28:09 +0100
committerjaseg <git@jaseg.de>2023-03-05 23:28:09 +0100
commit89fa6fbf83c4be8e2394b456166c228c58428ea6 (patch)
tree369574bc2e483c9cc2f2bc46f88039e4ff4a3401
parent7e7f4b1aa66e73d7568787ff2225a87a5e6c34d5 (diff)
downloadgerbolyze-89fa6fbf83c4be8e2394b456166c228c58428ea6.tar.gz
gerbolyze-89fa6fbf83c4be8e2394b456166c228c58428ea6.tar.bz2
gerbolyze-89fa6fbf83c4be8e2394b456166c228c58428ea6.zip
Fix unit tests
-rwxr-xr-xgerbolyze/__init__.py4
-rw-r--r--podman/arch-testenv4
-rw-r--r--podman/debian-testenv2
-rw-r--r--podman/fedora-testenv2
-rw-r--r--podman/ubuntu-testenv4
-rwxr-xr-xrun-tests.sh2
6 files changed, 9 insertions, 9 deletions
diff --git a/gerbolyze/__init__.py b/gerbolyze/__init__.py
index fcae543..e817471 100755
--- a/gerbolyze/__init__.py
+++ b/gerbolyze/__init__.py
@@ -151,7 +151,7 @@ class ClickSizeParam(click.ParamType):
if isinstance(value, tuple):
return value
- if not (m := re.match('([0-9]+\.?[0-9]*)(mm|cm|in)?[xX*/,×]([0-9]+\.?[0-9]*)(mm|cm|in)?', value)):
+ if not (m := re.match(r'([0-9]+\.?[0-9]*)(mm|cm|in)?[xX*/,×]([0-9]+\.?[0-9]*)(mm|cm|in)?', value)):
self.fail('Size must have format [width]x[height][unit]. The unit can be mm, cm or in. The unit is optional and defaults to mm.', param=param, ctx=ctx)
w, unit1, h, unit2 = m.groups()
@@ -314,7 +314,7 @@ def parse_subtract_script(script, default_dilation=0.1, default_script=DEFAULT_S
continue
line = line.lower()
- line = re.sub('\s', '', line)
+ line = re.sub(r'\s', '', line)
# out.copper -= in.copper+0.1
varname = r'([a-z]+\.[a-z]+)'
diff --git a/podman/arch-testenv b/podman/arch-testenv
index 11b3087..3d75cc9 100644
--- a/podman/arch-testenv
+++ b/podman/arch-testenv
@@ -3,8 +3,8 @@ FROM docker.io/archlinux:latest
MAINTAINER gerbolyze@jaseg.de
RUN pacman --noconfirm -Syu
RUN pacman --noconfirm -Sy pugixml opencv pango cairo git python make clang rustup cargo python-pip base-devel gerbv rsync
-RUN python3 -m pip install pytest-parallel
+RUN python3 -m pip install pytest-parallel setuptools wasmtime
RUN rustup install stable
RUN rustup default stable
-RUN cargo install usvg resvg
+RUN cargo install resvg
RUN python3 -m pip install --upgrade gerbonara
diff --git a/podman/debian-testenv b/podman/debian-testenv
index 544b3f2..f01b887 100644
--- a/podman/debian-testenv
+++ b/podman/debian-testenv
@@ -7,5 +7,5 @@ RUN env DEBIAN_FRONTEND=noninteractive apt install -y libopencv-dev libpugixml-d
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN sh -c '. ~/.cargo/env && rustup install stable'
RUN sh -c '. ~/.cargo/env && rustup default stable'
-RUN sh -c '. ~/.cargo/env && cargo install usvg'
+RUN sh -c '. ~/.cargo/env && cargo install resvg'
diff --git a/podman/fedora-testenv b/podman/fedora-testenv
index c37de87..1ecec06 100644
--- a/podman/fedora-testenv
+++ b/podman/fedora-testenv
@@ -3,5 +3,5 @@ FROM docker.io/fedora:latest
MAINTAINER gerbolyze@jaseg.de
RUN dnf update --refresh -y
RUN dnf install -y python3 make clang opencv-devel pugixml-devel pango-devel cairo-devel rust cargo
-RUN cargo install usvg
+RUN cargo install resvg
diff --git a/podman/ubuntu-testenv b/podman/ubuntu-testenv
index 6f38dbb..2e9dc57 100644
--- a/podman/ubuntu-testenv
+++ b/podman/ubuntu-testenv
@@ -3,6 +3,6 @@ FROM docker.io/ubuntu:latest
MAINTAINER gerbolyze@jaseg.de
RUN env DEBIAN_FRONTEND=noninteractive apt update -y
RUN env DEBIAN_FRONTEND=noninteractive apt install -y libopencv-dev libpugixml-dev libpangocairo-1.0-0 libpango1.0-dev libcairo2-dev clang make python3 git python3-wheel curl python3-pip python3-venv cargo rsync gerbv
-RUN cargo install usvg resvg
-RUN python3 -m pip install numpy slugify lxml click pillow scipy sphinx pytest beautifulsoup4 pytest-parallel
+RUN cargo install resvg
+RUN python3 -m pip install numpy slugify lxml click pillow scipy sphinx pytest beautifulsoup4 pytest-parallel wasmtime
RUN python3 -m pip install --upgrade gerbonara
diff --git a/run-tests.sh b/run-tests.sh
index 4138d7d..e0a6458 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -28,7 +28,7 @@ git clone --depth 1 . podman/testdata/git
git ls-tree --full-tree -r HEAD --name-only | rsync -lptgoD --delete . --files-from - podman/testdata/git/
rsync -a --delete svg-flatten/build/svg-flatten.wasm podman/testdata/git/svg-flatten/build/
-for distro in ubuntu-old ubuntu arch
+for distro in ubuntu arch
do
podman build $NO_CACHE -t gerbonara-$distro-testenv -f podman/$distro-testenv
mkdir -p /tmp/gerbonara-test-out