Skip to content

docs: Update projects #91

docs: Update projects

docs: Update projects #91

# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on the `build_*_manylinux_wheels` jobs of
# https://github.com/ClickHouse/clickhouse-connect/blob/v1.7.2/.github/workflows/publish.yml
# and the unit-test half of on_push.yml (the integration tests need a
# ClickHouse server, which publishes no riscv64 image).
name: Build clickhouse-connect wheels (riscv64)
on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/clickhouse-connect.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-clickhouse-connect.yml'
- 'docs/packages/clickhouse-connect.yaml'
push:
branches: [main]
paths:
- '.github/workflows/build-clickhouse-connect.yml'
- 'docs/packages/clickhouse-connect.yaml'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
env:
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64
jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: clickhouse-connect
version: ${{ inputs.version }}
build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
name: Build clickhouse-connect ${{ matrix.version }} ${{ matrix.python }}-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
# Per-interpreter (not abi3), matching upstream's own wheel matrix.
# `test_requires` varies because 3.14 has zstd in the stdlib, and the
# registry ships no free-threaded pandas wheel — so on cp314t the two
# modules that import pandas at module scope are skipped, along with the
# one test that reads pandas' version through the as_pandas converter.
include:
- python: "cp312"
test_requires: "backports.zstd pandas<3.0.4"
pytest_ignore: ""
- python: "cp313"
test_requires: "backports.zstd pandas<3.0.4"
pytest_ignore: ""
- python: "cp314"
test_requires: "pandas<3.0.4"
pytest_ignore: ""
- python: "cp314t"
test_requires: ""
pytest_ignore: >-
--ignore tests/unit_tests/test_driver/test_params.py
--ignore tests/unit_tests/test_driver/test_temporal.py
--deselect tests/unit_tests/test_driver/test_rustnumpy.py::test_time_converter_uses_native_timedelta_dtype
env:
CLICKHOUSE_CONNECT_VERSION: ${{ matrix.version }}
steps:
- name: Checkout clickhouse-connect v${{ env.CLICKHOUSE_CONNECT_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: ClickHouse/clickhouse-connect
ref: v${{ env.CLICKHOUSE_CONNECT_VERSION }}
persist-credentials: false
- name: Build wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
only: ${{ matrix.python }}-manylinux_riscv64
env:
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/
# Upstream builds the wheels without testing them and tests an in-place
# build instead; stage only the suite (plus `examples`, which
# test_async_alembic.py reads via `Path(__file__).parents[3]`) so the
# repo-root `clickhouse_connect/` can't shadow the installed extension
# modules.
CIBW_TEST_SOURCES: tests examples
CIBW_TEST_REQUIRES: pytest pytest-asyncio pytest-mock numpy pyarrow sqlalchemy alembic aiohttp ${{ matrix.test_requires }}
# Keeps a dep whose riscv64 wheel we don't have from silently source-building.
CIBW_TEST_ENVIRONMENT: PIP_ONLY_BINARY=numpy,pyarrow,pandas,sqlalchemy,aiohttp,lz4,backports.zstd
# tests/unit_tests/test_driver/test_c_parity.py imports driverc directly, so a
# wheel that fell back to pure Python fails here. TestQuery's fixture opens a
# real connection to a ClickHouse server, which has no riscv64 image.
#
# 1.9.0 added an async SQLAlchemy dialect (cc_sqlalchemy/asyncio.py) gated on
# greenlet, which pypi.riseproject.dev doesn't carry and which SQLAlchemy's own
# `greenlet>=1; platform_machine == ...` marker never installs on riscv64 (that
# list is aarch64/ppc64le/x86_64/amd64/win32 only) — so greenlet is genuinely
# absent here, same as upstream's own optional-dependency gating intends. Per
# CLAUDE.md gotcha 212, running the suite (not grepping) found one file that
# fails to collect and two more tests, in otherwise-passing files, that import
# the dialect lazily inside the test body:
# test_async_dialect.py: ImportError at collection (--ignore, whole file).
# test_async_alembic.py::test_async_alembic_offline_context_compiles_without_client
# and test_async_dialect_version.py::test_async_dialect_sqlalchemy_version_guard:
# both `patch(...)`/`importlib.import_module(...)` the dialect module at call
# time (--deselect, keeping the rest of each file).
CIBW_TEST_COMMAND: >-
python -m pytest tests/unit_tests -k "not TestQuery"
--ignore tests/unit_tests/test_sqlalchemy/test_async_dialect.py
--deselect tests/unit_tests/test_sqlalchemy/test_async_alembic.py::test_async_alembic_offline_context_compiles_without_client
--deselect tests/unit_tests/test_sqlalchemy/test_async_dialect_version.py::test_async_dialect_sqlalchemy_version_guard
${{ matrix.pytest_ignore }}
- name: Check the Cython extensions made it into the wheel
run: |
python3 - wheelhouse/*.whl <<'EOF'
import sys, zipfile
expected = {"buffer", "dataconv", "npconv"}
for whl in sys.argv[1:]:
found = {
n.rsplit("/", 1)[-1].split(".")[0]
for n in zipfile.ZipFile(whl).namelist()
if n.startswith("clickhouse_connect/driverc/") and n.endswith(".so")
}
assert found == expected, (whl, found)
print(whl, "ok")
EOF
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: clickhouse-connect-${{ env.CLICKHOUSE_CONNECT_VERSION }}-${{ matrix.python }}-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error
publish:
name: Publish clickhouse-connect ${{ matrix.version }}
needs: [setup, build_wheels]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
permissions:
contents: write
pull-requests: write
uses: $/.github/workflows/_publish-wheel.yml
secrets:
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
with:
artifact-pattern: clickhouse-connect-${{ matrix.version }}-*-manylinux_riscv64