Skip to content

Installation & CI

The autosre repository enforces code quality and deployment safety through a combination of a local installer, pre-push git hooks, and GitHub Actions workflows. The installer (install.sh) bootstraps the Python environment and CLI, while the pre-push hook ensures that local development mirrors the CI pipeline’s linting, formatting, and testing standards before code is shared. Additionally, a specific guard within the hook prevents accidental pushes of non-release branches to the public repository, maintaining a clean release history.

The install.sh script provides a non-interactive or interactive bootstrap for the autosre CLI and its dependencies 1. It requires Python 3.14+ and kubectl (though kubectl is noted as required for the k3s stack deployment rather than the CLI itself). The script detects the execution environment, automatically enabling non-interactive mode if standard input or output is not a terminal.

Key steps in the installation process include:

  1. Validating the Python version (major 3, minor 14+).
  2. Installing click and httpx via pip.
  3. Installing the autosre package in editable mode (-e .).
  4. Running autosre setup.
  5. Optionally setting up local web research MCP servers if the claude CLI is detected.

Upon completion, the script provides quick-start commands such as autosre k3s up, autosre start, and autosre test. In interactive mode, it prompts the user to scale vLLM up immediately.

The repository includes a pre-push hook located in .githooks/pre-push 2. This hook serves two primary purposes: ensuring CI parity locally and guarding the public release repository.

The hook runs the exact same test lanes defined in the GitHub Actions CI workflow against the local .venv. This ensures that a successful local push implies a successful CI run. The lanes executed are:

  • ruff check on autosre/ and tests/.
  • ruff format --check on autosre/ and tests/.
  • mypy on autosre/.
  • pytest on tests/ (ignoring tests/integration).

If any lane fails, the push is aborted. If the local virtual environment is missing, the hook instructs the user to create it using python -m venv .venv && .venv/bin/pip install -e '.[dev]'.

Hooks are stored in the repository but are opt-in per checkout 3. To enable them, run:

Terminal window
git config core.hooksPath .githooks

To bypass the checks for an intentional push, use git push --no-verify 2.

The CI pipeline is defined in .github/workflows/ci.yml 4. It triggers on pushes and pull requests to main and dev branches. The workflow uses concurrency groups to cancel in-progress runs for the same branch.

The pipeline consists of four jobs:

  1. Lint (ruff): Runs ruff check and ruff format --check on autosre/ and tests/.
  2. Type check (mypy –strict): Runs mypy on autosre/.
  3. Tests (pytest): Runs pytest on tests/, ignoring tests/integration.
  4. Recipe perf gate: Runs only on pull requests. It checks recipe performance parameters against the base branch using python -m autosre.hooks_backend.recipe_ci_check.

All jobs use ubuntu-latest runners and Python 3.14. They install dev dependencies via pip install -e '.[dev]' before running their respective checks.

diagram