diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..6c5667f --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -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/* diff --git a/.github/workflows/run-all-check.yaml b/.github/workflows/run-all-check.yaml new file mode 100644 index 0000000..293f7a9 --- /dev/null +++ b/.github/workflows/run-all-check.yaml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index a7ae921..cba0cba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,8 @@ dev = [ "pytest-mock", "ag2[openai]", "pytest-httpx", - "pytest-asyncio" + "pytest-asyncio", + "eval_type_backport" ] [project.urls]