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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: pip
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- run: python -m pip install --upgrade pip build
- run: python -m build
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
Expand All @@ -29,7 +29,7 @@ jobs:
permissions:
id-token: write # required for Trusted Publishing
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
Expand Down
10 changes: 5 additions & 5 deletions wellmarked/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@

import asyncio
import time
from typing import Iterable, Optional, Union
from typing import Iterable, Optional, Union, Any

import httpx

from ._base import (
DEFAULT_BASE_URL,
DEFAULT_TIMEOUT,
default_headers,
merge_headers,
parse_response,
resolve_api_key,
Expand Down Expand Up @@ -192,7 +191,7 @@ async def rotate_webhook_secret(self) -> RotatedWebhookSecret:

# ── Transport ─────────────────────────────────────────────────────────────

async def _request(self, method: str, path: str, *, json: object = None):
async def _request(self, method: str, path: str, *, json: object = None) -> Any:
# See WellMarked._request for why we build absolute URLs ourselves.
url = f"{self._base_url}{path}"
try:
Expand All @@ -201,8 +200,9 @@ async def _request(self, method: str, path: str, *, json: object = None):
raise wrap_transport_error(exc) from exc

try:
body = response.json() if response.content else None
except ValueError:
assert response.content
body = response.json()
except (AssertionError, ValueError):
body = None

# httpx Headers is dict-like for our purposes; pass it through so
Expand Down
10 changes: 5 additions & 5 deletions wellmarked/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
from __future__ import annotations

import time
from typing import Iterable, Optional, Union
from typing import Iterable, Optional, Union, Any

import httpx

from ._base import (
DEFAULT_BASE_URL,
DEFAULT_TIMEOUT,
default_headers,
merge_headers,
parse_response,
resolve_api_key,
Expand Down Expand Up @@ -326,7 +325,7 @@ def rotate_webhook_secret(self) -> RotatedWebhookSecret:

# ── Transport ─────────────────────────────────────────────────────────────

def _request(self, method: str, path: str, *, json: object = None):
def _request(self, method: str, path: str, *, json: object = None) -> Any:
# Build absolute URLs ourselves rather than relying on httpx's base_url
# join. That way a user-supplied http_client without a base_url still
# works — important when the caller wants a custom transport/proxy.
Expand All @@ -337,8 +336,9 @@ def _request(self, method: str, path: str, *, json: object = None):
raise wrap_transport_error(exc) from exc

try:
body = response.json() if response.content else None
except ValueError:
assert response.content
body = response.json()
except (AssertionError, ValueError):
body = None

# httpx Headers is dict-like for our purposes; pass it through so
Expand Down