Skip to content

Commit 92ffc15

Browse files
authored
Merge pull request #13 from henryiii/FindPython
[FindPython] Work around PyPy bug
2 parents 1ce10ae + da1296b commit 92ffc15

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

.github/workflows/branchbuild.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Test Build
22

33
on:
44
push:
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
pip install build; python -m build --sdist
3333
# test whether tarball contains all files required for compiling
34-
pip install dist/jarowinkler-*.tar.gz
34+
pip install dist/jarowinkler-*.tar.gz -v
3535
3636
- name: Test type stubs
3737
run: |

.github/workflows/releasebuild.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
git apply ./tools/sdist.patch
3939
pip install build; python -m build --sdist
4040
# test whether tarball contains all files required for compiling
41-
pip install dist/jarowinkler-*.tar.gz
41+
pip install dist/jarowinkler-*.tar.gz -vvv
4242
4343
- name: Test type stubs
4444
run: |
@@ -71,14 +71,6 @@ jobs:
7171
python_tag: "pp38-*"
7272
- arch: auto32
7373
python_tag: "pp39-*"
74-
75-
# PyPy Windows is currently broken in scikit-build
76-
- arch: auto64
77-
python_tag: "pp37-*"
78-
- arch: auto64
79-
python_tag: "pp38-*"
80-
- arch: auto64
81-
python_tag: "pp39-*"
8274
env:
8375
CIBW_BUILD: ${{matrix.python_tag}}
8476
CIBW_ARCHS: ${{matrix.arch}}

CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,23 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
66

77
project(jarowinkler LANGUAGES C CXX)
88

9-
find_package(PythonExtensions REQUIRED)
109
if(CMAKE_VERSION VERSION_LESS 3.18)
1110
find_package(Python COMPONENTS Interpreter Development REQUIRED)
1211
else()
12+
set(Python_ARTIFACTS_INTERACTIVE TRUE)
1313
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
1414
endif()
1515

16+
if("${Python_INTERPRETER_ID}" STREQUAL "PyPy")
17+
message(STATUS "PyPy SOABI: ${Python_SOABI}")
18+
execute_process(
19+
COMMAND "${Python_EXECUTABLE}" -c
20+
"import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX').split('.')[1])"
21+
OUTPUT_VARIABLE Python_SOABI
22+
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ECHO STDOUT)
23+
message(STATUS "Corrected SOABI: ${Python_SOABI}")
24+
endif()
25+
1626
include(FetchContent)
1727

1828
set(JW_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[build-system]
22
requires = [
33
"setuptools>=42",
4-
"scikit-build>=0.13.0",
4+
"scikit-build @ git+https://github.com/scikit-build/scikit-build@master",
55
"Cython==3.0.0a11",
66
"rapidfuzz_capi==1.0.5"
77
]

src/jarowinkler/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ function(create_cython_target _name)
1111
endfunction(create_cython_target)
1212

1313
create_cython_target(_initialize_cpp)
14-
add_library(_initialize_cpp MODULE ${_initialize_cpp})
14+
Python_add_library(_initialize_cpp MODULE WITH_SOABI ${_initialize_cpp})
1515
target_compile_features(_initialize_cpp PUBLIC cxx_std_14)
1616
target_include_directories(_initialize_cpp PRIVATE ${RF_CAPI_PATH} ${JW_BASE_DIR}/jarowinkler)
1717
target_link_libraries(_initialize_cpp PRIVATE jaro_winkler::jaro_winkler)
18-
python_extension_module(_initialize_cpp)
1918
install(TARGETS _initialize_cpp LIBRARY DESTINATION src/jarowinkler)

tools/sdist.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ index 1f4d4d6..1f94979 100644
55
@@ -2,7 +2,6 @@
66
requires = [
77
"setuptools>=42",
8-
"scikit-build>=0.13.0",
8+
"scikit-build @ git+https://github.com/scikit-build/scikit-build@master",
99
- "Cython==3.0.0a11",
1010
"rapidfuzz_capi==1.0.5"
1111
]

0 commit comments

Comments
 (0)