Skip to content

Update iso-codes to v4.20.1 and prepare 2026.9.2 - #656

Merged
Atem18 merged 1 commit into
mainfrom
release/2026.9.2
Sep 2, 2026
Merged

Atem18 merged 1 commit into
mainfrom
release/2026.9.2

Conversation

@Atem18

@Atem18 Atem18 commented Sep 2, 2026

Copy link
Copy Markdown
Owner

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.

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.
@Atem18
Atem18 merged commit 7bf97f4 into main Sep 2, 2026
9 checks passed
@Atem18
Atem18 deleted the release/2026.9.2 branch September 2, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant