Skip to content

fix: nullable integer streaming stats on pandas < 2 (#192) #201

fix: nullable integer streaming stats on pandas < 2 (#192)

fix: nullable integer streaming stats on pandas < 2 (#192) #201

Workflow file for this run

name: Wheel size and content guard
# Fails when model weights (or anything from training/) sneak into the wheel,
# or the wheel grows past the configured threshold.
on:
pull_request:
push:
branches: [main]
env:
MAX_WHEEL_BYTES: "2000000"
permissions:
contents: read
jobs:
wheel-guard:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Build wheel
run: |
python -m pip install -U pip build
python -m build --wheel --outdir dist-wheel .
- name: Check wheel contents and size
run: |
python - <<'EOF'
import glob, os, sys, zipfile
[wheel] = glob.glob("dist-wheel/*.whl")
names = zipfile.ZipFile(wheel).namelist()
bad = [n for n in names
if n.endswith((".onnx", ".pt", ".safetensors", ".bin"))
or n.startswith("training/")]
if bad:
sys.exit(f"model/training files inside the wheel: {bad}")
size = os.path.getsize(wheel)
limit = int(os.environ["MAX_WHEEL_BYTES"])
if size > limit:
sys.exit(f"wheel size {size} exceeds limit {limit}")
print(f"wheel OK: {os.path.basename(wheel)} ({size} bytes, {len(names)} files)")
EOF