Browse Source

Replace poetry with uv in CI/CD

tags/v0.3.9-rc1
haixuantao 1 year ago
parent
commit
6f2656eb49
2 changed files with 11 additions and 12 deletions
  1. +9
    -10
      .github/workflows/node-hub-ci-cd.yml
  2. +2
    -2
      .github/workflows/node_hub_test.sh

+ 9
- 10
.github/workflows/node-hub-ci-cd.yml View File

@@ -81,10 +81,9 @@ jobs:
with:
python-version: "3.10"

- name: Set up UV and poetry
- name: Set up UV
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
uv pip install ruff pytest
@@ -100,7 +99,6 @@ 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

@@ -141,9 +139,9 @@ jobs:
with:
python-version: "3.10"

- name: Set up Poetry
- name: Set up UV
run: |
curl -sSL https://install.python-poetry.org | python3 -
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Set up Rust
@@ -154,7 +152,7 @@ jobs:
- name: Publish Projects
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASS }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_PASS }}
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASS }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
dir=$(pwd)
@@ -167,7 +165,7 @@ jobs:
if [[ -f "Cargo.toml" && -f "pyproject.toml" ]]; then
echo "Publishing $dir using maturin..."
if [[ "${{ runner.os }}" == "Linux" ]]; then
pip3 install "maturin[zig]"
uv pip install "maturin[zig]"
## The CI/CD is sequential to limit the number of workers used.
@@ -183,13 +181,14 @@ jobs:
maturin publish --target armv7-unknown-linux-musleabihf --zig --skip-existing

else
pip3 install maturin
uv pip install maturin
maturin publish --skip-existing
fi
else
if [ -f "pyproject.toml" ]; then
echo "Publishing $dir using Poetry..."
poetry publish --build --skip-existing
echo "Publishing $dir using UV..."
uv build
uv publish
fi

if [ -f "Cargo.toml" ]; then


+ 2
- 2
.github/workflows/node_hub_test.sh View File

@@ -22,7 +22,7 @@ else
cargo build
cargo test

pip3 install "maturin[zig]"
uv pip install "maturin[zig]"
maturin build --zig
# aarch64-unknown-linux-gnu
@@ -42,7 +42,7 @@ else
else
if [ -f "$dir/pyproject.toml" ]; then
echo "Running linting and tests for Python project in $dir..."
pip install .
uv pip install .
ruff check .
pytest
fi


Loading…
Cancel
Save