Skip to content

Fix Pynini wheel selection on Python 3.14 - #531

Open
janbernloehr wants to merge 1 commit into
NVIDIA:mainfrom
janbernloehr:fix/pynini-python314
Open

janbernloehr wants to merge 1 commit into
NVIDIA:mainfrom
janbernloehr:fix/pynini-python314

Conversation

@janbernloehr

Copy link
Copy Markdown

What does this PR do ?

Fixes Linux x86_64 installation on Python 3.14 by selecting pynini==2.1.7, while retaining pynini==2.1.6.post1 on Python versions below 3.14.

Fixes #530.

The unconditional 2.1.6.post1 pin forces Python 3.14 installations to build Pynini from source because that release has no compatible wheel. Without OpenFst development headers, the build fails with fst/util.h: No such file or directory. Pynini 2.1.7 provides a CPython 3.14 Linux x86_64 wheel.

Apply the same mutually exclusive environment markers to requirements/requirements.txt and requirements/requirements_test.txt, so installing the test or all extra does not reintroduce the incompatible pin.

Packaging verification

Manually resolved the Pynini entries extracted from each changed requirements file against public PyPI, targeting x86_64-manylinux_2_28 with source builds disabled:

Target Python Runtime requirements Test requirements
3.9, 3.10, 3.11, 3.12, 3.13 2.1.6.post1 2.1.6.post1
3.14 2.1.7 2.1.7

The unpatched pynini==2.1.6.post1 requirement fails the same Python 3.14 check with “no usable wheels.” The built package's Requires-Dist metadata preserves both markers for the runtime dependencies and the test and all extras.

To reproduce the resolver check from the patched checkout:

for requirements in requirements/requirements.txt requirements/requirements_test.txt; do
  for version in 3.9 3.10 3.11 3.12 3.13 3.14; do
    grep '^pynini' "$requirements" | uv pip compile - \
      --python-version "$version" \
      --python-platform x86_64-manylinux_2_28 \
      --only-binary :all:
  done
done

These checks isolate the dependency being changed; they are not full dependency-install or grammar-suite runs. The Python 3.14 Linux installation and English normalization smoke test reported in #530 used the same patch on r1.2.0; that runtime test was not repeated on this branch. Python versions after 3.14 and other platforms are unverified.

If #474 lands first, the markers need to move into its pyproject.toml runtime dependencies and test extra.

Before your PR is "Ready for review"

Pre checks:

  • Have you signed your commits? Use git commit -s to sign. — Commit includes a Signed-off-by trailer.
  • Do all unittests finish successfully before sending PR? — Not run on this branch; retain draft status.
    1. pytest or (if your machine does not have GPU) pytest --cpu from the root folder (given you marked your test cases accordingly @pytest.mark.run_only_on('CPU')).
    2. Sparrowhawk tests bash tools/text_processing_deployment/export_grammars.sh --MODE=test ...
  • If you are adding a new feature: Have you added test cases for both pytest and Sparrowhawk here. — N/A: dependency compatibility fix; no grammar changes.
  • Have you added __init__.py for every folder and subfolder, including data folder which has .TSV files? — N/A: no new folders.
  • Have you followed codeQL results and removed unused variables and imports (report is at the bottom of the PR in github review box) ? — Pending PR checks.
  • Have you added the correct license header Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. to all newly added Python files? — N/A: no Python files added.
  • If you copied nemo_text_processing/text_normalization/en/graph_utils.py your header's second line should be Copyright 2015 and onwards Google, Inc.. See an example here. — N/A: no copied code.
  • Remove import guards (try import: ... except: ...) if not already done. — N/A: no imports changed.
  • If you added a new language or a new feature please update the NeMo documentation (lives in different repo). — N/A: no new language or feature.
  • Have you added your language support to tools/text_processing_deployment/pynini_export.py. — N/A: no new language.

PR Type:

  • New Feature
  • Bugfix
  • Documentation
  • Test

If you haven't finished some of the above items you can still open "Draft" PR.

Prepared with assistance from OpenAI Codex (GPT-6).

Use pynini 2.1.7 on Python >= 3.14 and preserve 2.1.6.post1 on older
interpreters in both runtime and test requirements.

Fixes NVIDIA#530

Signed-off-by: Jan Bernloehr <jbernloehr@nvidia.com>
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.

Python 3.14: nemo-text-processing cannot be installed on Linux x86_64 because of the exact pynini==2.1.6.post1 pin (no cp314 wheel)

1 participant