From 4a180019f04994021706feba4138ccba2d6f2e6d Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 13 Sep 2023 11:57:02 -0400 Subject: [PATCH] Swap out `fuzzywuzzy` for the newer `rapidfuzz` lib --- piker/brokers/binance/api.py | 2 +- piker/brokers/deribit/api.py | 2 +- piker/brokers/deribit/feed.py | 2 +- piker/brokers/ib/symbols.py | 2 +- piker/brokers/kraken/api.py | 2 +- piker/brokers/kraken/symbols.py | 2 +- piker/brokers/kucoin.py | 2 +- piker/data/_symcache.py | 2 +- piker/ui/_search.py | 4 ++-- pyproject.toml | 11 ++++------- 10 files changed, 14 insertions(+), 17 deletions(-) diff --git a/piker/brokers/binance/api.py b/piker/brokers/binance/api.py index 25cd31a8..9f5476a0 100644 --- a/piker/brokers/binance/api.py +++ b/piker/brokers/binance/api.py @@ -42,7 +42,7 @@ from pendulum import ( now, ) import asks -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy import numpy as np from piker import config diff --git a/piker/brokers/deribit/api.py b/piker/brokers/deribit/api.py index 93d4c498..f66ed73b 100644 --- a/piker/brokers/deribit/api.py +++ b/piker/brokers/deribit/api.py @@ -34,7 +34,7 @@ from typing import ( import pendulum import trio from trio_typing import TaskStatus -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy import numpy as np from tractor.trionics import ( broadcast_receiver, diff --git a/piker/brokers/deribit/feed.py b/piker/brokers/deribit/feed.py index ca6a3f54..821aab87 100644 --- a/piker/brokers/deribit/feed.py +++ b/piker/brokers/deribit/feed.py @@ -26,7 +26,7 @@ import time import trio from trio_typing import TaskStatus import pendulum -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy import numpy as np import tractor diff --git a/piker/brokers/ib/symbols.py b/piker/brokers/ib/symbols.py index 31cf74a0..e792113e 100644 --- a/piker/brokers/ib/symbols.py +++ b/piker/brokers/ib/symbols.py @@ -29,7 +29,7 @@ from typing import ( TYPE_CHECKING, ) -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy import ib_insync as ibis import tractor import trio diff --git a/piker/brokers/kraken/api.py b/piker/brokers/kraken/api.py index a4dcdec9..8e4cce40 100644 --- a/piker/brokers/kraken/api.py +++ b/piker/brokers/kraken/api.py @@ -29,7 +29,7 @@ import time import pendulum import asks -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy import numpy as np import urllib.parse import hashlib diff --git a/piker/brokers/kraken/symbols.py b/piker/brokers/kraken/symbols.py index 168b0508..64e79f80 100644 --- a/piker/brokers/kraken/symbols.py +++ b/piker/brokers/kraken/symbols.py @@ -21,7 +21,7 @@ Symbology defs and search. from decimal import Decimal import tractor -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy from piker._cacheables import ( async_lifo_cache, diff --git a/piker/brokers/kucoin.py b/piker/brokers/kucoin.py index 26aab4df..cf9bba62 100755 --- a/piker/brokers/kucoin.py +++ b/piker/brokers/kucoin.py @@ -41,7 +41,7 @@ from typing import ( import wsproto from uuid import uuid4 -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy from trio_typing import TaskStatus import asks from bidict import bidict diff --git a/piker/data/_symcache.py b/piker/data/_symcache.py index abb0145d..1ba724a2 100644 --- a/piker/data/_symcache.py +++ b/piker/data/_symcache.py @@ -35,7 +35,7 @@ from typing import ( ) from types import ModuleType -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy import tomli_w # for fast symbol cache writing import tractor import trio diff --git a/piker/ui/_search.py b/piker/ui/_search.py index 216a94b6..ba81eb1a 100644 --- a/piker/ui/_search.py +++ b/piker/ui/_search.py @@ -15,7 +15,7 @@ # along with this program. If not, see . """ -qompleterz: embeddable search and complete using trio, Qt and fuzzywuzzy. +qompleterz: embeddable search and complete using trio, Qt and rapidfuzz. """ @@ -45,7 +45,7 @@ from typing import ( import time # from pprint import pformat -from fuzzywuzzy import process as fuzzy +from rapidfuzz import process as fuzzy import trio from trio_typing import TaskStatus from PyQt5 import QtCore diff --git a/pyproject.toml b/pyproject.toml index ee08613e..efaf8336 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ # piker: trading gear for hackers # Copyright (C) 2018-present (in stewardship of pikers) -# Tyler Goodlet +# Tyler Goodlet and the pike pikes # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -102,9 +102,9 @@ develop = true optional = true [tool.poetry.group.uis.dependencies] # https://python-poetry.org/docs/managing-dependencies/#dependency-groups -# TODO: outstanding pkging issues on nixos -fuzzywuzzy = {extras = ["speedup"], version = "^0.18.0"} -# fuzzywuzzy = "^0.18.0" +# TODO: make sure the levenshtein shit compiles on nix.. +# rapidfuzz = {extras = ["speedup"], version = "^0.18.0"} +rapidfuzz = "^3.2.0" qdarkstyle = ">=3.0.2" pyqt5 = "^5.15.9" pyqtgraph = { git = 'https://github.com/pikers/pyqtgraph.git' } @@ -137,9 +137,6 @@ prompt-toolkit = "^3.0.39" # [tool.poetry.group.daemon.dependencies] [tool.poetry.scripts] -# poetry = "poetry.console.application:main" piker = 'piker.cli:cli' pikerd = 'piker.cli:pikerd' ledger = 'piker.accounting.cli:ledger' - -# ------ - ------