From c4de55e664401c9a338b0eae79ba389d927fdb7b Mon Sep 17 00:00:00 2001 From: Evan Pavlica Date: Mon, 12 Feb 2024 11:09:08 -0800 Subject: [PATCH 1/3] Upgrade marisa-trie for compatibility with Python 3.11+ - deprecates support for Python 3.6 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4be5d44..94869ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,8 +10,8 @@ include = ["language_data/data", "CHANGELOG.md"] exclude = ["language_data/data/cldr", "language_data/data/cldr-json"] [tool.poetry.dependencies] -python = ">= 3.6" -marisa-trie = "^0.7.7" +python = ">= 3.7" +marisa-trie = ">=1.1.0" [tool.poetry.dev-dependencies] From 877fb4f84dddc681507aa7ce1726947e369c2455 Mon Sep 17 00:00:00 2001 From: Evan Pavlica Date: Mon, 12 Feb 2024 12:42:04 -0800 Subject: [PATCH 2/3] Replace deprecated pkg_resources.resource_filename with importlib_resources.files --- language_data/util.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/language_data/util.py b/language_data/util.py index 6f141c2..7b36be5 100644 --- a/language_data/util.py +++ b/language_data/util.py @@ -2,14 +2,11 @@ Used for locating a file in the data directory. """ -from pkg_resources import resource_filename -DATA_ROOT = resource_filename('language_data', 'data') -import os - +from importlib.resources import files def data_filename(filename): """ Given a relative filename, get the full path to that file in the data directory. """ - return os.path.join(DATA_ROOT, filename) + return files('language_data') / 'data' / filename From 23c785fb923b148367d90bc007bf007633a2a73d Mon Sep 17 00:00:00 2001 From: Evan Pavlica Date: Mon, 12 Feb 2024 12:51:03 -0800 Subject: [PATCH 3/3] Update Changelog; Bump version to 2.0 --- CHANGELOG.md | 6 ++++++ pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c5b001..8291248 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Version 2.0 (2024-??-??) + +- Update `marisa-trie` for compatibility with Python 3.11+ + - **This update changes the minimum compatible Python version of this package to Python 3.7** +- Replace usage of `pkg_resources.resource_filename` with `importlib_resources.files` as `pkg_resources` has been deprecated. + # Version 1.1 (2021-??-??) - Updated to CLDR v40. diff --git a/pyproject.toml b/pyproject.toml index 94869ee..b51c9b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "language_data" -version = "1.1" +version = "2.0" description = "Supplementary data about languages used by the langcodes module" authors = ["Elia Robyn Speer "] license = "MIT"