Skip to content

Commit

Permalink
Use uv instead of pip in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Jul 25, 2024
1 parent 358267b commit 53df674
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,36 @@ name: Lint

on: [pull_request]

env:
UV_SYSTEM_PYTHON: 1

jobs:
lint:
name: Linting through pre-commit
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: ${{ matrix.python-version }}

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-uv

- name: Install semeio with style deps
run: pip install ".[style]"
run: |
uv pip install ".[style]"
uv cache prune --ci
- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure
14 changes: 13 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

env:
ERT_SHOW_BACKTRACE: 1
UV_SYSTEM_PYTHON: 1

jobs:
tests:
Expand Down Expand Up @@ -36,8 +37,19 @@ jobs:
with:
python-version: "${{ matrix.python-version }}"

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-uv

- name: Install test dependencies
run: pip install ".[test]"
run: |
uv pip install ".[test]"
uv cache prune --ci
- name: "Run tests"
run: pytest tests -n logical --durations 5 --ert-integration
16 changes: 15 additions & 1 deletion .github/workflows/typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- 'version-**'
pull_request:

env:
UV_SYSTEM_PYTHON: 1

jobs:
type-checking:
runs-on: ubuntu-latest
Expand All @@ -24,9 +27,20 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: ${{ runner.os }}-python-${{ matrix.python-version }}-uv

- name: Install semeio and dependencies
run: |
pip install ".[types]"
uv pip install ".[types]"
uv cache prune --ci
- name: Run mypy
run: |
mypy src/semeio

0 comments on commit 53df674

Please sign in to comment.