Skip to content

Commit

Permalink
fix: cleanup tests and fix a raw string test, enable more win32
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Arnold <[email protected]>
  • Loading branch information
sarnold committed Sep 8, 2024
1 parent 8fcfded commit 5696f8a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-13]
include:
- os: "ubuntu-22.04"
arch: "x86_64"
- os: "ubuntu-22.04"
arch: "aarch64"
- os: "macos-13"
arch: "x86_64"
- os: "macos-13"
arch: "arm64"
- os: "windows-latest"
arch: "auto64"
triplet: "x64-windows"
- os: "windows-latest"
arch: "auto32"
triplet: "x86-windows"

steps:
- uses: actions/checkout@v4
Expand All @@ -36,10 +50,8 @@ jobs:
env:
# configure cibuildwheel to build native archs ('auto'), and some
# emulated ones, plus cross-compile on macos
CIBW_ARCHS_LINUX: auto
CIBW_ARCHS_MACOS: auto arm64
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686"
CIBW_ARCHS_WINDOWS: auto64
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
Expand All @@ -51,15 +63,15 @@ jobs:
# macos target should be 10.14 to get c++17
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=13.0
CIBW_BEFORE_ALL_WINDOWS: >
vcpkg install pkgconf re2:x64-windows
vcpkg install pkgconf:${{ matrix.triplet }} re2:${{ matrix.triplet }}
&& vcpkg integrate install
CIBW_ENVIRONMENT_WINDOWS: 'CMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake'
CIBW_TEST_REQUIRES: ""
CIBW_TEST_COMMAND: ""

- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
name: wheels-${{ matrix.os }}-${{ matrix.arch }}
path: ./wheelhouse/*.whl

build_sdist:
Expand Down Expand Up @@ -88,7 +100,7 @@ jobs:
run:
shell: bash
name: Check artifacts are correct
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
Expand Down
5 changes: 3 additions & 2 deletions tests/re_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,8 +550,9 @@

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

Expand Down
17 changes: 11 additions & 6 deletions tests/test_re.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
from __future__ import print_function
try:
from test.test_support import verbose
except ImportError:
from test.support import verbose
import re2 as re
from re import Scanner

import os
import sys
import traceback
from weakref import proxy

import re2 as re
from re import Scanner

try:
from test import support
from test.support import verbose
except ImportError: # import error on Windows
verbose = re.VERBOSE

if sys.version_info[0] > 2:
unicode = str
unichr = chr
Expand Down

0 comments on commit 5696f8a

Please sign in to comment.