👷 Use uv in CI (#1019)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by GitHub · parent 233009a · Browse files · 5 files·+60 added−34 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+60 added−34 removed
- other:+60 added−34 removed
Provenance
- Commit
55b628b- Tree
e53aefe- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
233009a
5 files changed+60 added−34 removed
modified:.github/workflows/build-docs.yml+14 added-8 removed
5 unmodified lines6789101112131415161737 unmodified lines555657585556596061585962636465666761626869646570717273747524 unmodified lines5 unmodified lines pull_request: types: - opened - synchronize
env: UV_SYSTEM_PYTHON: 1
jobs: changes: runs-on: ubuntu-latest # Required permissions37 unmodified lines - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - uses: actions/cache@v4 id: cache - name: Setup uv uses: astral-sh/setup-uv@v3 with: path: ${{ env.pythonLocation }} key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-insiders.txt') }}-v02 version: "0.4.15" enable-cache: true cache-dependency-glob: | requirements**.txt pyproject.toml - name: Install docs extras if: steps.cache.outputs.cache-hit != 'true' run: pip install -r requirements-docs.txt run: uv pip install -r requirements-docs.txt - name: Install Material for MkDocs Insiders if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true' run: pip install -r requirements-docs-insiders.txt if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) run: uv pip install -r requirements-docs-insiders.txt env: TOKEN: ${{ secrets.TYPER_MKDOCS_MATERIAL_INSIDERS }} - uses: actions/cache@v4 with:24 unmodified linesmodified:.github/workflows/deploy-docs.yml+8 added-6 removed
23 unmodified lines24252627282928293031323132333435363435373839404134 unmodified lines23 unmodified lines - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - uses: actions/cache@v4 id: cache - name: Setup uv uses: astral-sh/setup-uv@v3 with: path: ${{ env.pythonLocation }} key: ${{ runner.os }}-python-github-actions-${{ env.pythonLocation }}-${{ hashFiles('requirements-github-actions.txt') }}-v01 version: "0.4.15" enable-cache: true cache-dependency-glob: | requirements**.txt pyproject.toml - name: Install GitHub Actions dependencies if: steps.cache.outputs.cache-hit != 'true' run: pip install -r requirements-github-actions.txt run: uv pip install -r requirements-github-actions.txt - name: Deploy Docs Status Pending run: python ./scripts/deploy_docs_status.py env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}34 unmodified linesmodified:.github/workflows/smokeshow.yml+16 added-6 removed
1 name: Smokeshow2 3 on:4 workflow_run:5- workflows: [Test]6- types: [completed]5+ workflows:6+ - Test7+ types:8+ - completed9 10 permissions:11 statuses: write12 13+env:14+ UV_SYSTEM_PYTHON: 115+16 jobs:17 smokeshow:18 if: ${{ github.event.workflow_run.conclusion == 'success' }}19 runs-on: ubuntu-latest5 unmodified lines25 run: echo "$GITHUB_CONTEXT"26 - uses: actions/setup-python@v527 with:28 python-version: '3.9'24-25- - run: pip install smokeshow26-29+ - name: Setup uv30+ uses: astral-sh/setup-uv@v331+ with:32+ version: "0.4.15"33+ enable-cache: true34+ cache-dependency-glob: |35+ requirements**.txt36+ pyproject.toml37+ - run: uv pip install -r requirements-github-actions.txt38 - uses: actions/download-artifact@v439 with:40 name: coverage-html41 path: htmlcov42 github-token: ${{ secrets.GITHUB_TOKEN }}43 run-id: ${{ github.event.workflow_run.id }}33-44 - run: smokeshow upload htmlcov45 env:46 SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}47 SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 1004 unmodified linesmodified:.github/workflows/test.yml+21 added-14 removed
10 unmodified lines11 schedule:12 # cron every week on monday13 - cron: "0 0 * * 1"14 15+env:16+ UV_SYSTEM_PYTHON: 117+18 jobs:19 test:20 strategy:21 matrix:21 unmodified lines43 - name: Set up Python44 uses: actions/setup-python@v545 with:46 python-version: ${{ matrix.python-version }}44- # Issue ref: https://github.com/actions/setup-python/issues/43645- # cache: "pip"46- # cache-dependency-path: pyproject.toml47- - uses: actions/cache@v448- if: ${{ runner.os != 'macOS' }}49- id: cache47+ - name: Setup uv48+ uses: astral-sh/setup-uv@v349 with:51- path: ${{ env.pythonLocation }}52- key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}50+ version: "0.4.15"51+ enable-cache: true52+ cache-dependency-glob: |53+ requirements**.txt54+ pyproject.toml55 - name: Install Dependencies54- if: steps.cache.outputs.cache-hit != 'true'55- run: pip install -r requirements-tests.txt56+ run: uv pip install -r requirements-tests.txt57 - name: Lint58 run: bash scripts/lint.sh59 - run: mkdir coverage60 - run: bash ./scripts/test-files.sh20 unmodified lines81 - uses: actions/checkout@v482 - uses: actions/setup-python@v583 with:84 python-version: '3.8'84- # Issue ref: https://github.com/actions/setup-python/issues/43685- # cache: "pip"86- # cache-dependency-path: pyproject.toml85+ - name: Setup uv86+ uses: astral-sh/setup-uv@v387+ with:88+ version: "0.4.15"89+ enable-cache: true90+ cache-dependency-glob: |91+ requirements**.txt92+ pyproject.toml93 - name: Get coverage files94 uses: actions/download-artifact@v495 with:96 pattern: coverage-*97 path: coverage98 merge-multiple: true93- - run: pip install coverage[toml]99+ - name: Install Dependencies100+ run: uv pip install -r requirements-tests.txt101 - run: ls -la coverage102 - run: coverage combine coverage103 - run: coverage report104 - run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"22 unmodified linesmodified:requirements-github-actions.txt+1 added
1 PyGithub>=2.3.0,<3.0.02 pydantic>=2.5.3,<3.0.03 pydantic-settings>=2.1.0,<3.0.04 httpx>=0.27.0,<0.28.05+smokeshow