Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Build clang-tools wheels
name: Release Python Wheels

on:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
workflow_dispatch:
inputs:
llvm_version:
Expand All @@ -16,12 +19,18 @@ on:
description: "Emulation builds to skip (e.g. qemu)"
required: false
default: ""
pull_request:
branches: [ main ]
paths:
- 'clang-format/**'
- 'clang-tidy/**'
- '.github/workflows/release.yml'

jobs:
build-clang-format-wheels:
name: "clang-format :: ${{ matrix.os }} :: ${{ matrix.platform }}-${{ matrix.arch }}"
runs-on: ${{ matrix.os }}

if: github.event_name == 'workflow_dispatch' # only build on manual trigger to save time and resources
strategy:
matrix:
# emulated linux: generate 4 matrix combinations with qemu on ubuntu:
Expand Down Expand Up @@ -141,7 +150,7 @@ jobs:
build-clang-tidy-wheels:
name: "clang-tidy :: ${{ matrix.os }} :: ${{ matrix.platform }}-${{ matrix.arch }}"
runs-on: ${{ matrix.os }}

if: github.event_name == 'workflow_dispatch' # only build on manual trigger to save time and resources
strategy:
matrix:
include:
Expand Down Expand Up @@ -425,6 +434,7 @@ jobs:
test-clang-tidy-sdist
]
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
permissions:
contents: write

Expand Down Expand Up @@ -456,7 +466,7 @@ jobs:

- name: Create draft release
uses: softprops/action-gh-release@v2
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'workflow_dispatch' # only create release on manual trigger
with:
draft: true
files: release-assets/*
Expand All @@ -472,11 +482,13 @@ jobs:

## Installation:
```bash
# Install clang-format
pip install clang-format-${{ github.event.inputs.llvm_version }}-<platform>.whl
# Download and install clang-format
curl -LsSf https://cpp-linter.github.io/install-wheel.sh | bash -s -- clang-format --version ${{ github.event.inputs.llvm_version }}
pip install clang-format-*.whl

# Install clang-tidy
pip install clang-tidy-${{ github.event.inputs.llvm_version }}-<platform>.whl
# Download and install clang-tidy
curl -LsSf https://cpp-linter.github.io/install-wheel.sh | bash -s -- clang-tidy --version ${{ github.event.inputs.llvm_version }}
pip install clang-tidy-*.whl
```

## Assets:
Expand Down
47 changes: 38 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# clang-tools Python distribution

[![Build clang-tools wheels](https://github.com/cpp-linter/clang-tools-wheel/actions/workflows/clang-tools-release.yml/badge.svg)](https://github.com/cpp-linter/clang-tools-wheel/actions/workflows/clang-tools-release.yml)
[![Release Python Wheels](https://github.com/cpp-linter/clang-tools-wheel/actions/workflows/release.yml/badge.svg)](https://github.com/cpp-linter/clang-tools-wheel/actions/workflows/release.yml)

This project provides **Python wheels** for clang-tools including `clang-format`, `clang-tidy`, making them easy to install via pip.
This project provides pip-installable Python wheels for `clang-format` and `clang-tidy`.

We aim to publish wheels for each major and minor release of `clang-format` and `clang-tidy`.
## Quick Install

## Use with pipx or uv

You can install clang-format or clang-tidy via [`pipx`](https://pypa.github.io/pipx/) or [`uv`](https://docs.astral.sh/uv/):
You can download and install `clang-format` or `clang-tidy` wheels using the following command:

```bash
pipx install git+https://github.com/cpp-linter/clang-tools-wheel.git#subdirectory=clang-format
pipx install git+https://github.com/cpp-linter/clang-tools-wheel.git#subdirectory=clang-tidy
# Download latest clang-format wheel
curl -LsSf https://cpp-linter.github.io/install-wheel.sh | bash -s -- clang-format

# Download clang-tidy with specific version
curl -LsSf https://cpp-linter.github.io/install-wheel.sh | bash -s -- clang-tidy --version 21.1.2

# List available platforms
curl -LsSf https://cpp-linter.github.io/install-wheel.sh | bash -s -- --list clang-format

# Download to specific directory
curl -LsSf https://cpp-linter.github.io/install-wheel.sh | bash -s -- clang-format --output ./wheels
```

## Use from pre-commit
Expand All @@ -32,11 +39,33 @@ repos:
args: [--checks=.clang-tidy] # Loads checks from .clang-tidy file
```

## Supported Platforms

| Platform | Architecture | Wheel Tag |
|----------|-------------|-----------|
| **macOS** | Intel (x86_64) | `macosx_10_9_x86_64` |
| **macOS** | Apple Silicon (arm64) | `macosx_11_0_arm64` |
| **Linux** | x86_64 (glibc) | `manylinux_2_27_x86_64` |
| **Linux** | x86_64 (musl) | `musllinux_1_2_x86_64` |
| **Linux** | aarch64 (glibc) | `manylinux_2_26_aarch64` |
| **Linux** | aarch64 (musl) | `musllinux_1_2_aarch64` |
| **Linux** | i686 (glibc) | `manylinux_2_26_i686` |
| **Linux** | i686 (musl) | `musllinux_1_2_i686` |
| **Linux** | ppc64le (glibc) | `manylinux_2_26_ppc64le` |
| **Linux** | ppc64le (musl) | `musllinux_1_2_ppc64le` |
| **Linux** | s390x (glibc) | `manylinux_2_26_s390x` |
| **Linux** | s390x (musl) | `musllinux_1_2_s390x` |
| **Linux** | armv7l (glibc) | `manylinux_2_31_armv7l` |
| **Linux** | armv7l (musl) | `musllinux_1_2_armv7l` |
| **Windows** | 64-bit | `win_amd64` |
| **Windows** | 32-bit | `win32` |
| **Windows** | ARM64 | `win_arm64` |

## Acknowledgements

This project builds on the excellent work of:

* [clang-format-wheel](https://github.com/ssciwr/clang-format-wheel)
* [clang-tidy-wheel](https://github.com/ssciwr/clang-tidy-wheel)

We redistribute these wheels through GitHub releases for the [cpp-linter-hooks](https://github.com/cpp-linter/cpp-linter-hooks) project.
We redistribute these wheels through [GitHub releases](https://github.com/cpp-linter/clang-tools-wheel/releases) for the [cpp-linter-hooks](https://github.com/cpp-linter/cpp-linter-hooks) project.
Loading