Skip to content

Make test coverage 100% #2388

Make test coverage 100%

Make test coverage 100% #2388

Workflow file for this run

name: Build and Test Workflow
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# midnight EST
- cron: '0 5 * * *'
# allow this to be scheduled manually in addition to cron
workflow_dispatch:
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Pkg + Dependencies
run: |
python -m pip install .[dev]
- name: Test with pytest
run: |
python -m pytest -ra
- name: Build wheels pkg
run: |
python -m pip install --upgrade pip build
python -m build --wheel --outdir dist
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
pip install flake8 black==25.1.0 ufmt==2.8.0 usort==1.0.8.post1
- name: Flake8
run: |
flake8 .
- name: ufmt (formatting check)
run: |
echo "Checking for formatting issues..."
ufmt diff .
ufmt check .
pyre:
# NOTE: .pyre_configuration.external has "ignore_all_errors" for tests/ - this is intentional.
# Meta's internal Pyre uses python/typeshed_experimental with permissive pandas stubs
# (Axes = ... | list | tuple), but external pyre-check-nightly uses stricter typeshed
# stubs that reject tuple/list for DataFrame index/columns. This causes ~85 false-positive
# errors in tests that don't occur internally. The main library code (balance/) is still
# fully type-checked.
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install project dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Install Pyre nightly
run: |
pip install pyre-check-nightly==0.0.101750936314
- name: Pyre type check
run: |
cp .pyre_configuration.external .pyre_configuration
pyre --noninteractive check
test-deploy-website:
name: Test website build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 18
cache: yarn
cache-dependency-path: "./website/yarn.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install Pkg + Dependencies
run: |
python -m pip install .[dev]
- name: Build website
run: bash ./scripts/make_docs.sh -n