Skip to content

fix: relax tokenizers bound to support Python 3.14 - #99

Open
jyje wants to merge 4 commits into
langchain-ai:mainfrom
jyje:fix/relax-tokenizers-pin
Open

fix: relax tokenizers bound to support Python 3.14#99
jyje wants to merge 4 commits into
langchain-ai:mainfrom
jyje:fix/relax-tokenizers-pin

Conversation

@jyje

@jyje jyje commented Jul 14, 2026

Copy link
Copy Markdown

Description:

  • tokenizers is pinned to ^0.20.0 (i.e. >=0.20.0,<0.21.0) in pyproject.toml — a narrow window that both blocks Python 3.14 and conflicts with sibling packages that need a newer tokenizers

  • no release in that range ships a Python 3.14 wheel, and building it from source fails — PyO3 bundled inside tokenizers 0.20.x doesn't recognize Python 3.14 yet

  • tokenizers already solved this upstream: starting at 0.21.0, it ships abi3 (stable ABI) wheels — forward-compatible with new CPython versions without a rebuild

  • this PR relaxes the bound to >=0.21.0,<1.0.0, removing the <0.21 ceiling so langchain-upstage can co-resolve with packages such as transformers/vllm that require a newer tokenizers

  • no source changes needed — this package only calls Tokenizer.from_pretrained() and .encode(), both unchanged across that range

Testing:

  • local (Python 3.13, poetry install --with test,test_integration): 293 unit tests passed, 1 skipped (unrelated) — including both tokenizer-specific tests, test_upstage_tokenizer_solar_pro2 and test_upstage_tokenizer_solar_mini

  • local: all 11 tests in tests/integration_tests/test_chat_models.py passed against a real Upstage API key

  • local: ruff check and ruff format --diff both clean on the 2-file diff (pyproject.toml, poetry.lock)

  • CI, before vs. after — a scoped workflow run on my fork (the workflow itself is not part of this PR's diff, run only to capture this comparison):

Python 3.13 Python 3.14
Before (^0.20.0) passed failed at poetry install
After (this PR) passed passed
  • before: 3.14 fails with error: the configured Python interpreter version (3.14) is newer than PyO3's maximum supported version (3.13), then Cargo build finished with "exit status: 101" while building tokenizers-0.20.3

  • after: both versions install a prebuilt abi3 wheel (no compile step) and pass unit + integration tests

Issue:

Dependencies:

  • none — langchain-openai (already a dependency of this package) declares no tokenizers constraint of its own

jyje added 2 commits July 14, 2026 16:58
Scoped, branch-only workflow to verify whether libs/upstage installs and
passes its chat-model integration test on Python 3.13/3.14. Doesn't touch
the shared _test.yml/_integration_test.yml templates used by every
libs/* package.
tokenizers switched to abi3 (stable ABI) wheels starting at 0.21.0,
making them forward-compatible with new CPython versions (including
3.14) without a rebuild. The previous pin (^0.20.0, i.e. <0.21.0) was
stuck on pre-abi3 releases, which have no Python 3.14 wheel and fail to
build from source (PyO3 in tokenizers 0.20.x doesn't recognize 3.14).

Relaxes the pin to >=0.21.0,<1.0.0 and regenerates poetry.lock, which
now resolves tokenizers 0.23.1. Verified no regression: all 293 unit
tests pass (including the tokenizer-specific ones,
test_upstage_tokenizer_solar_pro2/solar_mini), and all 11 integration
tests in test_chat_models.py pass against a real Upstage API key.

Related: langchain-ai#34 (a prior dependency-conflict report caused by this same
pin, from a different angle).
jyje added 2 commits July 14, 2026 20:19
The py314_pin_check.yml workflow was branch-only scaffolding used to
capture before/after CI evidence for the tokenizers pin change (linked
from the PR description). It isn't meant to ship upstream, so remove it
from the PR diff — the recorded fork runs remain as evidence.
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.

tokenizers pin (^0.20.0) blocks Python 3.14 support Fix: Could you solve this dependency conflict?

1 participant