From a28c0b551448f5803317b43e5bfeecbf2f63551e Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Wed, 2 Oct 2024 00:13:57 +0100 Subject: [PATCH] Use official `setup-uv` and `uv sync/run` in CI --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13940c134..f85e8e7f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,21 +26,21 @@ jobs: with: python-version: "3.10" - - name: Set up uv (latest) - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - name: Set up uv + uses: astral-sh/setup-uv@v3 + with: + version: "0.4.x" + enable-cache: true - name: Install dependencies working-directory: ./pydatalab run: | - uv venv - uv pip install -r requirements/requirements-all-dev.txt - uv pip install -e '.[all, dev]' + uv sync --all-extras - name: Run pre-commit working-directory: ./pydatalab run: | - source .venv/bin/activate - pre-commit run --all-files --show-diff-on-failure + uv run pre-commit run --all-files --show-diff-on-failure pytest: name: Run Python unit tests @@ -74,21 +74,21 @@ jobs: run: | wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.9.0.deb && sudo apt install ./mongodb-database-tools-*-100.9.0.deb - - name: Set up uv (latest) - run: curl -LsSf https://astral.sh/uv/install.sh | sh + - name: Set up uv + uses: astral-sh/setup-uv@v3 + with: + version: "0.4.x" + enable-cache: true - name: Install locked versions of dependencies working-directory: ./pydatalab run: | - uv venv - uv pip install -r requirements/requirements-all-dev.txt - uv pip install -e '.[all, dev]' + uv sync --all-extras - name: Run all tests working-directory: ./pydatalab run: | - source .venv/bin/activate - pytest -rs -vvv --cov-report=term --cov-report=xml --cov ./pydatalab ./tests + uv run pytest -rs -vvv --cov-report=term --cov-report=xml --cov ./pydatalab ./tests - name: Upload coverage to Codecov if: matrix.python-version == '3.10' && github.repository == 'datalab-org/datalab'