Skip to content

chore: remove stale functions lockfile and upgrade vulnerable dependencies - #1914

Merged
spydon merged 1 commit into
mainfrom
chore/refresh-lockfiles
Nov 3, 2026
Merged

spydon merged 1 commit into
mainfrom
chore/refresh-lockfiles

Conversation

@spydon

@spydon spydon commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Delete src/functions/uv.lock. It was left over from moving functions-py into the monorepo (chore: include functions-py into monorepo #1204). src/functions is a uv workspace member, so uv only reads the root uv.lock, but Dependabot still reports 51 open alerts against this file (including 2 of the 4 critical ones).
  • Upgrade the packages with open Dependabot alerts in the root uv.lock (aiohttp, anyio, cryptography, urllib3, h2, msgpack, ujson and others). This is a targeted --upgrade-package refresh, not a full uv lock --upgrade, so ruff, mypy and the docs toolchain stay on their current versions.
  • Remove python_version = "3.9" from the mypy config of auth, realtime and storage. Newer anyio uses match statements and no longer installs exceptiongroup on Python 3.11+, so mypy pinned to 3.9 but run on a newer interpreter fails on site-packages. mypy now checks against the interpreter it runs on, and the CI matrix still runs it on 3.9.

Remaining alerts

The fixed releases of most packages require Python 3.10+, so the lockfile keeps a vulnerable version for the Python 3.9 resolution. Dependabot will keep those root uv.lock alerts open until Python 3.9 support is dropped. pytest also stays on 8.4.2 because src/functions pins pytest <9.0.0.

Testing

  • make mypy passes on Python 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14.
  • ruff check and ruff format --check pass.
  • supabase_functions tests pass on 3.9, 3.10 and 3.14.

…ncies

src/functions/uv.lock was left over from moving functions-py into the monorepo. functions is a uv workspace member, so the file is never read, but Dependabot still reports 51 alerts against it.

Upgrade the packages with open Dependabot alerts in the root uv.lock. The fixed releases dropped Python 3.9, so they only apply to the 3.10+ resolutions.

Newer anyio uses match statements and no longer pulls in exceptiongroup on 3.11+, which breaks mypy when it is pinned to python_version 3.9 but run on a newer interpreter. Drop the pin in auth, realtime and storage so mypy checks against the running interpreter. The CI matrix still runs mypy on 3.9.
@spydon
spydon merged commit fc58953 into main Nov 3, 2026
46 checks passed
@spydon
spydon deleted the chore/refresh-lockfiles branch November 3, 2026 10:26
spydon added a commit that referenced this pull request Nov 3, 2026
Stacked on #1914.

## Summary

Python 3.9 and 3.10 are past end of life, and the security fixes for
most dependencies with open Dependabot alerts are only released for
Python 3.10+ or 3.11+. Dropping both versions lets the lockfile resolve
every package to a single patched version.

The PR has two commits so the hand-made changes can be reviewed
separately from the mechanical ruff rewrite.

### 1. Drop Python 3.9 and 3.10

- Require `requires-python = ">=3.11"` in every package and in the
FastAPI example.
- CI tests 3.11, 3.12, 3.13 and 3.14. The FastAPI e2e job tests 3.11 and
3.14.
- Remove the "Python versions below 3.10 are deprecated" warnings and
the version gates for `StrEnum` and `Self`.
- Drop the `strenum` dependency from functions and postgrest.
- Allow pytest 9 and pytest-asyncio 1.3+ in functions and supabase, so
pytest gets its tmpdir fix.
- Relock. Every package now resolves to one version, and every alert
against the root `uv.lock` resolves to a patched version. pyarrow is
held at 26.0.0 because 26.0.1 was published today without most of its
wheels.
- Update the devcontainers, READMEs and `AGENTS.md`.

### 2. Ruff pyupgrade fixes for py311

With `target-version = "py311"`, ruff's `keep-runtime-typing` stops
applying, so `ruff check --fix` rewrites `Optional[X]` and `Union[X, Y]`
to `X | None` and `X | Y` across about 100 files, `_sync` included. The
runtime `Union` aliases ruff has no fix for were converted by hand the
same way. `ASYNC109` is ignored because it only fires on py311+ and
would require removing the public `timeout` parameters on the realtime
channel methods.

## Release note

This uses `feat:` rather than `feat!:` so release-please cuts a minor
release instead of a major one on `main`. Users on 3.9 and 3.10 keep
resolving the last compatible release, because pip and uv honour
`requires-python`.

## Testing

- `make mypy` passes on Python 3.11, 3.12, 3.13 and 3.14.
- `make <pkg>.tests` passes for all six packages on Python 3.11,
including the infrastructure-backed suites (functions 121, supabase 50
plus xfail/xpass, postgrest 614, storage 151, auth 257, realtime 89).
- `make build-sync` followed by `make ruff` produces no diff.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Compatibility**
* The minimum supported Python version is now 3.11 across the SDK
packages and FastAPI example. Python 3.9 and 3.10 are no longer included
in the main CI test matrix.
* Development containers now use Python 3.11. CI continues to test
through Python 3.14, with updated Python versions in the FastAPI
end-to-end workflow.

* **Documentation**
* Updated installation guidance and prerequisites to specify Python 3.11
or later.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
spydon added a commit that referenced this pull request Nov 3, 2026
…ncies (#1952)

## Summary

- Delete `src/functions/uv.lock`, the same fix #1914 applied to the v2
line. The file was left over from moving functions-py into the monorepo.
`src/functions` is a uv workspace member, so uv only reads the root
`uv.lock`, but Dependabot still scans this file and reports 66 open
alerts against it (pyjwt, virtualenv, setuptools, anyio, certifi and
others). The v3 branch never got #1914, so these alerts appeared once v3
became the default branch.
- Upgrade the three packages in the root `uv.lock` that still had open
alerts: pytest 8.4.2 to 9.2.0, python-dotenv 1.1.1 to 1.2.4 and requests
2.32.5 to 2.34.2.
- Allow pytest 9 and pytest-asyncio 1.x in the `functions` and
`supabase` dev dependencies. Their upper bounds (`pytest <9.0.0`,
`pytest-asyncio <1.2.0` and `<1.1`) blocked the pytest upgrade.
pytest-asyncio moves from 1.0.0 to 1.4.1.

## Root lockfile

The other open alerts on the root `uv.lock` are already fixed by #1951,
which bumped every affected package to a patched version. They should
close when Dependabot next rescans the default branch.

## Testing

- `uv lock --check` passes.
- `supabase_functions` and `supabase` tests pass with pytest 9.
- Every package's test suite collects under pytest 9. The infra-backed
suites run in CI.
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