Skip to content

Commit

Permalink
ci: use uv in place of pip to speed up installing dependencies
Browse files Browse the repository at this point in the history
uv cuts down time needed to install dependencies from ~2m to ~37s.
Moreover, once the runner/environment is cached, it's like instant.

Drops python3.6 from CI, uv pip doesn't seem support python3.6 as CI
job fails.
  • Loading branch information
wookayin committed Jan 23, 2025
1 parent 116d087 commit df7a562
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ defaults:
run:
shell: bash

env:
# https://docs.astral.sh/uv/guides/integration/github/#using-uv-pip
UV_SYSTEM_PYTHON: 1

jobs:
unit-tests:
name: "Unit Tests"
Expand All @@ -14,8 +18,6 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
python-version: "3.6"
- os: ubuntu-20.04
python-version: "3.7"
- os: ubuntu-latest
Expand All @@ -37,20 +39,17 @@ jobs:

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: |
python -m pip install -U pip
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Configure environments
run: |
python --version
- name: Install dependencies
run: |
pip install -e ".[test]"
uv pip install -e ".[test]"
python -m imgcat --version
- name: Run tests
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def read_version():

tests_requires = [
'pytest',
'numpy',
'torch',
'tensorflow>=2.0',
'numpy>=1.21,<2.0',
'torch>=2.0,<3.0; python_version >= "3.8"',
'tensorflow>=2.0,<3.0; python_version >= "3.8"',
'matplotlib>=3.3',
'Pillow',
]
Expand Down

0 comments on commit df7a562

Please sign in to comment.