From 458d78e7a93d414afc8d45bce97e09e7b8e20e75 Mon Sep 17 00:00:00 2001 From: haixuantao Date: Wed, 11 Dec 2024 18:12:41 +0000 Subject: [PATCH] Use UV for the CI/CD for faster dependency resolution --- .github/workflows/node-hub-ci-cd.yml | 6 ++++-- .github/workflows/node_hub_test.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node-hub-ci-cd.yml b/.github/workflows/node-hub-ci-cd.yml index 02977d7b..591d4877 100644 --- a/.github/workflows/node-hub-ci-cd.yml +++ b/.github/workflows/node-hub-ci-cd.yml @@ -81,12 +81,13 @@ jobs: with: python-version: "3.10" - - name: Set up Poetry + - name: Set up UV and poetry if: runner.os == 'Linux' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) run: | curl -sSL https://install.python-poetry.org | python3 - + curl -LsSf https://astral.sh/uv/install.sh | sh echo "$HOME/.local/bin" >> $GITHUB_PATH - pip install ruff pytest + uv pip install ruff pytest - name: Set up Rust if: runner.os == 'Linux' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) @@ -99,6 +100,7 @@ jobs: ## Run Linting and testing only on Mac for release workflows. if: runner.os == 'Linux' || github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/')) run: | + alias pip="uv pip" chmod +x ../../.github/workflows/node_hub_test.sh ../../.github/workflows/node_hub_test.sh diff --git a/.github/workflows/node_hub_test.sh b/.github/workflows/node_hub_test.sh index fa083fdc..71905996 100755 --- a/.github/workflows/node_hub_test.sh +++ b/.github/workflows/node_hub_test.sh @@ -44,7 +44,7 @@ else echo "Running linting and tests for Python project in $dir..." pip install . ruff check . - poetry run pytest + pytest fi fi fi