Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish Python Package

on:
workflow_dispatch:
release:
types: [published]

permissions:
contents: read

jobs:
release-build:
runs-on: ubuntu-latest
# PyPI use trusted publisher
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install uv
uv venv
make dev
- name: Build
run: |
make build
- name: Validate
run: |
python -m pip install dist/*.whl
python -c "import oci_openai;"
# - name: Publish to Test PyPI
# run: |
# python -m pip install twine
# twine check dist/*
# twine upload --verbose -r testpypi dist/*
- name: Publish to PyPI
run: |
python -m pip install twine
twine check dist/*
twine upload --verbose dist/*
39 changes: 39 additions & 0 deletions .github/workflows/run-all-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Unit test, format and lint check

on:
workflow_dispatch:
pull_request:
branches: [ "main" ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install uv
uv venv
make dev
- name: Format and Lint
run: |
make check
- name: Test with pytest
run: |
make test
- name: Build
run: |
make build
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ dev = [
"pytest-mock",
"ag2[openai]",
"pytest-httpx",
"pytest-asyncio"
"pytest-asyncio",
"eval_type_backport"
]

[project.urls]
Expand Down