From 84e7b2283a7e1463a6067e3129ff3c3211b5402d Mon Sep 17 00:00:00 2001 From: maxbachmann Date: Wed, 1 Apr 2020 00:39:46 +0200 Subject: [PATCH] adjust ci build --- .github/workflows/pythonbuild.yml | 5 ++--- README.md | 7 ------- cpp/src/fuzz.cpp | 6 +++--- python/src/py_process.cpp | 2 +- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pythonbuild.yml b/.github/workflows/pythonbuild.yml index b60b7b9..4f05433 100644 --- a/.github/workflows/pythonbuild.yml +++ b/.github/workflows/pythonbuild.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install wheel pybind11 + pip install wheel - name: Lint with flake8 run: | @@ -62,8 +62,7 @@ jobs: matrix: os: [ubuntu-18.04, windows-latest, macos-latest] env: - CIBW_SKIP: cp27-* pp* - CIBW_BEFORE_BUILD: "pip install pybind11" + CIBW_SKIP: cp27-* pp27-* MACOSX_DEPLOYMENT_TARGET: "10.15" steps: diff --git a/README.md b/README.md index 146f875..3d2cb04 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,6 @@ We currently have pre-built binaries (wheels) for `RapidFuzz` and its dependenci For any other architecture/os `RapidFuzz` can be installed from the source distribution. To do so, a C++17 capable compiler must be installed before running the `pip install rapidfuzz` command. While Linux and MacOs usually come with a compiler it is required to install [C++-Buildtools](https://visualstudio.microsoft.com/visual-cpp-build-tools) on Windows. -### PyInstaller -When using RapidFuzz with PyInstaller it is required to pass the following option to it: -``` ---hidden-import _rapidfuzz_cpp -``` -The reason for this is that `rapidfuzz` included all the C++ components from a Module called `_rapidfuzz_cpp`. Since this import is hidden from PyInstaller it is required to tell it about it, so it included the Module in the binary. - ## Usage ```console diff --git a/cpp/src/fuzz.cpp b/cpp/src/fuzz.cpp index 44a21ea..f8640ac 100644 --- a/cpp/src/fuzz.cpp +++ b/cpp/src/fuzz.cpp @@ -269,18 +269,18 @@ percent fuzz::WRatio(const std::wstring_view &s1, const std::wstring_view &s2, p float sratio = ratio(s1, s2, score_cutoff); if (len_ratio < 1.5) { - // increase the value by a small step so it might be able to exit early + // increase the score_cutoff by a small step so it might be able to exit early score_cutoff = std::max(score_cutoff, sratio + (float)0.00001)/UNBASE_SCALE; return std::max(sratio, token_ratio(s1, s2, score_cutoff) * UNBASE_SCALE); } float partial_scale = (len_ratio < 8.0) ? 0.9 : 0.6; - // increase the value by a small step so it might be able to exit early + // increase the score_cutoff by a small step so it might be able to exit early score_cutoff = std::max(score_cutoff, sratio + (float)0.00001)/partial_scale; sratio = std::max(sratio, partial_ratio(s1, s2, score_cutoff) * partial_scale); - // increase the value by a small step so it might be able to exit early + // increase the score_cutoff by a small step so it might be able to exit early score_cutoff = std::max(score_cutoff, sratio + (float)0.00001)/UNBASE_SCALE; return std::max(sratio, partial_token_ratio(s1, s2, score_cutoff) * UNBASE_SCALE * partial_scale ); } diff --git a/python/src/py_process.cpp b/python/src/py_process.cpp index 6bc67b7..069c194 100644 --- a/python/src/py_process.cpp +++ b/python/src/py_process.cpp @@ -53,7 +53,7 @@ PyObject* extractOne(PyObject *self, PyObject *args, PyObject *keywds) { } if (score >= score_cutoff) { - // increase the value by a small step so it might be able to exit early + // increase the score_cutoff by a small step so it might be able to exit early score_cutoff = score + (float)0.00001; match_found = true; result_choice = choice;