Skip to content

hf-xet: Add version 1.7.0 #14

hf-xet: Add version 1.7.0

hf-xet: Add version 1.7.0 #14

Workflow file for this run

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
name: Test hf-xet (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/hf-xet.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/test-hf-xet.yml'
- 'docs/packages/hf-xet.yaml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: hf-xet
version: ${{ inputs.version }}
# Mirrors ci.yml's build_and_test-linux job: build the extension and run
# hf_xet's own pytest suite against it. Builds a wheel and installs it
# rather than using upstream's `maturin develop` - see the comment on the
# Build wheel step below. hf-xet-tests.yml (huggingface_hub's xet
# integration tests) and the workspace-wide `cargo test` in ci.yml are
# dropped - the former always installs the released PyPI wheel rather than
# what's built here, and the latter exercises git_xet/xet_client code
# outside the Python package.
test:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
permissions:
contents: read
name: "Test hf-xet ${{ matrix.version }} — Python 3.12 on riscv64"
runs-on: ubuntu-24.04-riscv
env:
HFXET_VERSION: ${{ matrix.version }}
steps:
- name: Checkout hf-xet v${{ env.HFXET_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: huggingface/xet-core
ref: v${{ env.HFXET_VERSION }}
persist-credentials: false
- name: Install Python
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
python-version: '3.12'
activate-environment: true
enable-cache: false
- name: Install libpython for pyo3 linking
run: |
set -eux
py_ver=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
sudo apt-get update
if ! apt-cache show "libpython${py_ver}-dev" >/dev/null 2>&1; then
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
fi
sudo apt-get install -y "libpython${py_ver}-dev"
- uses: dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # master
with:
toolchain: 1.94.1
- name: Build and Test hf_xet
run: cd hf_xet && cargo test --verbose --no-fail-fast
# the upstream maturin-action version used doesn't handle riscv64 wheels
# on manylinux 2_39. v1.51.0 does, so switch our workflow to that
- name: Build wheel
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
command: build
target: riscv64gc-unknown-linux-gnu
args: -i 3.12 --out dist
sccache: 'true'
manylinux: '2_39'
working-directory: hf_xet
before-script-linux: |
if command -v apt-get &> /dev/null; then
apt-get update && apt-get install libatomic-ops-dev -y
elif command -v yum &> /dev/null; then
yum install libatomic_ops-devel perl-IPC-Cmd -y
else
echo "Neither apt-get nor yum is installed. Please install a package manager."
exit 1
fi
git config --global --add safe.directory "*"
- name: Install built wheel
run: uv pip install hf_xet/dist/*.whl
- name: Python integration tests (hf_xet)
run: |
uv pip install pytest
pytest hf_xet/tests/ -v