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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/python-3/.devcontainer/base.Dockerfile

# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
ARG VARIANT="3.10-bullseye"
ARG VARIANT="3.11-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.10-bullseye",
"VARIANT": "3.11-bullseye",
// Options
"NODE_VERSION": "lts/*"
}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.11", "3.12", "3.13", "3.14"]
package: ["functions", "realtime", "storage", "auth", "postgrest", "supabase"]
resolution: ["highest"]
include:
- { os: ubuntu-latest, python-version: "3.10", package: functions, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.10", package: realtime, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.10", package: storage, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.10", package: auth, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.10", package: postgrest, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.10", package: supabase, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.11", package: functions, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.11", package: realtime, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.11", package: storage, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.11", package: auth, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.11", package: postgrest, resolution: lowest-direct }
- { os: ubuntu-latest, python-version: "3.11", package: supabase, resolution: lowest-direct }
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Setup and commands: [README.md § Local Development](README.md#local-development

- `make <pkg>.tests` runs mypy and pytest. For `auth`, `postgrest`, `storage` and `realtime`, pytest first starts Docker / Supabase CLI infra; `make stop-infra` when done.
- Fast loop for tests that need no infra: from `src/<pkg>`, `uv run --frozen --package <import name> pytest tests/<file>.py`.
- Code must run on Python 3.10 — CI tests 3.10–3.14 ([ci.yml](.github/workflows/ci.yml)).
- Code must run on Python 3.11, CI tests 3.11 to 3.14 ([ci.yml](.github/workflows/ci.yml)).

## Public API

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ supabase = { workspace = true }
asyncio_mode = "auto"

[tool.ruff]
target-version = "py310"
target-version = "py311"

[tool.ruff.lint]
select = [
Expand Down
4 changes: 2 additions & 2 deletions sdk-compliance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ features:
- BaseRequestClient
database.configuration.request_timeout:
status: implemented
note: "No timeout parameter. Configure the timeout on the httpx client passed in through http_session, or wrap async calls in asyncio.wait_for (asyncio.timeout on Python 3.11+)."
note: "No timeout parameter. Configure the timeout on the httpx client passed in through http_session, or wrap async calls in asyncio.wait_for or asyncio.timeout."
no_public_symbols: true
database.configuration.access_token:
status: partially_implemented
Expand Down Expand Up @@ -800,7 +800,7 @@ features:
no_public_symbols: true
functions.invocation.timeout:
status: implemented
note: "No timeout parameter. Configure the timeout on the httpx client passed in as http_client, or wrap async calls in asyncio.wait_for (asyncio.timeout on Python 3.11+)."
note: "No timeout parameter. Configure the timeout on the httpx client passed in as http_client, or wrap async calls in asyncio.wait_for or asyncio.timeout."
no_public_symbols: true

# ── Realtime ───────────────────────────────────────────────────────────────
Expand Down
2 changes: 1 addition & 1 deletion src/auth/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/python-3/.devcontainer/base.Dockerfile

# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
ARG VARIANT="3.10-bullseye"
ARG VARIANT="3.11-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
Expand Down
2 changes: 1 addition & 1 deletion src/auth/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.10-bullseye",
"VARIANT": "3.11-bullseye",
// Options
"NODE_VERSION": "lts/*"
}
Expand Down
4 changes: 2 additions & 2 deletions src/auth/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"pydantic >=2,<3",
"pyjwt[crypto] >=2.12.0",
Expand Down Expand Up @@ -78,7 +78,7 @@ requires = ["uv_build>=0.8.3,<0.9.0"]
build-backend = "uv_build"

[tool.mypy]
python_version = "3.10"
python_version = "3.11"
check_untyped_defs = true
allow_redefinition = true
follow_untyped_imports = true # for deprecation module that does not have stubs
Expand Down
3 changes: 1 addition & 2 deletions src/functions/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ maintainers = [
]
license = "MIT"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"pydantic>=2.12.2",
"strenum >=0.4.15",
"supabase-utils==3.0.0a1", # x-release-please-version
"yarl>=1.20.1",
]
Expand Down
8 changes: 1 addition & 7 deletions src/functions/src/supabase_functions/utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import sys
from enum import StrEnum

from httpx import AsyncClient as AsyncClient # noqa: F401

if sys.version_info >= (3, 11):
from enum import StrEnum
else:
from strenum import StrEnum


DEFAULT_FUNCTION_CLIENT_TIMEOUT = 5


Expand Down
9 changes: 2 additions & 7 deletions src/functions/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys
from enum import StrEnum
from typing import Any

import pytest
Expand Down Expand Up @@ -44,10 +44,5 @@ def test_is_valid_str_arg(test_input: Any, expected: bool) -> None:
assert is_valid_str_arg(test_input) == expected


def test_strenum_import_python_311_plus() -> None:
if sys.version_info >= (3, 11):
from enum import StrEnum as StrEnum
else:
from strenum import StrEnum

def test_function_region_is_str_enum() -> None:
assert isinstance(FunctionRegion.Any, StrEnum)
2 changes: 1 addition & 1 deletion src/postgrest/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/python-3/.devcontainer/base.Dockerfile

# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
ARG VARIANT="3.10-bullseye"
ARG VARIANT="3.11-bullseye"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
Expand Down
2 changes: 1 addition & 1 deletion src/postgrest/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"VARIANT": "3.10-bullseye",
"VARIANT": "3.11-bullseye",
// Options
"NODE_VERSION": "lts/*"
}
Expand Down
3 changes: 1 addition & 2 deletions src/postgrest/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"
]
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"deprecation >=2.1.0",
"pydantic >=2,<3",
"strenum >=0.4.9; python_version < \"3.11\"",
"yarl>=1.20.1",
"supabase_utils==3.0.0a1", # x-release-please-version
]
Expand Down
3 changes: 1 addition & 2 deletions src/postgrest/src/postgrest/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from base64 import b64encode
from types import TracebackType
from typing import Generic, Literal, Mapping, overload
from typing import Generic, Literal, Mapping, Self, overload

from supabase_utils.http.headers import Headers
from supabase_utils.http.io import (
Expand All @@ -15,7 +15,6 @@
from supabase_utils.http.query import URLQuery
from supabase_utils.http.request import HTTPRequestMethod
from supabase_utils.types import JSON
from typing_extensions import Self
from yarl import URL

from .request_builder import (
Expand Down
8 changes: 1 addition & 7 deletions src/postgrest/src/postgrest/request_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import copy
import json
import sys
from dataclasses import dataclass
from re import search
from typing import (
Expand All @@ -13,6 +12,7 @@
List,
Literal,
NamedTuple,
Self,
Tuple,
TypeVar,
overload,
Expand All @@ -34,18 +34,12 @@
Response,
)
from supabase_utils.types import JSON
from typing_extensions import Self
from yarl import URL

from .exceptions import APIError, APIErrorFromJSON, generate_default_error_message
from .types import CountMethod, Filters, FilterValue, ReturnMethod
from .utils import _model_validate_json, _sanitize_array_param, sanitize_param

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self

MAX_RETRIES = 3


Expand Down
7 changes: 1 addition & 6 deletions src/postgrest/src/postgrest/types.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
from __future__ import annotations

import sys

if sys.version_info >= (3, 11):
from enum import StrEnum
else:
from strenum import StrEnum
from enum import StrEnum

FilterValue = str | int | float | bool

Expand Down
4 changes: 2 additions & 2 deletions src/realtime/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ maintainers = [
license = "MIT"
readme = "README.md"
repository = "https://github.com/supabase/supabase-py"
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"supabase_utils==3.0.0a1", # x-release-please-version
"websockets >=14,<16",
Expand Down Expand Up @@ -74,7 +74,7 @@ keep-runtime-typing = true
asyncio_mode = "auto"

[tool.mypy]
python_version = "3.10"
python_version = "3.11"
check_untyped_defs = true
allow_redefinition = true

Expand Down
2 changes: 1 addition & 1 deletion src/realtime/src/realtime/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
Mapping,
Optional,
TypeAlias,
assert_never,
)

import websockets
from supabase_utils.types import JSON
from typing_extensions import assert_never

from .message import (
BroadcastMessage,
Expand Down
9 changes: 2 additions & 7 deletions src/realtime/src/realtime/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,7 @@ async def automatically_reconnect(
connected_at = loop.time()
await client_handler(client)
break
except (
websockets.ConnectionClosed,
TimeoutError,
asyncio.TimeoutError,
OSError,
):
except (websockets.ConnectionClosed, TimeoutError, OSError):
if (
connected_at is not None
and loop.time() - connected_at >= MAX_RECONNECT_DELAY
Expand Down Expand Up @@ -247,7 +242,7 @@ async def heartbeat(self) -> None:
await asyncio.sleep(max(self.hb_interval, 15))
except asyncio.CancelledError:
return
except (websockets.ConnectionClosed, asyncio.TimeoutError) as exc:
except (TimeoutError, websockets.ConnectionClosed) as exc:
if (
not self._connection_failure.done()
or self._connection_failure.cancelled()
Expand Down
2 changes: 1 addition & 1 deletion src/storage/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
license = "MIT"
readme = "README.md"
version = "3.0.0a1" # {x-release-please-version}
requires-python = ">=3.10"
requires-python = ">=3.11"

dependencies = [
"deprecation >=2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/storage/tests/test_vector_index.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from datetime import datetime, timezone
from datetime import UTC, datetime
from typing import Any

from httpx import Request, Response
Expand Down Expand Up @@ -32,7 +32,7 @@ def handler(request: Request) -> Response:
)

assert result is not None
assert result.index.creation_time == datetime(2025, 1, 1, tzinfo=timezone.utc)
assert result.index.creation_time == datetime(2025, 1, 1, tzinfo=UTC)


@use_async
Expand Down
2 changes: 1 addition & 1 deletion src/supabase/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent"
]
requires-python = ">=3.10"
requires-python = ">=3.11"
dependencies = [
"realtime == 3.0.0a1", # x-release-please-version
"supabase_functions == 3.0.0a1", # x-release-please-version
Expand Down
2 changes: 1 addition & 1 deletion src/utils/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent"
]
requires-python = ">=3.10"
requires-python = ">=3.11"
description = "Common collection of methods used in the supabase python libraries."
readme = "README.md"
dependencies = [
Expand Down
3 changes: 2 additions & 1 deletion src/utils/src/supabase_utils/http/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
Generator,
Generic,
Protocol,
Self,
TypeAlias,
TypeVar,
overload,
)

from typing_extensions import Concatenate, ParamSpec, Self
from typing_extensions import Concatenate, ParamSpec
from yarl import URL

from .headers import Headers
Expand Down
Loading
Loading