From d39234c94407c8a51948041793a6d2f2b7a67434 Mon Sep 17 00:00:00 2001 From: Ayala Shachar Date: Fri, 11 Oct 2024 11:32:58 +0300 Subject: [PATCH] Use UV instead of pip --- .github/workflows/main.yml | 16 +++++++++++----- Makefile | 15 ++++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 84de9e65..95f295f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,13 +13,19 @@ jobs: strategy: matrix: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + env: + UV_PYTHON: ${{ matrix.python-version }} steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} + - name: Checkout the repository + uses: actions/checkout@main + - name: Install the default version of uv + id: setup-uv + uses: astral-sh/setup-uv@v3 + - name: Print the installed version + run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" + - name: Install Python ${{ matrix.python-version }} + run: uv python install ${{ matrix.python-version }} - name: Install dependencies run: make env - name: Lint with pylint diff --git a/Makefile b/Makefile index 9a93ad95..3298c796 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,16 @@ default: test test: env - .env/bin/pytest --cov=slash --cov-report=html tests + .venv/bin/pytest --cov=slash --cov-report=html tests pylint: env - .env/bin/pylint -j 4 --rcfile=.pylintrc slash tests doc + .venv/bin/pylint -j 4 --rcfile=.pylintrc slash tests doc -env: .env/.up-to-date - -.env/.up-to-date: Makefile pyproject.toml - python -m venv .env - .env/bin/pip install -e .[testing,doc] - touch .env/.up-to-date +env: + uv venv --seed + uv pip install -e ".[testing,doc]" doc: env - .env/bin/sphinx-build -a -W -E doc build/sphinx/html + .venv/bin/sphinx-build -a -W -E doc build/sphinx/html .PHONY: doc