Skip to content

Commit 9b2ec54

Browse files
committed
fix find_longest_match
1 parent 243b147 commit 9b2ec54

File tree

14 files changed

+408
-384
lines changed

14 files changed

+408
-384
lines changed

.github/workflows/releasebuild.yml

Lines changed: 47 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,27 @@ on:
1111
jobs:
1212
build_wheels_windows:
1313
name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}}
14-
runs-on: ${{ matrix.os }}
14+
runs-on: windows-latest
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
19-
os: [windows-latest]
18+
arch: [auto32, auto64]
19+
python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "pp37-*", "pp38-*"]
20+
exclude:
21+
# PyPy only supports x86_64 on Windows
22+
- arch: auto32
23+
python_tag: "pp37-*"
24+
- arch: auto32
25+
python_tag: "pp38-*"
26+
27+
# PyPy Windows is currently broken in scikit-build
28+
- arch: auto64
29+
python_tag: "pp37-*"
30+
- arch: auto64
31+
python_tag: "pp38-*"
2032
env:
2133
CIBW_BUILD: ${{matrix.python_tag}}
34+
CIBW_ARCHS: ${{matrix.arch}}
2235
CIBW_TEST_REQUIRES: pytest
2336
CIBW_TEST_COMMAND: pytest {package}/tests
2437
CIBW_BUILD_VERBOSITY: 3
@@ -42,14 +55,25 @@ jobs:
4255

4356
build_wheels_macos:
4457
name: Build wheel on ${{ matrix.os }}/auto/${{matrix.python_tag}}
45-
runs-on: ${{ matrix.os }}
58+
runs-on: macos-latest
4659
strategy:
4760
fail-fast: false
4861
matrix:
62+
arch: [x86_64, arm64, universal2]
4963
python_tag: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
50-
os: [macos-latest]
64+
exclude:
65+
# MacOS Arm only supported since Python 3.8
66+
- arch: arm64
67+
python_tag: "cp36-*"
68+
- arch: arm64
69+
python_tag: "cp37-*"
70+
- arch: universal2
71+
python_tag: "cp36-*"
72+
- arch: universal2
73+
python_tag: "cp37-*"
5174
env:
5275
CIBW_BUILD: ${{matrix.python_tag}}
76+
CIBW_ARCHS: ${{matrix.arch}}
5377
CIBW_TEST_REQUIRES: pytest
5478
CIBW_TEST_COMMAND: pytest {package}/tests
5579
CIBW_BUILD_VERBOSITY: 3
@@ -71,46 +95,20 @@ jobs:
7195
with:
7296
path: ./wheelhouse/*.whl
7397

74-
build_wheels_apple_silicon:
75-
name: Build wheel on macos-latest/universal2+arm64/${{matrix.python_tag}}
76-
runs-on: macos-latest
77-
strategy:
78-
fail-fast: false
79-
matrix:
80-
python_tag: ["cp38-*", "cp39-*", "cp310-*"]
81-
env:
82-
CIBW_BUILD: ${{matrix.python_tag}}
83-
CIBW_ARCHS_MACOS: "universal2 arm64"
84-
CIBW_BUILD_VERBOSITY: 3
85-
86-
steps:
87-
- uses: actions/checkout@v2
88-
with:
89-
submodules: 'true'
90-
91-
- uses: actions/setup-python@v2
92-
93-
- name: Build wheels
94-
uses: pypa/[email protected]
95-
with:
96-
output-dir: wheelhouse
97-
98-
- name: Upload wheels
99-
uses: actions/upload-artifact@v2
100-
with:
101-
path: ./wheelhouse/*.whl
102-
103-
build_wheels_manylinux:
98+
build_wheels_linux:
10499
name: Build wheels on ubuntu-latest/${{matrix.arch}}/${{matrix.python_tag}}
105100
runs-on: ubuntu-latest
106101
strategy:
107102
fail-fast: false
108103
matrix:
109-
arch: [auto]
110-
python_tag: [ "cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"]
104+
# disable s390x and ppc64le wheels while they are not provided by numpy
105+
# arch: [auto, aarch64, ppc64le, s390x]
106+
arch: [auto, aarch64]
107+
python_tag: [ "cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "pp37-*", "pp38-*"]
111108
env:
112109
CIBW_ARCHS_LINUX: ${{matrix.arch}}
113110
CIBW_BUILD: ${{matrix.python_tag}}
111+
CIBW_SKIP: "*musllinux_*"
114112
CIBW_TEST_SKIP: "*-manylinux_{aarch64,ppc64le,s390x}"
115113
CIBW_TEST_REQUIRES: pytest
116114
CIBW_TEST_COMMAND: pytest {package}/tests
@@ -146,6 +144,17 @@ jobs:
146144

147145
- uses: actions/setup-python@v2
148146

147+
- name: Install dependencies
148+
run: |
149+
python -m pip install --upgrade pip
150+
pip install Cython==3.0.0a10
151+
152+
# The cythonized files allow installation from the sdist without cython
153+
- name: Generate cython
154+
run: |
155+
chmod +x ./src/cython/generate.sh
156+
./src/cython/generate.sh
157+
149158
- name: Build sdist
150159
run: |
151160
pip3 install build; python3 -m build --sdist
@@ -159,7 +168,7 @@ jobs:
159168

160169
deploy-wheels:
161170
if: github.event_name == 'release' && github.event.action == 'published'
162-
needs: [build_wheels_windows, build_wheels_macos, build_wheels_apple_silicon, build_wheels_manylinux, build_sdist]
171+
needs: [build_wheels_windows, build_wheels_macos, build_wheels_linux, build_sdist]
163172
name: deploy wheels to pypi
164173
runs-on: ubuntu-18.04
165174

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,5 @@ cython_debug/
150150
# and can be added to the global gitignore or merged into this file. For a more nuclear
151151
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
152152
#.idea/
153+
154+
*.cxx

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
cmake_minimum_required(VERSION 3.12.0)
22

33
cmake_policy(SET CMP0054 NEW)
4+
set(SKBUILD_LINK_LIBRARIES_KEYWORD PRIVATE)
45

56
set(THREADS_PREFER_PTHREAD_FLAG ON)
67
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
78
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version")
89
endif()
910

10-
project(rapidfuzz LANGUAGES C CXX)
11+
project(cydifflib LANGUAGES C CXX)
12+
13+
if (MSVC)
14+
add_compile_options(/W4)
15+
else()
16+
add_compile_options(-Wall -Wextra -pedantic)
17+
endif()
1118

1219
find_package(PythonExtensions REQUIRED)
1320
find_package(Python COMPONENTS Interpreter Development)
1421
find_package(Cython REQUIRED)
1522

16-
set(RAPIDFUZZ_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
17-
1823
add_subdirectory(src/cython)

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ include LICENSE
55
include pyproject.toml
66

77
include src/cython/CMakeLists.txt
8-
include src/cython/_initialize.pyx
8+
recursive-include src/cython *.pyx *.cxx

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ PRs are welcome!
7171
Thank you :heart:
7272

7373
## ⚠️ License
74-
Copyright 2021 - present [maxbachmann](https://github.com/maxbachmann). `CyDifflib` is free and open-source software licensed under the [MIT License](https://github.com/maxbachmann/CyDifflib/blob/main/LICENSE).
74+
Copyright 2021-present [Max Bachmann](https://github.com/maxbachmann). `CyDifflib` is free and open-source software licensed under the [MIT License](https://github.com/maxbachmann/CyDifflib/blob/main/LICENSE).

0 commit comments

Comments
 (0)