Skip to content

Commit

Permalink
release v2.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann authored Sep 27, 2022
1 parent 455e08c commit 7481ffe
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### [2.10.2] - 2022-08-27
#### Fixed
- fix support for cmake versions below 3.17

### [2.10.1] - 2022-09-25
#### Changed
- modernize cmake build to fix most conda-forge builds
Expand Down
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ else()
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
endif()

if("${Python_INTERPRETER_ID}" STREQUAL "PyPy")
if(CMAKE_VERSION VERSION_LESS 3.17)
execute_process(
COMMAND "${Python_EXECUTABLE}" -c
"import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX').split('.')[1])"
OUTPUT_VARIABLE Python_SOABI
OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ECHO STDOUT)
message(STATUS "Corrected SOABI: ${Python_SOABI}")
elseif("${Python_INTERPRETER_ID}" STREQUAL "PyPy")
message(STATUS "PyPy SOABI: ${Python_SOABI}")
execute_process(
COMMAND "${Python_EXECUTABLE}" -c
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Max Bachmann'

# The full version, including alpha/beta/rc tags
release = '2.10.1'
release = '2.10.2'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def show_message(*lines):

setup_args = {
"name": "rapidfuzz",
"version": "2.10.1",
"version": "2.10.2",
"install_requires": ["jarowinkler >= 1.2.2, < 2.0.0"],
"extras_require": {'full': ['numpy']},
"url": "https://github.com/maxbachmann/RapidFuzz",
Expand Down
18 changes: 15 additions & 3 deletions src/rapidfuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,35 @@ function(create_cython_target _name)
endif()
endfunction(create_cython_target)

function(rf_add_library name)
if(CMAKE_VERSION VERSION_LESS 3.17)
Python_add_library(${name} MODULE ${ARGV})
get_property(suffix TARGET ${name} PROPERTY SUFFIX)
if (NOT suffix)
set (suffix "${CMAKE_SHARED_MODULE_SUFFIX}")
endif()
set_property (TARGET ${name} PROPERTY SUFFIX ".${Python_SOABI}${suffix}")
else()
Python_add_library(${name} MODULE WITH_SOABI ${ARGV})
endif()
endfunction(rf_add_library)

create_cython_target(utils_cpp)
Python_add_library(utils_cpp MODULE WITH_SOABI ${utils_cpp} ${CMAKE_CURRENT_LIST_DIR}/utils.cpp)
rf_add_library(utils_cpp ${utils_cpp} ${CMAKE_CURRENT_LIST_DIR}/utils.cpp)
target_compile_features(utils_cpp PUBLIC cxx_std_17)
target_include_directories(utils_cpp PRIVATE ${RF_CAPI_PATH} ${RF_BASE_DIR}/rapidfuzz)
target_link_libraries(utils_cpp PRIVATE rapidfuzz::rapidfuzz)
install(TARGETS utils_cpp LIBRARY DESTINATION src/rapidfuzz)

create_cython_target(fuzz_cpp)
Python_add_library(fuzz_cpp MODULE WITH_SOABI ${fuzz_cpp})
rf_add_library(fuzz_cpp ${fuzz_cpp})
target_compile_features(fuzz_cpp PUBLIC cxx_std_17)
target_include_directories(fuzz_cpp PRIVATE ${RF_CAPI_PATH} ${RF_BASE_DIR}/rapidfuzz)
target_link_libraries(fuzz_cpp PRIVATE rapidfuzz::rapidfuzz)
install(TARGETS fuzz_cpp LIBRARY DESTINATION src/rapidfuzz)

create_cython_target(process_cpp_impl)
Python_add_library(process_cpp_impl MODULE WITH_SOABI ${process_cpp_impl})
rf_add_library(process_cpp_impl ${process_cpp_impl})
target_compile_features(process_cpp_impl PUBLIC cxx_std_17)
target_include_directories(process_cpp_impl PRIVATE ${RF_CAPI_PATH} ${RF_BASE_DIR}/rapidfuzz)
target_link_libraries(process_cpp_impl PRIVATE Taskflow::Taskflow rapidfuzz::rapidfuzz)
Expand Down
2 changes: 1 addition & 1 deletion src/rapidfuzz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"""
__author__: str = "Max Bachmann"
__license__: str = "MIT"
__version__: str = "2.10.1"
__version__: str = "2.10.2"

from rapidfuzz import process, distance, fuzz, string_metric, utils
17 changes: 15 additions & 2 deletions src/rapidfuzz/distance/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,28 @@ function(create_cython_target _name)
endif()
endfunction(create_cython_target)

function(rf_add_library name)
if(CMAKE_VERSION VERSION_LESS 3.17)
Python_add_library(${name} MODULE ${ARGV})
get_property(suffix TARGET ${name} PROPERTY SUFFIX)
if (NOT suffix)
set (suffix "${CMAKE_SHARED_MODULE_SUFFIX}")
endif()
set_property (TARGET ${name} PROPERTY SUFFIX ".${Python_SOABI}${suffix}")
else()
Python_add_library(${name} MODULE WITH_SOABI ${ARGV})
endif()
endfunction(rf_add_library)

create_cython_target(_initialize_cpp)
Python_add_library(_initialize_cpp MODULE WITH_SOABI ${_initialize_cpp})
rf_add_library(_initialize_cpp ${_initialize_cpp})
target_compile_features(_initialize_cpp PUBLIC cxx_std_17)
target_include_directories(_initialize_cpp PRIVATE ${RF_CAPI_PATH} ${RF_BASE_DIR}/rapidfuzz ${RF_BASE_DIR}/rapidfuzz/distance)
target_link_libraries(_initialize_cpp PRIVATE rapidfuzz::rapidfuzz)
install(TARGETS _initialize_cpp LIBRARY DESTINATION src/rapidfuzz/distance)

create_cython_target(metrics_cpp)
Python_add_library(metrics_cpp MODULE WITH_SOABI ${metrics_cpp})
rf_add_library(metrics_cpp ${metrics_cpp})
target_compile_features(metrics_cpp PUBLIC cxx_std_17)
target_include_directories(metrics_cpp PRIVATE ${RF_CAPI_PATH} ${RF_BASE_DIR}/rapidfuzz ${RF_BASE_DIR}/rapidfuzz/distance)
target_link_libraries(metrics_cpp PRIVATE rapidfuzz::rapidfuzz)
Expand Down

0 comments on commit 7481ffe

Please sign in to comment.