Skip to content

pynini: Add version 2.1.7 - #2435

Merged
luhenry merged 2 commits into
mainfrom
pynini
Sep 28, 2026
Merged

luhenry merged 2 commits into
mainfrom
pynini

Conversation

@luhenry

@luhenry luhenry commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Compiles Cython bindings over OpenFst/OpenGrm for weighted finite-state grammar compilation. Upstream publishes no riscv64 wheel.

Mirrors upstream's own manylinux recipe, third_party/Dockerfile.

Differs from upstream

  • Builds OpenFst in CIBW_BEFORE_ALL_LINUX instead of a separate Docker stage - same ./configure --enable-grm recipe, adapted to cibuildwheel.

Testing

  • Same as upstream's Dockerfile test stage: every tests/*_test.py except chatspeak_model_test.py, which needs an external model file.

License: Wheel bundles OpenFst's shared libraries (Apache-2.0); upstream ships no licence text for it, so the build adds one.

Patches

  • 0001-ship-OpenFst-s-licence-in-the-wheel-s-dist-info.patch - To upstream (no fork to push from). Without it the wheel's dist-info carries no OpenFst license text alongside pynini's own; reproduces off riscv64 too (verified against the real PyPI x86_64 wheel).

Built on cp312; pending CI.

Adds a riscv64 wheel build for pynini, wrapping the OpenFst/OpenGrm
finite-state transducer libraries for grammar compilation. Upstream
publishes no riscv64 wheel and carries no CI of its own; the workflow
mirrors third_party/Dockerfile, the manylinux recipe it documents for
its own PyPI wheels: build OpenFst 1.8.4 with --enable-grm, then build
and auditwheel-repair the pynini wheel against it.
luhenry added a commit that referenced this pull request Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-09-28 23:06 UTC

Upstream's tests/BUILD.bazel declares one py_test target per *_test.py
file; absltest.main() parses sys.argv into absl FLAGS via app.run() before
any test runs, which is how FLAGS.test_tmpdir/test_srcdir end up usable in
setUpClass/self.create_tempfile(). Collecting the suite into one
`python -m pytest tests/` never parses those flags, so every absltest-based
class touching them raised UnparsedFlagAccessError (chatspeak_test,
export_test, grm_test::testFilledExporter, multi_grm_test::testFilledExporter,
stringfile_test::test_roundtrip).

pynini_test.py's StringFileTest failed separately (FstIOError: Read failed):
it holds a workspace-root-relative path (`tests/testdata/str.map`) that only
resolves correctly when cwd is the project root, not one level into tests/
as the previous `cd {project}/tests` did.

Run each tests/*_test.py as its own `python <file>` subprocess from
{project} instead, mirroring Bazel's one-process-per-target model (see
gotcha 439/611); this fixes both failure modes at once and drops the now-
unused `pytest` from CIBW_TEST_REQUIRES.
@luhenry
luhenry marked this pull request as ready for review September 28, 2026 22:52
luhenry added a commit that referenced this pull request Sep 28, 2026
@luhenry
luhenry merged commit 7450faa into main Sep 28, 2026
17 of 18 checks passed
@luhenry
luhenry deleted the pynini branch September 28, 2026 22:59
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