Skip to content

Commit

Permalink
TST: migrate to official astral-sh/setup-uv action
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Sep 8, 2024
1 parent 759855d commit 4cd2b82
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 51 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/bleeding-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' }}
Expand Down
37 changes: 18 additions & 19 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
.venv/Scripts/activate
pytest --color yes -ra
36 changes: 9 additions & 27 deletions .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -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:
Expand All @@ -70,28 +69,11 @@ 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
- 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
- name: Build
shell: bash
run: uv pip install --no-build-isolation .
- name: run check-manifest
run: check-manifest -vvv
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: uvx --with . check-manifest

deploy:
name: Publish to PyPI
Expand Down

0 comments on commit 4cd2b82

Please sign in to comment.