Skip to content

Commit 8dc729b

Browse files
authored
refactor: move toml ressource files in a dedicated directory (jxmorris12#191)
1 parent 63ccc20 commit 8dc729b

5 files changed

Lines changed: 7 additions & 3 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ Exit codes:
352352
Downloaded zips are verified with SHA-256 when a checksum is available. Checksums are resolved in this order:
353353
1. `LTP_DOWNLOAD_SHA256_<VERSION>`, where non-alphanumeric characters in the version are replaced with `_` and the name is uppercased.
354354
2. `LTP_DOWNLOAD_SHA256`.
355-
3. The bundled `language_tool_python/integrity.toml` manifest.
355+
3. The bundled `language_tool_python/_ressources/integrity.toml` manifest.
356356

357357
The bundled manifest covers release/archive downloads. Snapshots are not stable, so provide `LTP_DOWNLOAD_SHA256_<VERSION>` or `LTP_DOWNLOAD_SHA256` if you want to verify a snapshot. If no checksum is available, the download proceeds without SHA-256 verification.
358358

β€Žlanguage_tool_python/__main__.pyβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ def _read_project_version(pyproject: Path) -> str:
6666

6767
logger = logging.getLogger(__name__)
6868
with importlib.resources.as_file(
69-
importlib.resources.files("language_tool_python").joinpath("logging.toml"),
69+
importlib.resources.files("language_tool_python")
70+
.joinpath("_ressources")
71+
.joinpath("logging.toml"),
7072
) as config_path:
7173
log_config = _load_pyproject_and_logconfig(config_path)
7274
dictConfig(log_config)
File renamed without changes.
File renamed without changes.

β€Žlanguage_tool_python/download_lt.pyβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def _load_expected_download_sha256(raw_manifest: str) -> dict[str, str]:
120120

121121
with (
122122
importlib.resources.as_file(
123-
importlib.resources.files("language_tool_python").joinpath("integrity.toml"),
123+
importlib.resources.files("language_tool_python")
124+
.joinpath("_ressources")
125+
.joinpath("integrity.toml"),
124126
) as hashes_path,
125127
hashes_path.open("rb") as f,
126128
):

0 commit comments

Comments
Β (0)