Skip to content

Commit

Permalink
CI: Use uv and test lowest-direct dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Sep 24, 2024
1 parent 01bad31 commit 5199274
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 35 deletions.
84 changes: 51 additions & 33 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ jobs:

strategy:
matrix:
python-version: ["3.10", "3.12"]
include:
- python-version: "3.10"
resolution: "lowest-direct"
- python-version: 3.12
resolution: "highest"

steps:
- name: Checkout Code
Expand All @@ -30,18 +34,22 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install -e ".[test]"
# Install as an editable so that the coverage path is predicable
run: uv pip install --resolution=${{ matrix.resolution }} -e ".[test]"

- name: Environment Information
shell: bash
run: |
pip list
run: uv pip list

- name: Run Tests
shell: bash
run: |
coverage erase
make test
Expand All @@ -61,7 +69,7 @@ jobs:

strategy:
matrix:
python-version: ["3.11"]
python-version: 3.12
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand All @@ -71,22 +79,24 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Linting & Formatting Packages
shell: bash
run: |
pip install ruff
pip install black
run: uv pip install ruff

- name: Environment Information
shell: bash
run: pip list
run: uv pip list

- name: Check lint with Ruff
shell: bash
- name: Check lint with ruff
run: make lint

- name: Check format with Black
shell: bash
- name: Check format with ruff format
run: make format

typecheck:
Expand All @@ -98,7 +108,7 @@ jobs:

strategy:
matrix:
python-version: [3.11]
python-version: 3.12

steps:
- name: Checkout Code
Expand All @@ -109,17 +119,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install ".[extra, typing]"
run: uv pip install ".[extra, typing]"

- name: Environment Information
shell: bash
run: pip list
run: uv pip list

- name: Run Tests
shell: bash
run: make typecheck

documentation:
Expand All @@ -131,7 +145,7 @@ jobs:

strategy:
matrix:
python-version: ["3.12"]
python-version: 3.12

steps:
- name: Checkout Code
Expand All @@ -142,17 +156,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install a specific version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"

- name: Make uv use system python
run: echo "UV_SYSTEM_PYTHON=true" >> $GITHUB_ENV

- name: Install Packages
shell: bash
run: |
pip install -e ".[doc]"
run: uv pip install -e ".[doc]"

- name: Environment Information
shell: bash
run: pip list
run: uv pip list

- name: Build Documentation
shell: bash
run: |
pushd doc
SPHINXOPTS=-W
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ dist: build
ls -l dist

develop: clean-pyc
pip install -e ".[all]"
uv pip install -e ".[all]"

install: clean
ls -l dist
pip install .
uv pip install .

0 comments on commit 5199274

Please sign in to comment.