Skip to content

Commit 477bcef

Browse files
committed
Add timeouts, retries, new loaders, tests & CI
Introduce request retries and a DEFAULT_TIMEOUT applied to all HTTP calls, add timeout parameters to get/post/patch/delete, and raise AuthenticationError on 401 during paginated loads. Add device auth polling timeout (max_wait), context-manager support (__enter__/__exit__), and validation for unknown kwargs in _convenience_load; change many convenience loader offsets to default to None. Add numerous new convenience loader helpers (procedurelog, subjectlog, equipment, consumablestock, behavioralassay, datastorage, setup, hardwaredevice, brainregion, species, strain, publication, laboratory). Bump package __version__ to 2.0.0 and require requests>=2.28, update tutorial to use placeholder UUIDs, add comprehensive unit tests for timeouts, auth polling, context manager, loader validation and new loaders, and add a GitHub Actions workflow to run tests on push/PR across Python versions.
1 parent 08c934e commit 477bcef

File tree

6 files changed

+633
-26
lines changed

6 files changed

+633
-26
lines changed

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.8", "3.10", "3.12"]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install package and dev deps
23+
run: pip install -e ".[dev]"
24+
25+
- name: Run tests
26+
run: pytest --tb=short

brainstem_api_tools/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
from .brainstem_api_client import BrainstemClient, ModelType, PortalType, AuthenticationError
2+
3+
__version__ = "2.0.0"

0 commit comments

Comments
 (0)