Migrate package to uv #592
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| env: | |
| DEFAULT_PYTHON: "3.10" | |
| RUFF_VERSION: 0.14.10 | |
| UV_VERSION: 0.9.22 | |
| permissions: | |
| contents: read | |
| jobs: | |
| ruff: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: chartboost/ruff-action@v1 | |
| with: | |
| args: "check --fix" | |
| version: ${{ env.RUFF_VERSION }} | |
| # A proposal to replace black & pylint | |
| # - uses: chartboost/ruff-action@v1 | |
| # with: | |
| # args: "format --check" | |
| # version: ${{ env.RUFF_VERSION }} | |
| black: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON }} | |
| - uses: psf/black@24.4.2 | |
| pylint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: ${{ env.UV_VERSION }} | |
| - name: Install Requirements | |
| run: uv sync --frozen --all-extras | |
| - name: Run Pylint | |
| run: | | |
| uv run pylint office365 | |
| pytest: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - ruff | |
| - black | |
| - pylint | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ env.DEFAULT_PYTHON }} | |
| - name: Install Requirements | |
| run: uv sync --frozen --all-extras | |
| - name: Test with pytest (skip entirely if secrets missing) | |
| env: | |
| office365_python_sdk_securevars: ${{ secrets.OFFICE365_PYTHON_SDK_SECUREVARS }} | |
| run: | | |
| if [ -z "${{env.office365_python_sdk_securevars}}" ]; then \ | |
| echo "No secrets available; skipping pytest"; \ | |
| exit 0; \ | |
| else \ | |
| uv run pytest; \ | |
| fi |