llama-stack-mirror/.github/workflows/python-build-test.yml
Charlie Doern 2e5d1c8881 refactor: enforce top-level imports for llama-stack-api
Enforce that all imports from llama-stack-api use the form:

from llama_stack_api import <symbol>

 This prevents external code from accessing internal package structure
 (e.g., llama_stack_api.agents, llama_stack_api.common.*) and establishes
 a clear public API boundary.

 Changes:
 - Export 400+ symbols from llama_stack_api/__init__.py
 - Include all API types, common utilities, and strong_typing helpers
 - Update files across src/llama_stack, docs/, tests/, scripts/
 - Convert all submodule imports to top-level imports
 - ensure docs use the proper importing structure

 Addresses PR review feedback requiring explicit __all__ definition to
 prevent "peeking inside" the API package.

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2025-11-13 14:14:52 -05:00

50 lines
1.2 KiB
YAML

name: Python Package Build Test
run-name: Test building the llama-stack PyPI project
on:
push:
branches:
- main
pull_request:
branches:
- main
paths-ignore:
- 'src/llama_stack_ui/**'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12', '3.13']
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Install uv
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
version: 0.7.6
- name: Build Llama Stack API package
working-directory: src/llama-stack-api
run: uv build
- name: Build Llama Stack package
run: uv build
- name: Install Llama Stack package (with api stubs from local build)
run: |
uv pip install --find-links src/llama-stack-api/dist dist/*.whl
- name: Verify Llama Stack package
run: |
uv pip list
uv pip show llama-stack
command -v llama
llama stack list-apis
llama stack list-providers inference