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 2676539
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 47 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: |
source .venv/Scripts/activate
pytest --color yes -ra
34 changes: 11 additions & 23 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,17 @@ 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: check-manifest

deploy:
name: Publish to PyPI
Expand Down

0 comments on commit 2676539

Please sign in to comment.