Skip to content

Commit bc3ce6c

Browse files
authored
Merge pull request jxmorris12#127 from mdevolde/version_comparison
fix (download_it): patch version comparison bug
2 parents 5659b0f + e3604a5 commit bc3ce6c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

language_tool_python/download_lt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import requests
1515
import tqdm
16+
from packaging.version import Version
1617

1718
from .exceptions import PathError
1819
from .utils import (
@@ -109,7 +110,7 @@ def confirm_java_compatibility(
109110
is_old_version = language_tool_version != "latest" and (
110111
(
111112
re.match(r"^\d+\.\d+$", language_tool_version)
112-
and language_tool_version < "6.6"
113+
and Version(language_tool_version) < Version("6.6")
113114
)
114115
or (
115116
re.match(r"^\d{8}$", language_tool_version)

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ urls = { Repository = "https://github.com/jxmorris12/language_tool_python.git" }
3030
dependencies = [
3131
"requests",
3232
"tqdm",
33+
"packaging",
3334
"psutil",
3435
"toml"
3536
]
@@ -81,4 +82,4 @@ warn_unreachable = true
8182
no_implicit_optional = true
8283
show_error_codes = true
8384
pretty = true
84-
disable_error_code = ["import-untyped"]
85+
disable_error_code = ["import-not-found", "import-untyped"]

0 commit comments

Comments
 (0)