ci: add python package build test

* We now test a package build on every PRs.
* Add precommit rule to validate the presence of __init__.py in
  directoies that contain python files

Closes: https://github.com/meta-llama/llama-stack/issues/2406
Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han 2025-06-17 16:14:20 +02:00
parent 6039d922c0
commit ba7e95e035
No known key found for this signature in database
13 changed files with 144 additions and 1 deletions

45
.github/workflows/python-build-test.yml vendored Normal file
View file

@ -0,0 +1,45 @@
name: Python Package Build Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13']
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install uv
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
version: 0.7.6
- name: Build Llama Stack package
run: |
uv build
- name: Install Llama Stack package
run: |
uv pip install dist/*.whl
- name: Verify Llama Stack package
run: |
uv pip list
uv pip show llama-stack
command -v llama
llama model prompt-format -m Llama3.2-90B-Vision-Instruct
llama model list
llama stack list-apis
llama stack list-providers inference