Skip to content

Commit

Permalink
fix(ci): use uv for ci deps installing
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrgredowski committed Sep 19, 2024
1 parent d953762 commit 405e67b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 42 deletions.
32 changes: 14 additions & 18 deletions .github/actions/setup-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ description: Setup Python and pre-commit for CI
runs:
using: composite
steps:
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: |
requirements.lock
requirements-dev.lock
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install -r requirements.lock -r requirements-dev.lock
- name: Cache pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true

- name: Set up Python
shell: bash
run: uv python install

- name: Install the project
shell: bash
run: uv sync --all-extras --dev
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: ./.github/actions/setup-ci
- name: Pre-commit
run: |
SKIP=unittests pre-commit run --all-files --color=always
SKIP=unittests uv run pre-commit run --all-files --color=always
unittests:
runs-on: ubuntu-latest
steps:
Expand All @@ -29,4 +29,4 @@ jobs:
uses: ./.github/actions/setup-ci
- name: Test with pytest
run: |
python -m pytest .
uv run python -m pytest . -n auto
23 changes: 3 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,14 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.280
rev: v0.6.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
hooks:
- id: mypy
args: [--ignore-missing-imports, --follow-imports=skip]

- repo: local
hooks:
- id: unittests
name: run unit tests
entry: pytest
language: system
pass_filenames: false
always_run: true
args: [
--doctest-modules
]
4 changes: 2 additions & 2 deletions src/profiling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install pip --upgrade
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/MacOS
pip install pyinstrument snakeviz
```

Expand Down

0 comments on commit 405e67b

Please sign in to comment.