Update iso-codes to v4.20.1 and prepare 2026.9.2 - #656
Merged
Merged
Conversation
Packaging - Declare the licence as a single SPDX expression. The metadata claimed both LGPL-2.1 and MIT, which some licence scanners reject. The bundled data comes from Debian's iso-codes, so LGPL-2.1-or-later is the correct one. - Stop shipping the catalogues a second time under the obsolete filenames that upstream installs as symlinks. A wheel materialises those into full copies, which was doubling the package: 15 MB down to 8.1 MB, all 163 languages kept. The old domain names still resolve through translate() and translator(). - Add a [build-system] section and set include-package-data = false, so the configured package-data globs are actually honoured. - Require Python 3.11, and support 3.14 including the free-threaded build. Data - Rewrite update.sh for meson. Upstream dropped autotools in 4.19.0, so the previous ./configure && make could no longer build it. - Refresh to v4.20.1. Six currencies were withdrawn upstream (BGN, HRK, ANG, CUC, SLL, ZWL) and three added (XCG, ZWG, XAD); Bulgaria and Croatia now use the euro. Library - find() requires every keyword to match. It previously returned on the first indexed field and ignored the rest, so find(alpha_2="US", name="Nonsense") returned the United States. - search() ignores word order and ranks its results. ISO stores many names inverted, so search(name="Republic of Korea") returned nothing. - Add search_fuzzy() for queries containing typos. search() is unchanged and never guesses: the approximate pass runs only when an ordinary search finds nothing. - Add translate(), translator() and available_languages(), replacing the raw gettext recipe in the README. - Load the datasets on first use instead of at import, and drop the duplicate storage in ISONamespaceRecord. Import falls from ~145 ms to ~29 ms, and get() is around 180x faster. CLI - Fix --format json and --format csv printing "No results found." when there were no matches, which is neither valid JSON nor valid CSV. - Fix --fields being ignored by --format json. - Add "isocodes locales" to list the bundled translations and remove unwanted ones. It previews by default and needs --yes to delete anything. - Add --fuzzy. - Collapse the six near-identical search handlers and their parsers into one table-driven implementation, and remove branches that could not be reached. The command line interface is unchanged apart from --fuzzy. Tests and CI - 273 tests, up from 136, at 100% coverage enforced by fail_under. - Add a coverage workflow, run the test workflow on pushes to main, and configure codespell so pre-commit can pass on the vendored data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Packaging
Data
Library
CLI
Tests and CI