Skip to content

Fix setup-uv cache warning by specifying pyproject.toml as cache key#1250

Merged
VisLab merged 2 commits intomainfrom
copilot/fix-cache-dependency-glob
Mar 2, 2026
Merged

Fix setup-uv cache warning by specifying pyproject.toml as cache key#1250
VisLab merged 2 commits intomainfrom
copilot/fix-cache-dependency-glob

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

The astral-sh/setup-uv@v5 action defaults to **/uv.lock,**/requirements*.txt as cache invalidation globs, neither of which exist in this repo, producing a warning on every run that the cache will never be invalidated.

Changes

  • Added cache-dependency-glob: "**/pyproject.toml" to every setup-uv step with enable-cache: true across all five affected workflows:
    • .github/workflows/ci.yaml
    • .github/workflows/black.yaml
    • .github/workflows/ruff.yaml
    • .github/workflows/codespell.yaml
    • .github/workflows/mdformat.yaml
- name: Install uv
  uses: astral-sh/setup-uv@v5
  with:
    python-version: '3.10'
    enable-cache: true
    cache-dependency-glob: "**/pyproject.toml"
Original prompt

Problem

All GitHub Actions workflows that use astral-sh/setup-uv@v5 with enable-cache: true produce the following warning:

No file matched to [**/uv.lock,**/requirements*.txt]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.

This is because the repository does not have a uv.lock or requirements*.txt file. The setup-uv action defaults to looking for those files as cache keys, but this project uses pyproject.toml for dependency metadata.

Affected Files

The following five workflow files all have this issue:

  • .github/workflows/codespell.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/black.yaml
  • .github/workflows/ruff.yaml
  • .github/workflows/mdformat.yaml

Fix

Add cache-dependency-glob: "**/pyproject.toml" to every astral-sh/setup-uv@v5 step that has enable-cache: true. This tells the action to use pyproject.toml as the cache invalidation key instead of the missing uv.lock/requirements*.txt files.

For example, in codespell.yaml:

      - name: Install uv
        uses: astral-sh/setup-uv@v5
        with:
          python-version: '3.10'
          enable-cache: true
          cache-dependency-glob: "**/pyproject.toml"

Apply this same change to all five affected workflow files at every setup-uv step that includes enable-cache: true.

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: VisLab <1189050+VisLab@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cache key warnings in GitHub Actions workflows Fix setup-uv cache warning by specifying pyproject.toml as cache key Mar 2, 2026
@VisLab VisLab marked this pull request as ready for review March 2, 2026 14:44
@VisLab VisLab merged commit 1e3c12d into main Mar 2, 2026
23 checks passed
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.

2 participants