From 194560c62199e6e8d0105822151a2be58a63268a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Sun, 8 Sep 2024 17:21:17 +0200 Subject: [PATCH] TST: migrate to official astral-sh/setup-uv action --- .github/workflows/bleeding-edge.yaml | 12 +++++---- .github/workflows/build-test.yaml | 37 ++++++++++++++-------------- .github/workflows/wheels.yaml | 36 ++++++++++----------------- 3 files changed, 38 insertions(+), 47 deletions(-) diff --git a/.github/workflows/bleeding-edge.yaml b/.github/workflows/bleeding-edge.yaml index 0040ea4..bb86ea8 100644 --- a/.github/workflows/bleeding-edge.yaml +++ b/.github/workflows/bleeding-edge.yaml @@ -30,13 +30,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: 3.13-dev - - uses: yezz123/setup-uv@v4 + - uses: astral-sh/setup-uv@v2 with: - uv-version: 0.2.33 - uv-venv: .venv + enable-cache: true + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Install dependencies run: | + uv venv uv pip install --upgrade setuptools wheel uv pip install --pre --no-build numpy \ --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple @@ -48,13 +49,14 @@ jobs: # to use the dev version of numpy at build time. run: | uv pip install -e . --no-build-isolation - uv pip install --upgrade --pre pytest + uv pip install --pre pytest - run: uv pip list - name: Run Tests run: | - pytest -vvv --color=yes + source .venv/bin/activate + pytest --color=yes -ra create-issue: if: ${{ failure() && github.event_name == 'schedule' }} diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index f20602e..e5aa88d 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -37,32 +37,31 @@ jobs: python-version: '3.12' - os: ubuntu-20.04 python-version: '3.9' - deps: minimal + install-args: --resolution=lowest-direct runs-on: ${{ matrix.os }} steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - uses: astral-sh/setup-uv@v2 with: - python-version: ${{ matrix.python-version }} - - uses: yezz123/setup-uv@v4 - with: - uv-version: 0.2.33 - uv-venv: .venv - - - run: uv pip install --requirement test_requirements.txt - - - if: matrix.deps == 'minimal' - run: | - uv pip compile pyproject.toml --resolution=lowest-direct | uv pip install -r - + enable-cache: true + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build - run: uv pip install --editable "." - + run: | + uv venv --python ${{ matrix.python-version }} + uv pip install --editable "." ${{ matrix.install-args }} + - run: uv pip install --requirement test_requirements.txt - run: uv pip list - - - name: Run Tests - run: pytest --color=yes + - name: Run test suite (UNIX) + if: matrix.os != 'windows-latest' + run: | + source .venv/bin/activate + pytest --color yes -ra + - name: Run test suite (Windows) + if: matrix.os == 'windows-latest' + run: | + source .venv/Scripts/activate + pytest --color yes -ra diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index 30e9a4a..2d37d1b 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -29,10 +29,10 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - - uses: yezz123/setup-uv@v4 + - uses: astral-sh/setup-uv@v2 with: - uv-version: 0.2.33 - uv-venv: .venv + enable-cache: true + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Build wheels for CPython uses: pypa/cibuildwheel@v2.20.0 @@ -54,10 +54,9 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - + - uses: astral-sh/setup-uv@v2 - name: Build sdist - run: pipx run build --sdist - + run: uv build --sdist - name: Upload sdist uses: actions/upload-artifact@v4 with: @@ -70,28 +69,19 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.x - - uses: yezz123/setup-uv@v4 + - uses: astral-sh/setup-uv@v2 with: - uv-version: 0.2.33 - uv-venv: .venv - - name: install check-manifest - run: uv pip install check-manifest + enable-cache: true + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Install build time dependencies - shell: bash run: | - uv pip install "Cython>=3.0" - uv pip install numpy>=2.0.0 - uv pip install --upgrade wheel - uv pip install --upgrade setuptools + uv venv + uv pip install 'Cython>=3.0' 'numpy>=2.0.0' setuptools wheel check-manifest - name: Build - shell: bash run: uv pip install --no-build-isolation . - - name: run check-manifest - run: check-manifest -vvv + - run: | + source .venv/bin/activate + python -m check-manifest deploy: name: Publish to PyPI