|
1 | | -# language_tool_python Changelog |
| 1 | +# Changelog |
2 | 2 |
|
3 | | -## 3.4.0 (2026-05-15) |
4 | | -- Corrected a bug in `language_tool_python.server.LanguageTool.check` where the LT `/check` endpoint was queried with GET instead of POST. |
5 | | -- Corrected a bug in `language_tool_python.config_file.LanguageToolConfig` where config keys and values could contain line breaks or end with an odd number of backslashes. |
6 | | -- Corrected the default LT download version (from `latest` snapshot to release `6.8`). |
| 3 | +All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/2.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 6 | + |
| 7 | +## [Unreleased] |
| 8 | + |
| 9 | +### Added |
| 10 | +- Added `premium_key` property to `language_tool_python.server.LanguageTool` to attach a premium API key for LanguageTool API requests. |
| 11 | +- Added `premium_username` property to `language_tool_python.server.LanguageTool` to attach a username for premium LanguageTool API requests. |
| 12 | +- Added `language_tool_python.match.is_check_match` type guard function to verify that a value is a `CheckMatch` (type from `language_tool_python._internals`). |
| 13 | +- Added `language_tool_python.config_file.ConfigValue` public type alias representing all accepted value types for `LanguageToolConfig`. |
| 14 | + |
| 15 | +### Changed |
| 16 | +- **Breaking:** Dropped Python 3.9 support, now supports Python 3.10-3.15. |
| 17 | +- **Breaking:** Moved internal utilities to a private `_internals` subpackage: |
| 18 | + - `language_tool_python.safe_zip` -> `language_tool_python._internals.safe_zip` |
| 19 | + - `language_tool_python.utils.parse_url` -> `language_tool_python._internals.utils.parse_url` |
| 20 | + - `language_tool_python.utils.get_env_int` -> `language_tool_python._internals.utils.get_env_int` |
| 21 | + - `language_tool_python.utils.get_env_float` -> `language_tool_python._internals.utils.get_env_float` |
| 22 | + - `language_tool_python.utils.get_language_tool_download_path` -> `language_tool_python._internals.utils.get_language_tool_download_path` |
| 23 | + - `language_tool_python.utils.get_locale_language` -> `language_tool_python._internals.utils.get_locale_language` |
| 24 | + - `language_tool_python.utils.kill_process_force` -> `language_tool_python._internals.utils.kill_process_force` |
| 25 | +- Removed `packaging` as a runtime dependency. |
| 26 | +- **Breaking:** Narrowed the type of the `config` parameter of `language_tool_python.config_file.LanguageToolConfig.__init__` from `dict[str, Any]` to `Mapping[str, ConfigValue]`. |
| 27 | +- **Breaking:** Changed return type of `language_tool_python.download_lt.LocalLanguageTool.version_into` and `language_tool_python.download_lt.ReleaseLocalLanguageTool.version_into` from `packaging.version.Version` to `tuple[int, int]`. |
| 28 | +- Replaced `toml` dependency with `tomli` for Python < 3.11 (fallback for the stdlib `tomllib`). |
| 29 | +- Added `typing_extensions` as a dependency for Python < 3.13 (fallback for the stdlib `warnings.deprecated`). |
| 30 | + |
| 31 | +### Fixed |
| 32 | +- Corrected a bug in `language_tool_python.config_file.LanguageToolConfig` where directory paths were incorrectly rejected by the path validator. |
| 33 | + |
| 34 | +### Removed |
| 35 | +- **Breaking:** Removed all functions and classes previously deprecated in v3.3.0: |
| 36 | + - `language_tool_python.download_lt.get_common_prefix` |
| 37 | + - `language_tool_python.download_lt.http_get` |
| 38 | + - `language_tool_python.download_lt.unzip_file` |
| 39 | + - `language_tool_python.download_lt.download_zip` |
| 40 | + - `language_tool_python.download_lt.download_lt` |
| 41 | + - `language_tool_python.utils.find_existing_language_tool_downloads` |
| 42 | + - `language_tool_python.utils.get_language_tool_directory` |
| 43 | + - `language_tool_python.utils.get_server_cmd` |
| 44 | + - `language_tool_python.utils.get_jar_info` |
| 45 | + - `language_tool_python.match.auto_type` |
| 46 | + |
| 47 | +## [3.4.0] - 2026-05-15 |
| 48 | + |
| 49 | +> Security hardening for LT downloads: SHA-256 integrity verification, safe ZIP extraction, configurable size limits, and support for LT releases 6.7+. |
| 50 | +
|
| 51 | +### Added |
7 | 52 | - Added SHA-256 verification for downloaded LT zip files. |
8 | 53 | - Added a bundled `language_tool_python/integrity.toml` manifest containing SHA-256 checksums for LT release/archive downloads. |
9 | 54 | - Added new env variables for LT download verification: |
|
12 | 57 | - `LTP_BYPASS_VERIFIED_DOWNLOADS` |
13 | 58 | - Added a maximum download size limit for LT zip files, configurable with `LTP_MAX_DOWNLOAD_BYTES`. |
14 | 59 | - Added `language_tool_python.safe_zip.SafeZipExtractor` and `language_tool_python.safe_zip.SafeZipLimits` to extract ZIP files safely. |
15 | | -- Edited LT ZIP extraction to reject unsafe paths, symlinks, unsupported member types, duplicate paths, file/directory conflicts, oversized archives/members, suspicious compression ratios and overwrites of existing paths. |
16 | 60 | - Added new env variables for safe ZIP extraction limits: |
17 | 61 | - `LTP_SAFE_ZIP_MAX_ARCHIVE_BYTES` |
18 | 62 | - `LTP_SAFE_ZIP_MAX_EXTRACTED_BYTES` |
|
24 | 68 | - Added `LTP_DOWNLOAD_HOST_NEW_RELEASES` to override the new LT release download host. |
25 | 69 | - Added `language_tool_python.utils.get_env_int` and `language_tool_python.utils.get_env_float`. |
26 | 70 |
|
27 | | -## 3.3.1 (2026-05-10) |
| 71 | +### Changed |
| 72 | +- Edited the default LT download version (from `latest` snapshot to release `6.8`). |
| 73 | +- Edited LT ZIP extraction to reject unsafe paths, symlinks, unsupported member types, duplicate paths, file/directory conflicts, oversized archives/members, suspicious compression ratios and overwrites of existing paths. |
| 74 | + |
| 75 | +### Fixed |
| 76 | +- Corrected a bug in `language_tool_python.server.LanguageTool.check` where the LT `/check` endpoint was queried with GET instead of POST. |
| 77 | +- Corrected a bug in `language_tool_python.config_file.LanguageToolConfig` where config keys and values could contain line breaks or end with an odd number of backslashes. |
| 78 | + |
| 79 | +## [3.3.1] - 2026-05-10 |
| 80 | + |
| 81 | +### Changed |
28 | 82 | - Edited the LanguageTool snapshot current version (from 6.8-SNAPSHOT to 6.9-SNAPSHOT) to allow users to retrieve automatically the latest snapshot version of LT. |
29 | 83 |
|
30 | | -## 3.3.0 (2026-03-07) |
31 | | -- Corrected a bug in `language_tool_python.server.LanguageTool._get_valid_spelling_file_path` where the spelling file was always the one for English, even when the LT instance was configured for a different language. |
32 | | -- Corrected a bug in `language_tool_python.server.LanguageTool` where, even if you specified a `language_tool_download_version`, the used LT version was always the latest one present on the system (the download was working correctly, but the downloaded version was not used). |
33 | | -- Corrected the necessary java version for old LT releases (from 1.8 to 1.9). |
| 84 | +## [3.3.0] - 2026-03-07 |
| 85 | + |
| 86 | +### Added |
34 | 87 | - Added an abstract class `LocalLanguageTool` that expose an common interface for subclasses who implements some type of LT download. |
35 | 88 | - Added `ReleaseLocalLanguageTool` class (implementation of `LocalLanguageTool`) that implements the downloading of LT from release/archive page. |
36 | 89 | - Added `SnapshotLocalLanguageTool` class (implementation of `LocalLanguagetool`) that implements the downloading of LT from snapshot page. |
| 90 | + |
| 91 | +### Changed |
37 | 92 | - Edited the low limit of the supported LT version (now at release 4.0). |
| 93 | + |
| 94 | +### Deprecated |
38 | 95 | - Deprecated some funcs (they remain available until version 4.0.0): |
39 | 96 | - `language_tool_python.download_lt.get_common_prefix` |
40 | 97 | - `language_tool_python.download_lt.http_get` |
41 | 98 | - `language_tool_python.download_lt.unzip_file` |
42 | 99 | - `language_tool_python.download_lt.download_zip` |
43 | 100 | - `language_tool_python.download_lt.download_lt` |
44 | 101 | - `language_tool_python.utils.find_existing_language_tool_downloads` |
45 | | - - `language_tool_python.utils._extract_version` |
46 | 102 | - `language_tool_python.utils.get_language_tool_directory` |
47 | 103 | - `language_tool_python.utils.get_server_cmd` |
48 | 104 | - `language_tool_python.utils.get_jar_info` |
49 | 105 |
|
50 | | -## 3.2.2 (2026-01-02) |
| 106 | +### Fixed |
| 107 | +- Corrected a bug in `language_tool_python.server.LanguageTool._get_valid_spelling_file_path` where the spelling file was always the one for English, even when the LT instance was configured for a different language. |
| 108 | +- Corrected a bug in `language_tool_python.server.LanguageTool` where, even if you specified a `language_tool_download_version`, the used LT version was always the latest one present on the system (the download was working correctly, but the downloaded version was not used). |
| 109 | +- Corrected the necessary java version for old LT releases (from 1.8 to 1.9). |
| 110 | + |
| 111 | +## [3.2.2] - 2026-01-02 |
| 112 | + |
| 113 | +### Fixed |
51 | 114 | - Corrected a bug in `language_tool_python.download_lt.http_get` by adding proper handling of HTTP 403 and other non 200 status codes by raising `language_tool_python.exceptions.PathError`. Previously, in case of such status codes, the function would download an HTML error page instead of the expected zip file, leading to an error when attempting to unzip it. |
52 | 115 |
|
53 | | -## 3.2.1 (2025-12-30) |
| 116 | +## [3.2.1] - 2025-12-30 |
| 117 | + |
| 118 | +### Fixed |
54 | 119 | - Corrected a bug in `language_tool_python.server._kill_processes` where processes were not being properly waited for after being killed, potentially leading to zombie processes. |
55 | 120 |
|
56 | | -## 3.2.0 (2025-12-18) |
| 121 | +## [3.2.0] - 2025-12-18 |
| 122 | + |
| 123 | +### Added |
57 | 124 | - Added a `check_matching_regions` method in `language_tool_python.server.LanguageTool`. |
58 | 125 |
|
59 | | -## 3.1.0 (2025-11-23) |
| 126 | +## [3.1.0] - 2025-11-23 |
| 127 | + |
| 128 | +### Added |
60 | 129 | - Added an optional parameter to `LanguageTool` (`proxies`). |
61 | 130 | - Added an `proxies` attribute to `LanguageTool` (This attribute is used by the `LanguageTool._query_server` method). |
62 | 131 | - Added new read-only properties to `LanguageTool`: |
63 | 132 | - `url` |
64 | 133 | - `is_remote` |
65 | 134 | - `host` |
66 | 135 | - `port` |
| 136 | + |
| 137 | +### Changed |
67 | 138 | - Edited the documentation of the `LanguageTool` class to improve clarity. |
68 | 139 |
|
69 | | -## 3.0.0 (2025-11-20) |
| 140 | +## [3.0.0] - 2025-11-20 |
70 | 141 |
|
71 | | -### What's New: |
72 | | -- Corrected a bug when the default locale is POSIX default (C). |
73 | | -- Corrected a bug when closing `LanguageTool` instances (deadlocks). |
74 | | -- Corrected a bug when comparing LT versions (e.g., '5.8' vs '5.10'). |
| 142 | +> Major rewrite: snake_case naming conventions, strict Python types, dedicated `exceptions` module, logging, and online documentation. |
| 143 | +
|
| 144 | +### Added |
75 | 145 | - Added new possible values in LT config (`trustXForwardForHeader`, `suggestionsEnabled` and lang keys). |
76 | 146 | - Added a warning if you forget to explicitly close a `LanguageTool` instance. |
77 | 147 | - Added online documentation for the package. |
78 | 148 | - Added logging (and logs) in the package. |
79 | 149 | - Added raising `exceptions.TimeoutError` in `download_lt.http_get`. |
80 | 150 | - Added `packaging` as a dependency. |
81 | | -- Moved exception classes to a separate `exceptions` module (no more importable from `utils`). |
82 | | -- Edited raised exceptions in some methods/functions: |
| 151 | + |
| 152 | +### Changed |
| 153 | +- **Breaking:** Moved exception classes to a separate `exceptions` module (no more importable from `utils`). |
| 154 | +- **Breaking:** Edited raised exceptions in some methods/functions: |
83 | 155 | - from `AssertionError` to `ValueError` in `config_file.LanguageToolConfig.__init__` |
84 | 156 | - from `AssertionError` to `exceptions.PathError` in `download_lt.download_lt` |
85 | 157 | - from `AssertionError` to `ValueError` in `download_lt.download_lt` |
86 | 158 | - from `AssertionError` to `ValueError` in `server.LanguageTool.__init__` |
87 | 159 | - from `AssertionError` to `ValueError` in `utils.kill_process_force` |
88 | | -- Edited some camelCase attributes/methods to snake_case: |
| 160 | +- **Breaking:** Edited some camelCase attributes/methods to snake_case: |
89 | 161 | - `server.LanguageTool.motherTongue` to `server.LanguageTool.mother_tongue` |
90 | 162 | - `server.LanguageTool.newSpellings` to `server.LanguageTool.new_spellings` |
91 | 163 | - `match.Match.ruleId` to `match.Match.rule_id` |
92 | 164 | - `match.Match.offsetInContext` to `match.Match.offset_in_context` |
93 | 165 | - `match.Match.errorLength` to `match.Match.error_length` |
94 | 166 | - `match.Match.ruleIssueType` to `match.Match.rule_issue_type` |
95 | 167 | - `match.Match.matchedText` to `match.Match.matched_text` |
96 | | -- Edited types of some params: |
| 168 | +- **Breaking:** Edited types of some params: |
97 | 169 | - `directory_to_extract_to` in `dowload_lt.unzip_file` from `str` to `Path` |
98 | 170 | - `directory` in `download_lt.download_zip` from `str` to `Path` |
99 | 171 | - `download_folder` in `utils.find_existing_language_tool_downloads` from `str` to `Path` |
100 | | -- Edited return types of some methods/functions: |
| 172 | +- **Breaking:** Edited return types of some methods/functions: |
101 | 173 | - from `str` to `Path` in `utils.get_language_tool_download_path` |
102 | 174 | - from `list[str]` to `list[Path]` in `utils.find_existing_language_tool_downloads` |
103 | 175 | - from `str` to `Path` in `utils.get_language_tool_directory` |
104 | 176 | - from `tuple[str, str]` to `tuple[Path, Path]` in `utils.get_jar_info` |
| 177 | + |
| 178 | +### Fixed |
| 179 | +- Corrected a bug when the default locale is POSIX default (C). |
| 180 | +- Corrected a bug when closing `LanguageTool` instances (deadlocks). |
| 181 | +- Corrected a bug when comparing LT versions (e.g., '5.8' vs '5.10'). |
| 182 | + |
| 183 | +[Unreleased]: https://github.com/jxmorris12/language_tool_python/compare/3.4.0...HEAD |
| 184 | +[3.4.0]: https://github.com/jxmorris12/language_tool_python/compare/3.3.1...3.4.0 |
| 185 | +[3.3.1]: https://github.com/jxmorris12/language_tool_python/compare/3.3.0...3.3.1 |
| 186 | +[3.3.0]: https://github.com/jxmorris12/language_tool_python/compare/3.2.2...3.3.0 |
| 187 | +[3.2.2]: https://github.com/jxmorris12/language_tool_python/compare/3.2.1...3.2.2 |
| 188 | +[3.2.1]: https://github.com/jxmorris12/language_tool_python/compare/3.2.0...3.2.1 |
| 189 | +[3.2.0]: https://github.com/jxmorris12/language_tool_python/compare/3.1.0...3.2.0 |
| 190 | +[3.1.0]: https://github.com/jxmorris12/language_tool_python/compare/3.0.0...3.1.0 |
| 191 | +[3.0.0]: https://github.com/jxmorris12/language_tool_python/compare/2.9.5...3.0.0 |
0 commit comments