:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(ci): reuse the mypy cache when its key changes (#113893)
Raúl Negrón-Otero51a187117439
diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.ymlindex 6e8a4906cce6..e57c748da689 100644--- a/.github/workflows/ci-python.yml+++ b/.github/workflows/ci-python.yml@@ -297,7 +297,9 @@ jobs:run: |python_version=$(python -c 'import platform; print(platform.python_version())')mypy_version=$(python -c 'from importlib.metadata import version; print(version("mypy"))')- echo "prefix=mypy-v3-${{ runner.os }}-${{ runner.arch }}-${python_version}-${mypy_version}-${{ hashFiles('uv.lock', '**/pyproject.toml', '**/mypy.ini') }}" >> "$GITHUB_OUTPUT"+ toolchain_prefix="mypy-v3-${{ runner.os }}-${{ runner.arch }}-${python_version}-${mypy_version}"+ echo "toolchain_prefix=${toolchain_prefix}" >> "$GITHUB_OUTPUT"+ echo "prefix=${toolchain_prefix}-${{ hashFiles('uv.lock', '**/pyproject.toml', '**/mypy.ini') }}" >> "$GITHUB_OUTPUT"- name: Restore mypy cacheid: mypy-cache@@ -305,7 +307,11 @@ jobs:with:path: .mypy_cachekey: ${{ steps.mypy-cache-key.outputs.prefix }}-${{ github.run_id }}-${{ github.run_attempt }}- restore-keys: ${{ steps.mypy-cache-key.outputs.prefix }}-+ # A pull request may start from a cache of another dependency set, because mypy+ # validates each entry. The master run may not, so each saved cache starts clean.+ restore-keys: |+ ${{ steps.mypy-cache-key.outputs.prefix }}-+ ${{ github.event_name == 'pull_request' && format('{0}-', steps.mypy-cache-key.outputs.toolchain_prefix) || '' }}- name: Check static typingshell: bash -e {0}