Skip to content

Commit ab91ece

Browse files
committed
- Update language_tool from version 6.4 to version 6.5
- Fixed a bug in the command line (retrieving the version with a deprecated function)
1 parent 13513fc commit ab91ece

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

language_tool_python/__main__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
import locale
55
import re
66
import sys
7+
from importlib.metadata import version
8+
import tomllib
79

810
from .server import LanguageTool
911
from .utils import LanguageToolError
1012

11-
import pkg_resources
12-
__version__ = pkg_resources.require("language_tool_python")[0].version
13+
try:
14+
__version__ = version("language_tool_python")
15+
except PackageNotFoundError:
16+
with open("pyproject.toml", "rb") as f:
17+
__version__ = tomllib.load(f)["project"]["version"]
1318

1419

1520
def parse_args():

language_tool_python/download_lt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
BASE_URL = os.environ.get('LTP_DOWNLOAD_HOST', 'https://www.languagetool.org/download/')
3232
FILENAME = 'LanguageTool-{version}.zip'
3333

34-
LTP_DOWNLOAD_VERSION = '6.4'
34+
LTP_DOWNLOAD_VERSION = '6.5'
3535

3636
JAVA_VERSION_REGEX = re.compile(
3737
r'^(?:java|openjdk) version "(?P<major1>\d+)(|\.(?P<major2>\d+)\.[^"]+)"',

0 commit comments

Comments
 (0)