From 66769b00888ed2bd212c8f6aba7b17a2c9ecc84d Mon Sep 17 00:00:00 2001 From: Xianpeng Shen <3353385+shenxianpeng@users.noreply.github.com> Date: Fri, 23 Oct 2026 06:55:32 +0000 Subject: [PATCH] feat!: publish to PyPI as ccache-bin PyPI does not allow the project name ccache, so the package is now ccache-bin. It still installs the ccache command. --- .github/workflows/publish.yml | 4 ++-- .github/workflows/release-drafter.yml | 4 ++-- .github/workflows/test.yml | 8 ++++---- CONTRIBUTING.md | 2 +- README.md | 14 +++++++++----- pyproject.toml | 2 +- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3f59220..26d969e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest environment: name: testpypi - url: https://test.pypi.org/project/ccache/${{ needs.test.outputs.version }}/ + url: https://test.pypi.org/project/ccache-bin/${{ needs.test.outputs.version }}/ permissions: id-token: write # trusted publishing steps: @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest environment: name: pypi - url: https://pypi.org/project/ccache/${{ needs.test.outputs.version }}/ + url: https://pypi.org/project/ccache-bin/${{ needs.test.outputs.version }}/ permissions: contents: write # attach files to the release id-token: write # trusted publishing and build provenance attestations diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index e04f3e1..7d10939 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -34,10 +34,10 @@ jobs: echo "Python wheels of [ccache $upstream](https://ccache.dev/releasenotes.html#_ccache_${upstream//./_}), repackaged unchanged from the [signed upstream binaries](https://github.com/ccache/ccache/releases/tag/v$upstream)." echo "" echo '```bash' - echo "pip install ccache==$version" + echo "pip install ccache-bin==$version" echo '```' echo "" - echo "The wheels are on [PyPI](https://pypi.org/project/ccache/$version/) and attached below, together with the corresponding ccache source code (\`ccache-$upstream.tar.gz\` and its \`.minisig\` signature)." + echo "The wheels are on [PyPI](https://pypi.org/project/ccache-bin/$version/) and attached below, together with the corresponding ccache source code (\`ccache-$upstream.tar.gz\` and its \`.minisig\` signature)." echo "" echo "EOF" } >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4bc206..117d84f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,7 +67,7 @@ jobs: x86_64-unknown-linux-musl aarch64-unknown-linux-musl \ x86_64-apple-darwin aarch64-apple-darwin x86_64-pc-windows-msvc do - echo "ccache==$VERSION" | uv pip compile --quiet --no-header \ + echo "ccache-bin==$VERSION" | uv pip compile --quiet --no-header \ --no-index --find-links dist --python-platform "$target" - done - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 @@ -123,14 +123,14 @@ jobs: run: | python -m venv .venv-pip if [ "$RUNNER_OS" = Windows ]; then bin=.venv-pip/Scripts; else bin=.venv-pip/bin; fi - "$bin/python" -m pip install --no-index --find-links dist ccache + "$bin/python" -m pip install --no-index --find-links dist ccache-bin PATH="$PWD/$bin:$PATH" "$bin/python" tests/smoke_test.py --version "$VERSION" - name: Install with uv and test shell: bash run: | uv venv .venv-uv if [ "$RUNNER_OS" = Windows ]; then bin=.venv-uv/Scripts; else bin=.venv-uv/bin; fi - uv pip install --python .venv-uv --no-index --find-links dist ccache + uv pip install --python .venv-uv --no-index --find-links dist ccache-bin PATH="$PWD/$bin:$PATH" "$bin/python" tests/smoke_test.py --version "$VERSION" test-linux-containers: @@ -203,6 +203,6 @@ jobs: -e SETUP -e PYTHON -e VERSION "$IMAGE" sh -euc ' sh -c "$SETUP" "$PYTHON" -m venv /tmp/venv - /tmp/venv/bin/python -m pip install --no-index --find-links dist ccache + /tmp/venv/bin/python -m pip install --no-index --find-links dist ccache-bin PATH="/tmp/venv/bin:$PATH" /tmp/venv/bin/python tests/smoke_test.py --version "$VERSION" ' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3a36f4c..18f5827 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,7 @@ same wheels. ```bash python -m venv .venv -.venv/bin/python -m pip install --no-index --find-links dist ccache +.venv/bin/python -m pip install --no-index --find-links dist ccache-bin PATH="$PWD/.venv/bin:$PATH" .venv/bin/python tests/smoke_test.py --version "$(cat ccache_version.txt)" ``` diff --git a/README.md b/README.md index a613641..d91a730 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,28 @@ # ccache-wheel -[![PyPI](https://img.shields.io/pypi/v/ccache?labelColor=454a63&color=007ec6)](https://pypi.org/project/ccache/) +[![PyPI](https://img.shields.io/pypi/v/ccache-bin?labelColor=454a63&color=007ec6)](https://pypi.org/project/ccache-bin/) [![ci](https://img.shields.io/github/actions/workflow/status/cpp-linter/ccache-wheel/test.yml?branch=main&label=ci&labelColor=454a63)](https://github.com/cpp-linter/ccache-wheel/actions/workflows/test.yml) [![part of cpp-linter](https://img.shields.io/badge/part%20of-cpp--linter-ffc20a?labelColor=454a63)](https://cpp-linter.github.io/) -[ccache](https://ccache.dev), the C/C++ compiler cache, as Python wheels on PyPI. The wheels -contain the official ccache binaries, unchanged. +[ccache](https://ccache.dev), the C/C++ compiler cache, as Python wheels on PyPI +(`ccache-bin`). The wheels contain the official ccache binaries, unchanged, and install the +`ccache` command. [Website](https://cpp-linter.github.io/) · -[PyPI](https://pypi.org/project/ccache/) · +[PyPI](https://pypi.org/project/ccache-bin/) · [ccache manual](https://ccache.dev/manual/latest.html) · [Discussions](https://github.com/orgs/cpp-linter/discussions) ## Quick start ```bash -pip install ccache # or: uv tool install ccache +pip install ccache-bin # or: uv tool install ccache-bin ccache --version ``` +The package is called `ccache-bin` because the name `ccache` is not available on PyPI. The +command it installs is still `ccache` (with uvx: `uvx --from ccache-bin ccache --version`). + ## Usage With CMake: diff --git a/pyproject.toml b/pyproject.toml index 1864b82..05d1aa3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling>=1.27", "cryptography>=42"] build-backend = "hatchling.build" [project] -name = "ccache" +name = "ccache-bin" description = "ccache, the C/C++ compiler cache, packaged as Python wheels" readme = "README.md" license = "GPL-3.0-or-later"