-
Notifications
You must be signed in to change notification settings - Fork 186
Migrate to uv #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to uv #540
Changes from all commits
173ece7
861799a
a0a07d3
0c47bf9
4f9692f
43b9902
a5c9385
79ee4c3
9d4e989
01311ba
25eeac4
fa3d8f3
f3d3f2d
53ac67f
7203bdf
cbd1a59
9d13a9e
564a5a6
c8aa0cb
e84ef5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,147 +7,113 @@ | |
| branches: [ main ] | ||
|
|
||
| env: | ||
| PYTHON_VERSION: "3.12" | ||
| PIPELINE_FAMILY: "general" | ||
|
|
||
| jobs: | ||
| setup: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/cache@v5 | ||
| id: virtualenv-cache | ||
| with: | ||
| path: | | ||
| .venv | ||
| key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/*.txt') }} | ||
| - name: Set up Python ${{ env.PYTHON_VERSION }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
| - name: Setup virtual environment (no cache hit) | ||
| if: steps.virtualenv-cache.outputs.cache-hit != 'true' | ||
| run: | | ||
| python${{ env.PYTHON_VERSION }} -m venv .venv | ||
| source .venv/bin/activate | ||
| make install-ci | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
| needs: setup | ||
| runs-on: opensource-linux-8core | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/cache@v5 | ||
| id: virtualenv-cache | ||
| - name: Read Python version from .python-version | ||
| run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| path: | | ||
| .venv | ||
| key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/*.txt') }} | ||
| enable-cache: true | ||
| cache-dependency-glob: "uv.lock" | ||
| - name: Set up Python ${{ env.PYTHON_VERSION }} | ||
| run: uv python install ${{ env.PYTHON_VERSION }} | ||
| - name: Install lint dependencies | ||
| run: uv sync --only-group lint --frozen | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CI lint mypy loses all third-party type informationMedium Severity The CI lint job uses Additional Locations (1) |
||
| - name: Lint | ||
| run: | | ||
| source .venv/bin/activate | ||
| make check | ||
| run: make check | ||
|
|
||
| shellcheck: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| runs-on: ubuntu-latest | ||
| runs-on: opensource-linux-8core | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: ShellCheck | ||
| uses: ludeeus/action-shellcheck@master | ||
|
|
||
| test: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| runs-on: ubuntu-latest | ||
| needs: [setup, lint] | ||
| runs-on: opensource-linux-8core | ||
| needs: lint | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/cache@v5 | ||
| id: virtualenv-cache | ||
| - name: Read Python version from .python-version | ||
| run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| path: | | ||
| .venv | ||
| key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/test.txt') }} | ||
|
|
||
| enable-cache: true | ||
| cache-dependency-glob: "uv.lock" | ||
| - name: Set up Python ${{ env.PYTHON_VERSION }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
| - name: Run core tests | ||
| run: uv python install ${{ env.PYTHON_VERSION }} | ||
| - name: Install dependencies and run core tests | ||
| run: | | ||
| python${{ env.PYTHON_VERSION }} -m venv .venv | ||
| source .venv/bin/activate | ||
| sudo apt-get update && sudo apt-get install --yes poppler-utils libreoffice | ||
| make install-test | ||
| uv sync --group test --frozen | ||
| make install-pandoc | ||
| make install-nltk-models | ||
| sudo add-apt-repository -y ppa:alex-p/tesseract-ocr5 | ||
| sudo apt-get install -y tesseract-ocr tesseract-ocr-kor | ||
| tesseract --version | ||
| make test | ||
| make check-coverage | ||
|
|
||
| changelog: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| runs-on: ubuntu-latest | ||
| runs-on: opensource-linux-8core | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - if: github.ref != 'refs/heads/main' | ||
| uses: dorny/paths-filter@v3 | ||
| id: changes | ||
| with: | ||
| filters: | | ||
| src: | ||
| - 'doc_recipe/**' | ||
| - 'recipe-notebooks/**' | ||
|
|
||
| - if: steps.changes.outputs.src == 'true' && github.ref != 'refs/heads/main' | ||
| uses: dangoslen/changelog-enforcer@v3 | ||
|
|
||
| # TODO - figure out best practice for caching docker images | ||
| # (Using the virtualenv to get pytest) | ||
| test_dockerfile: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| runs-on: ubuntu-latest | ||
| needs: [setup, lint] | ||
| runs-on: opensource-linux-8core | ||
| needs: lint | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: actions/cache@v5 | ||
| id: virtualenv-cache | ||
| - name: Read Python version from .python-version | ||
| run: echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV | ||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Smoke test fails: bare
|
||
| path: | | ||
| .venv | ||
| key: ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/test.txt') }} | ||
| enable-cache: true | ||
| cache-dependency-glob: "uv.lock" | ||
| - name: Set up Python ${{ env.PYTHON_VERSION }} | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
| run: uv python install ${{ env.PYTHON_VERSION }} | ||
| - name: Free up disk space | ||
| run: | | ||
| # Clear some space (https://github.com/actions/runner-images/issues/2840) | ||
| echo "Disk usage before cleanup:" | ||
| df -h | ||
|
|
||
| # Remove unnecessary pre-installed software | ||
| sudo rm -rf /usr/share/dotnet | ||
| sudo rm -rf /opt/ghc | ||
| sudo rm -rf /usr/local/share/boost | ||
| sudo rm -rf /usr/local/lib/android | ||
| sudo rm -rf /opt/hostedtoolcache/CodeQL | ||
| sudo rm -rf /usr/local/.ghcup | ||
| sudo rm -rf /usr/share/swift | ||
|
|
||
| # Clean up docker to ensure we start fresh | ||
| docker system prune -af --volumes | ||
|
|
||
| echo "Disk usage after cleanup:" | ||
| df -h | ||
| - name: Test Dockerfile | ||
| run: | | ||
| python${{ env.PYTHON_VERSION }} -m venv .venv | ||
| source .venv/bin/activate | ||
| make install-test | ||
| uv sync --group test --frozen | ||
| make docker-build | ||
| make docker-test | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| # - name: Scan image | ||
| # uses: anchore/scan-action@v3 | ||
| # with: | ||
| # image: "pipeline-family-${{ env.PIPELINE_FAMILY }}-dev" | ||
| # # NOTE(robinson) - revert this to medium when we bump libreoffice | ||
| # severity-cutoff: critical | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.12 |


Uh oh!
There was an error while loading. Please reload this page.