adjust ci build
This commit is contained in:
parent
18528aed03
commit
84e7b2283a
|
@ -21,7 +21,7 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install wheel pybind11
|
pip install wheel
|
||||||
|
|
||||||
- name: Lint with flake8
|
- name: Lint with flake8
|
||||||
run: |
|
run: |
|
||||||
|
@ -62,8 +62,7 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, windows-latest, macos-latest]
|
os: [ubuntu-18.04, windows-latest, macos-latest]
|
||||||
env:
|
env:
|
||||||
CIBW_SKIP: cp27-* pp*
|
CIBW_SKIP: cp27-* pp27-*
|
||||||
CIBW_BEFORE_BUILD: "pip install pybind11"
|
|
||||||
MACOSX_DEPLOYMENT_TARGET: "10.15"
|
MACOSX_DEPLOYMENT_TARGET: "10.15"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -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.
|
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
|
## Usage
|
||||||
```console
|
```console
|
||||||
|
|
|
@ -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);
|
float sratio = ratio(s1, s2, score_cutoff);
|
||||||
|
|
||||||
if (len_ratio < 1.5) {
|
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;
|
score_cutoff = std::max(score_cutoff, sratio + (float)0.00001)/UNBASE_SCALE;
|
||||||
return std::max(sratio, token_ratio(s1, s2, score_cutoff) * 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;
|
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;
|
score_cutoff = std::max(score_cutoff, sratio + (float)0.00001)/partial_scale;
|
||||||
sratio = std::max(sratio, partial_ratio(s1, s2, score_cutoff) * 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;
|
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 );
|
return std::max(sratio, partial_token_ratio(s1, s2, score_cutoff) * UNBASE_SCALE * partial_scale );
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ PyObject* extractOne(PyObject *self, PyObject *args, PyObject *keywds) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (score >= score_cutoff) {
|
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;
|
score_cutoff = score + (float)0.00001;
|
||||||
match_found = true;
|
match_found = true;
|
||||||
result_choice = choice;
|
result_choice = choice;
|
||||||
|
|
Loading…
Reference in New Issue