adjust ci build

This commit is contained in:
maxbachmann 2020-04-01 00:39:46 +02:00
parent 18528aed03
commit 84e7b2283a
No known key found for this signature in database
GPG Key ID: 60334E83C23820B8
4 changed files with 6 additions and 14 deletions

View File

@ -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:

View File

@ -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

View File

@ -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 );
}

View File

@ -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;