Skip to content

Commit 870f6f5

Browse files
committed
feat: Add support for Python 3.13
1 parent 22137d1 commit 870f6f5

File tree

7 files changed

+47
-53
lines changed

7 files changed

+47
-53
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
os: [ubuntu-22.04]
26-
python-version: [3.9, '3.10', '3.11', '3.12']
26+
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
2727

2828
steps:
2929
- uses: actions/checkout@v4

.github/workflows/conda-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: ['ubuntu-22.04', 'macos-13']
18-
python-version: ['3.9', '3.10', '3.11', '3.12']
18+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1919
env:
2020
OS: ${{ matrix.os }}
2121
PYTHON: ${{ matrix.python-version }}

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686"
5757
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
5858
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
59-
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
59+
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*
6060
CIBW_SKIP: "*musllinux* *i686"
6161
CIBW_BEFORE_ALL_LINUX: >
6262
yum -y update && yum -y install epel-release && yum install -y re2-devel ninja-build

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
CIBW_TEST_SKIP: "*_arm64 *universal2:arm64 *linux_i686"
5656
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
5757
CIBW_MANYLINUX_I686_IMAGE: manylinux2010
58-
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-*
58+
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-* cp312-* cp313-*
5959
CIBW_SKIP: "*musllinux* *i686"
6060
CIBW_BEFORE_ALL_LINUX: >
6161
yum -y update && yum -y install epel-release && yum install -y re2-devel ninja-build

tests/test_charliterals.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import re2 as re
2+
import warnings
3+
4+
warnings.filterwarnings('ignore', category=DeprecationWarning)
5+
6+
import unittest
7+
8+
class TestCharLiterals(unittest.TestCase):
9+
def test_character_literals(self):
10+
i = 126
11+
12+
assert re.compile(r"\%03o" % i) == re.compile('\\176')
13+
assert re.compile(r"\%03o" % i)._dump_pattern() == '\\176'
14+
assert (re.match(r"\%03o" % i, chr(i)) is None) == False
15+
assert (re.match(r"\%03o0" % i, chr(i) + "0") is None) == False
16+
assert (re.match(r"\%03o8" % i, chr(i) + "8") is None) == False
17+
assert (re.match(r"\x%02x" % i, chr(i)) is None) == False
18+
assert (re.match(r"\x%02x0" % i, chr(i) + "0") is None) == False
19+
assert (re.match(r"\x%02xz" % i, chr(i) + "z") is None) == False
20+
21+
try:
22+
re.match("\911", "")
23+
except Exception as exp:
24+
assert exp.msg == "invalid group reference 91 at position 1"
25+
26+
27+
def test_character_class_literals(self):
28+
i = 126
29+
30+
assert (re.match(r"[\%03o]" % i, chr(i)) is None) == False
31+
assert (re.match(r"[\%03o0]" % i, chr(i) + "0") is None) == False
32+
assert (re.match(r"[\%03o8]" % i, chr(i) + "8") is None) == False
33+
assert (re.match(r"[\x%02x]" % i, chr(i)) is None) == False
34+
assert (re.match(r"[\x%02x0]" % i, chr(i) + "0") is None) == False
35+
assert (re.match(r"[\x%02xz]" % i, chr(i) + "z") is None) == False
36+
37+
try:
38+
re.match("[\911]", "")
39+
except Exception as exp:
40+
assert exp.msg == "invalid escape sequence: \9"

tests/test_charliterals.txt

Lines changed: 0 additions & 47 deletions
This file was deleted.

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py3{7,8,9,10,11,12}
2+
envlist = py3{7,8,9,10,11,12,13}
33
skip_missing_interpreters = true
44
isolated_build = true
55
skipsdist=True
@@ -12,6 +12,7 @@ python =
1212
3.10: py310
1313
3.11: py311
1414
3.12: py312
15+
3.13: py313
1516

1617
[gh-actions:env]
1718
PLATFORM =
@@ -166,7 +167,7 @@ deps =
166167
pip>=20.0.1
167168

168169
commands =
169-
pip install pyre2 --force-reinstall --prefer-binary -f dist/
170+
pip install pyre2 --force-reinstall --prefer-binary --no-index -f dist/
170171
python -m unittest discover -f -s .
171172

172173
[testenv:style]

0 commit comments

Comments
 (0)