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
13 changes: 13 additions & 0 deletions .github/actions/setup-uv-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: setup-uv-project
description: Install uv and set up the project with its dependencies

runs:
using: composite
steps:
- uses: astral-sh/setup-uv@v6
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uv setups live here, and I've activated the virtual environment by default, so we don't need to prefix commands with uv.

with:
activate-environment: true
enable-cache: true

- shell: bash
run: uv sync --frozen --extra dev
11 changes: 3 additions & 8 deletions .github/workflows/cpu_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
python-version: [ "3.10" ]
python-version: ["3.10"]

steps:
- name: Checkout code
Expand All @@ -29,13 +29,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install dependencies
run: |
uv sync --extra dev
- uses: ./.github/actions/setup-uv-project

- name: Run tests
run: |
uv run pytest -m "cpu and not slow and not high_cpu"
pytest -m "cpu and not slow and not high_cpu"
5 changes: 1 addition & 4 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- uses: ./.github/actions/setup-uv-project

- name: Install dependencies
run: |
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/installation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- uses: ./.github/actions/setup-uv-project

- name: Install dependencies
run: |
uv venv
uv pip install -e .
pip install -e .
15 changes: 3 additions & 12 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v6

- uses: astral-sh/setup-uv@v6
with:
enable-cache: true

- name: Install dependencies
run: |
uv sync --extra dev
- uses: ./.github/actions/setup-uv-project

- name: Run ruff on Pruna code
uses: astral-sh/ruff-action@v3
with:
version: "latest"

- name: Run mypy on Pruna code
run: uv run mypy --show-traceback src/pruna
run: mypy --show-traceback src/pruna

- name: Run docstring checks with pytest
run: uv run pytest -m "style"
run: pytest -m "style"
5 changes: 1 addition & 4 deletions .github/workflows/package_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- uses: ./.github/actions/setup-uv-project

- name: Build
run: |
Expand Down
5,358 changes: 2,675 additions & 2,683 deletions uv.lock

Large diffs are not rendered by default.