diff --git a/.github/actions/setup-ci/action.yml b/.github/actions/setup-ci/action.yml index 2d68faf..307273c 100644 --- a/.github/actions/setup-ci/action.yml +++ b/.github/actions/setup-ci/action.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d19b29..4fe7530 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5c4464b..c40837a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 - ] diff --git a/src/profiling/README.md b/src/profiling/README.md index dbe6ae4..1883ba1 100644 --- a/src/profiling/README.md +++ b/src/profiling/README.md @@ -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 ```