Skip to content

chore: release v1.48.0 (#612) #1167

chore: release v1.48.0 (#612)

chore: release v1.48.0 (#612) #1167

Workflow file for this run

name: Python Tests
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "packages/aimock-pytest/**"
- "src/**"
- "dist/**"
pull_request:
branches: [main]
paths:
- "packages/aimock-pytest/**"
- "src/**"
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
node-version: [20, 22, 24, 26]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: { persist-credentials: false }
- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
# Build the TS package first
- run: pnpm install --frozen-lockfile
- run: pnpm run build
# Set CLI path to local build
- name: Set AIMOCK_CLI_PATH
run: echo "AIMOCK_CLI_PATH=$PWD/dist/cli.js" >> $GITHUB_ENV
# Install and test Python package
- name: Install aimock-pytest
# The build backend is hash-pinned and build isolation is OFF, so pip
# does not resolve `build-system.requires` from PyPI and execute it here.
# Measured on 2026-08-05: with the registry serving substituted bytes,
# the old one-liner imported the substituted `hatchling.build` twice
# (get_requires_for_build_wheel, then prepare_metadata) before it did
# anything else.
#
# `requests` and `pytest` are STILL resolved unpinned, deliberately. This
# job exists to catch breakage against current releases across four
# Pythons; freezing them would retire that signal, and this job declares
# no secrets and holds `contents: read`. The publish job — which does hold
# a publish identity — installs from the same pinned file and builds the
# same way, so the backend that builds a release is the backend tested here.
#
# `python -m pip` rather than `pip` so the interpreter that installs the
# backend is the same one that has to import it during the build.
run: |
python -m pip install --require-hashes -r .github/requirements/hatchling.txt
python -m pip install --no-build-isolation "./packages/aimock-pytest[test]"
- name: Run Python tests
run: cd packages/aimock-pytest && pytest tests/ -v