Skip to content

cchardet: add build-cchardet.yml for riscv64 wheels - #894

Merged
luhenry merged 2 commits into
mainfrom
cchardet
Sep 4, 2026
Merged

cchardet: add build-cchardet.yml for riscv64 wheels#894
luhenry merged 2 commits into
mainfrom
cchardet

Conversation

@luhenry

@luhenry luhenry commented Sep 4, 2026

Copy link
Copy Markdown
Member

Wraps uchardet (bundled C++ source) as a Cython extension for fast charset detection. Upstream publishes no riscv64 wheel, and its PyPI release stops at cp39.

Loosely mirrors upstream's old build-linux.yml.

Differs from upstream

  • Sdist is rebuilt with Cython preinstalled and --no-build-isolation - the tag ships no pyproject.toml, and its bundled .cpp is whatever a bare setuptools/wheel env leaves behind (stale, and incompatible with Python 3.12+'s headers).

Testing

  • Reimplements src/tests/test.py's checks in pytest - the original uses nose, which does not run on modern Python.

License: OK - wheel ships the same MPL 1.1 COPYING as the bundled uchardet sources.

Built on cp312; 7 passed, 0 skipped.

cchardet 2.1.7 ships no pyproject.toml and its sdist bundles a
pre-cythonised _cchardet.cpp that references longintrepr.h, removed from
Python 3.12's public headers, so the sdist must be rebuilt with Cython
preinstalled and --no-build-isolation to embed a fresh, compatible .cpp.
Upstream's own now-active master branch (2.2.0-alpha) confirms this same
recipe (cython --cplus + --no-build-isolation). Testing replaces
upstream's nose-based src/tests/test.py (dead on modern Python) with an
equivalent pytest suite run against the bundled testdata/samples.
package-dir is pkg/, but cibuildwheel resolves CIBW_TEST_SOURCES/CIBW_TEST_COMMAND
paths relative to the invocation cwd, so the staged test file and data need the
pkg/ prefix throughout (confirmed against CI: both failing jobs errored with
"Test source riscv64_test_cchardet.py does not exist").
@luhenry
luhenry merged commit dbfe62c into main Sep 4, 2026
10 checks passed
@luhenry
luhenry deleted the cchardet branch September 4, 2026 06:56
@luhenry luhenry linked an issue Sep 4, 2026 that may be closed by this pull request
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.

cchardet riscv64 support

1 participant