Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaseg committed Mar 5, 2023
1 parent 7e7f4b1 commit 89fa6fb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions gerbolyze/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def convert(self, value, param, ctx):
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()
Expand Down Expand Up @@ -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]+)'
Expand Down
4 changes: 2 additions & 2 deletions podman/arch-testenv
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM docker.io/archlinux:latest
MAINTAINER [email protected]
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
2 changes: 1 addition & 1 deletion podman/debian-testenv
Original file line number Diff line number Diff line change
Expand Up @@ -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'

2 changes: 1 addition & 1 deletion podman/fedora-testenv
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ FROM docker.io/fedora:latest
MAINTAINER [email protected]
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

4 changes: 2 additions & 2 deletions podman/ubuntu-testenv
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM docker.io/ubuntu:latest
MAINTAINER [email protected]
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
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 89fa6fb

Please sign in to comment.