Skip to content

Commit f7e4be8

Browse files
committed
[core] Change to Python 3.14
1 parent 67cf84d commit f7e4be8

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

.github/actions/build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ runs:
66
steps:
77
- uses: actions/setup-python@v5
88
with:
9-
python-version: '3.10.x'
9+
python-version: '3.14.x'
1010
- name: fetch tags
1111
run: git fetch --prune --unshallow --tags
1212
shell: bash

.github/workflows/build_full_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Set up Python
6060
uses: actions/setup-python@v5
6161
with:
62-
python-version: '>= 3.10'
62+
python-version: '>= 3.14'
6363

6464
- name: Install document building dependencies
6565
run: |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ English users please use the [Github Discussions page](https://github.com/PrepPi
5656

5757
## 开发环境设置
5858

59-
目前运行本程序需要至少 Python 3.10 版本。需要开发的话请使用最低版本(3.10.x),以免在其他使用最低版本的环境出错。
59+
目前运行本程序需要至少 Python 3.14 版本。需要开发的话请使用最低版本(3.14.x),以免在其他使用最低版本的环境出错。
6060

6161
如果您想构建一个开发环境,您需要安装以下 Python 依赖项。推荐在一个 `venv` 中操作。
6262
* 构建需要 `build twine`

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include_package_data = True
2020
package_dir =
2121
= src
2222
packages = find_namespace:
23-
python_requires = >=3.10
23+
python_requires = >=3.14
2424

2525
install_requires =
2626
odfpy
@@ -29,12 +29,13 @@ install_requires =
2929
marko
3030
pyyaml
3131
pillow
32+
audioop-lts
3233
pydub
3334
numpy
3435
scipy
3536
matplotlib
3637
opencv-python
37-
editdistance
38+
rapidfuzz
3839
bidict
3940
pypinyin
4041
graphviz

src/preppipe/frontend/commandsemantics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ def check_is_extend_data(annotation : typing.Any) -> list[type]:
691691
# (如果该命令可以接受多种延伸参数类型,我们想把所有可接受的延伸参数类型找到)
692692
if isinstance(annotation, types.UnionType):
693693
# 这是 T1 | T2 | ...
694-
return [ty for ty in annotation.__args__ if issubclass(ty, ExtendDataExprBase)]
694+
return [ty for ty in annotation.__args__ if isinstance(ty, type) and issubclass(ty, ExtendDataExprBase)]
695695
if isinstance(annotation, type):
696696
if issubclass(annotation, ExtendDataExprBase):
697697
return [annotation]

src/preppipe/util/typo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
# SPDX-FileCopyrightText: 2022 PrepPipe's Contributors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
import editdistance
4+
import rapidfuzz.distance
55
import typing
66

77
class TypoSuggestion:
88
_input : str # the input string that is likely wrong
99
_min_dist : typing.Any
1010
_best_candidates : typing.List[str]
11-
11+
1212
def __init__(self, input : str) -> None:
1313
self._input = input
1414
self._min_dist = None
1515
self._best_candidates = []
16-
16+
1717
def _test(self, candidate : str) -> None:
18-
dist = editdistance.eval(candidate, self._input)
18+
dist = rapidfuzz.distance.Levenshtein(candidate, self._input)
1919
if self._min_dist is None or self._min_dist > dist:
2020
self._best_candidates = [candidate]
2121
self._min_dist = dist
2222
elif self._min_dist == dist:
2323
if candidate not in self._best_candidates:
2424
self._best_candidates.append(candidate)
25-
25+
2626
def add_candidate(self, candidate) -> None:
2727
if isinstance(candidate, str):
2828
self._test(candidate)
2929
else:
3030
for item in candidate:
3131
self.add_candidate(item)
32-
32+
3333
def get_result(self) -> typing.List[str]:
3434
return self._best_candidates

0 commit comments

Comments
 (0)