Skip to content

Commit e975b7c

Browse files
committed
fix: cleanup tests and fix a raw string test, enable more win32
* split all runners into separate arch via matrix * macos does need macos-14 to get a proper arm64 build Signed-off-by: Stephen Arnold <[email protected]>
1 parent 8fcfded commit e975b7c

File tree

3 files changed

+37
-17
lines changed

3 files changed

+37
-17
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,23 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [ubuntu-22.04, windows-latest, macos-13]
16+
include:
17+
- os: "ubuntu-22.04"
18+
arch: "x86_64"
19+
- os: "ubuntu-22.04"
20+
arch: "aarch64"
21+
- os: "macos-13"
22+
arch: "x86_64"
23+
macosx_deployment_target: "13.0"
24+
- os: "macos-14"
25+
arch: "arm64"
26+
macosx_deployment_target: "14.0"
27+
- os: "windows-latest"
28+
arch: "auto64"
29+
triplet: "x64-windows"
30+
- os: "windows-latest"
31+
arch: "auto32"
32+
triplet: "x86-windows"
1733

1834
steps:
1935
- uses: actions/checkout@v4
@@ -36,10 +52,8 @@ jobs:
3652
env:
3753
# configure cibuildwheel to build native archs ('auto'), and some
3854
# emulated ones, plus cross-compile on macos
39-
CIBW_ARCHS_LINUX: auto
40-
CIBW_ARCHS_MACOS: auto arm64
55+
CIBW_ARCHS: ${{ matrix.arch }}
4156
CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686"
42-
CIBW_ARCHS_WINDOWS: auto64
4357
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
4458
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
4559
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
@@ -48,18 +62,18 @@ jobs:
4862
yum -y update && yum -y install epel-release && yum install -y re2-devel ninja-build
4963
CIBW_BEFORE_ALL_MACOS: >
5064
brew install re2 pybind11
51-
# macos target should be 10.14 to get c++17
52-
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13.0
65+
# macos target should be at least 10.13 to get full c++17
66+
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=${{ matrix.macosx_deployment_target }}
5367
CIBW_BEFORE_ALL_WINDOWS: >
54-
vcpkg install pkgconf re2:x64-windows
68+
vcpkg install pkgconf:${{ matrix.triplet }} re2:${{ matrix.triplet }}
5569
&& vcpkg integrate install
5670
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
5771
CIBW_TEST_REQUIRES: ""
5872
CIBW_TEST_COMMAND: ""
5973

6074
- uses: actions/upload-artifact@v4
6175
with:
62-
name: wheels-${{ matrix.os }}
76+
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
6377
path: ./wheelhouse/*.whl
6478

6579
build_sdist:
@@ -88,7 +102,7 @@ jobs:
88102
run:
89103
shell: bash
90104
name: Check artifacts are correct
91-
runs-on: ubuntu-20.04
105+
runs-on: ubuntu-22.04
92106
steps:
93107
- uses: actions/checkout@v4
94108
- uses: actions/download-artifact@v4

tests/re_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,9 @@
550550

551551
# lookbehind: split by : but not if it is escaped by -.
552552
('(?<!-):(.*?)(?<!-):', 'a:bc-:de:f', SUCCEED, 'g1', 'bc-:de' ),
553-
# escaping with \ as we know it
554-
(r'(?<!\\\):(.*?)(?<!\\\):', 'a:bc\\:de:f', SUCCEED, 'g1', 'bc\\:de' ),
553+
# escaping with \ as we know it => updated for py311+
554+
# by removing one backslash from each set of 3
555+
(r'(?<!\\):(.*?)(?<!\\):', 'a:bc\\:de:f', SUCCEED, 'g1', 'bc\\:de' ),
555556
# terminating with ' and escaping with ? as in edifact
556557
("(?<!\\?)'(.*?)(?<!\\?)'", "a'bc?'de'f", SUCCEED, 'g1', "bc?'de" ),
557558

tests/test_re.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
from __future__ import print_function
2-
try:
3-
from test.test_support import verbose
4-
except ImportError:
5-
from test.support import verbose
6-
import re2 as re
7-
from re import Scanner
2+
83
import os
94
import sys
105
import traceback
116
from weakref import proxy
7+
8+
import re2 as re
9+
from re import Scanner
10+
11+
try:
12+
from test import support
13+
from test.support import verbose
14+
except ImportError: # import error on Windows
15+
verbose = re.VERBOSE
16+
1217
if sys.version_info[0] > 2:
1318
unicode = str
1419
unichr = chr

0 commit comments

Comments
 (0)