Skip to content

feat: user-scoped GrowthBookClient instances via create_scoped_instance #487

feat: user-scoped GrowthBookClient instances via create_scoped_instance

feat: user-scoped GrowthBookClient instances via create_scoped_instance #487

Workflow file for this run

name: Build
# Pull requests get CI from the pull_request event; release-please's pushes to its release branch
# don't start push workflows, so a push-only trigger left release PRs untested
on:
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
steps:
- name: "Begin CI..."
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
pip install -r requirements.txt
python -m pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=25 --max-line-length=127 --statistics
- name: Static type checking with MyPy
run: |
mypy
- name: Test with pytest
run: |
pytest
type-check-pyright:
# Pyright is what IDEs (Pylance) and coding agents surface — the typing
# regression suite must hold under it, not just mypy.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
pip install -r requirements.txt
python -m pip install .
- name: Install pyright
run: npm install -g pyright@1.1.403
- name: Static type checking with Pyright
run: pyright
- name: Typing regression suite (mypy + pyright)
run: pytest tests/test_typing.py -q
corpus-freshness:
# Drift check between tests/cases.json and the JS SDK's cases.json.
# Fails the build on any "missing" case not listed in
# tests/scripts/corpus_skiplist.json.
# Extras (Python's local additions) are reported but never fail.
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Check corpus freshness vs JS SDK
run: python3 tests/scripts/check_corpus_freshness.py