Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Python.
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.9'

- name: Setup Poetry.
uses: snok/install-poetry@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup Python.
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9

- name: Setup Poetry.
uses: snok/install-poetry@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Python.
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9

- name: Run linter check.
uses: astral-sh/ruff-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]

runs-on: ${{matrix.os}}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_lexicons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Python.
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.9'

- name: Setup Poetry.
uses: snok/install-poetry@v1
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.8"
python: "3.9"
jobs:
post_create_environment:
- python -m pip install poetry
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ This SDK attempts to implement everything that provides ATProto. There is suppor

### Requirements

- Python 3.8 or higher.
- Python 3.9 or higher.

### Installing

Expand Down
2 changes: 1 addition & 1 deletion docs/source/readme.content.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This SDK attempts to implement everything that provides ATProto. There is suppor

### Requirements

- Python 3.8 or higher.
- Python 3.9 or higher.

### Installing

Expand Down
17 changes: 13 additions & 4 deletions packages/atproto_firehose/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from atproto_client.models.base import ParamsModelBase
from atproto_client.models.common import XrpcError
from atproto_core.exceptions import DAGCBORDecodingError
from websockets.client import connect as aconnect
from websockets.asyncio.client import connect as aconnect
from websockets.exceptions import (
ConnectionClosedError,
ConnectionClosedOK,
Expand Down Expand Up @@ -46,8 +46,8 @@


if t.TYPE_CHECKING:
from websockets.client import ClientConnection as SyncWebSocketClient
from websockets.legacy.client import Connect as AsyncConnect
from websockets.asyncio.client import connect as AsyncConnect
from websockets.sync.client import ClientConnection as SyncWebSocketClient


def _build_websocket_uri(method: str, base_uri: str, params: t.Optional[t.Dict[str, t.Any]] = None) -> str:
Expand Down Expand Up @@ -124,9 +124,18 @@ def _websocket_uri(self) -> str:
return _build_websocket_uri(self._method, self._base_uri, self._params)

def _get_client(self) -> 'SyncWebSocketClient':
return connect(self._websocket_uri, max_size=_MAX_MESSAGE_SIZE_BYTES, close_timeout=0.1)
# Disable automatic pings for sync client (added in websockets v15+)
# to maintain behavior consistent with <v14 for now.
return connect(
self._websocket_uri,
max_size=_MAX_MESSAGE_SIZE_BYTES,
close_timeout=0.1,
# see https://websockets.readthedocs.io/en/stable/topics/keepalive.html
ping_interval=None, # Disable automatic pings
)

def _get_async_client(self) -> 'AsyncConnect':
# Async client connect function accepts ping_interval directly (default is 20s)
return aconnect(self._websocket_uri, max_size=_MAX_MESSAGE_SIZE_BYTES, close_timeout=0.1)

def _get_reconnection_delay(self) -> int:
Expand Down
189 changes: 76 additions & 113 deletions poetry.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -49,11 +48,11 @@ atp = "atproto_cli:atproto_cli"
atproto = "atproto_cli:atproto_cli"

[tool.poetry.dependencies]
python = ">=3.8,<3.14"
python = ">=3.9,<3.14"
httpx = ">=0.25.0,<0.29.0"
typing-extensions = ">=4.8.0,<5"
click = ">=8.1.3,<9"
websockets = ">=12,<14"
websockets = ">=15,<16"
pydantic = ">=2.7,<3"
libipld = ">=3.0.1,<4"
dnspython = ">=2.4.0,<3"
Expand All @@ -68,7 +67,7 @@ pyright = "1.1.362"
sphinx = "7.1.2" # they dropped Python 3.8 support in 7.2.0
myst-parser = "3.0.1"
furo = "2024.8.6"
autodoc-pydantic = "2.1.0" # for some reason 2.2.0 requirs Python > 3.8.1
autodoc-pydantic = "2.1.0" # for some reason 2.2.0 requires Python > 3.8.1
sphinx-copybutton = "0.5.2"
sphinx-favicon = "1.0.1"
sphinxext-opengraph = "0.9.1"
Expand All @@ -94,15 +93,15 @@ requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.mypy]
python_version = "3.8"
python_version = "3.9"
disallow_untyped_defs = false # TODO(MarshalX) enable

[tool.pyright]
reportMissingTypeStubs = false

[tool.ruff]
line-length = 120
target-version = "py38"
target-version = "py39"

[tool.ruff.format]
quote-style = "single"
Expand Down
Loading