Skip to content

Update pyproject.toml #90

Update pyproject.toml

Update pyproject.toml #90

Workflow file for this run

name: test
on:
push:
branches: [main]
pull_request:
jobs:
lint:
name: Ruff (lint + format)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install ruff
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Ruff lint
run: ruff check .
# Report-only for now: `ruff format` would restyle a large part of the
# tree. Run `ruff format` once and commit it, then remove
# `continue-on-error` to make formatting a blocking gate.
- name: Ruff format (check only)
continue-on-error: true
run: ruff format --check .
typecheck:
name: Pyright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install package + pyright
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
# Report-only for now: the codebase has pre-existing type findings.
# Remove `continue-on-error` to make Pyright a blocking gate once
# `pyright` reports zero errors.
- name: Pyright
continue-on-error: true
run: pyright
test:
name: Tests (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Run tests
run: python -m unittest discover -s tests -v
package:
name: Build wheel, install & CLI smoke test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build sdist + wheel
run: |
python -m pip install --upgrade pip build
python -m build
- name: Install the built wheel into a clean venv
run: |
python -m venv /tmp/wheeltest
# Install ONLY from the built wheel (no source tree / editable install)
/tmp/wheeltest/bin/pip install --upgrade pip
/tmp/wheeltest/bin/pip install dist/*.whl
- name: CLI smoke test
# Run from a neutral directory: if we ran inside the checkout, the
# source `python_agent_harness/` tree would shadow the installed wheel
# on sys.path and we'd be testing the source, not the built artifact.
working-directory: /tmp
run: |
set -euxo pipefail
BIN=/tmp/wheeltest/bin/python-agent-harness
# Console script is installed and importable
"$BIN" --help
# Config subcommand runs without any API key / network
"$BIN" config
# Module entry point works too
/tmp/wheeltest/bin/python -m python_agent_harness --help
# Import resolves to the INSTALLED wheel + bundled prompts shipped
/tmp/wheeltest/bin/python - <<'PY'
import importlib.resources as r
import python_agent_harness
loc = python_agent_harness.__file__
assert "site-packages" in loc, f"imported source, not wheel: {loc}"
agent = r.files("python_agent_harness").joinpath("prompts/agent.md")
assert agent.is_file(), "bundled prompt missing from wheel"
print("wheel import OK:", loc)
print("bundled prompt OK:", agent)
PY
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*