Skip to content

Commit

Permalink
Use uv for CI (#311)
Browse files Browse the repository at this point in the history
* start using uv

* update release workflow

* update docs workflows

* decrease root-reserve-mb

* use uv throughout

* do not use uv for densepose install

* increase allocated space

* install pip

* try again to fix space issue

* use no-build-isolation to install densepose

* test adding flit-core

* specify detectron2 separately

* only use lint reqs for code quality

* simplify test install; comment out tests temporarily

* comment out less

* run test install without prereq

* make workflow valid

* revert install wheel and source sections to use pip

* uncomment all
  • Loading branch information
ejm714 authored Mar 12, 2024
1 parent dc87a8a commit de0df1e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 42 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/docs-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev/docs.txt
uv pip install -r requirements-dev/docs.txt
- name: Build documentation
run: |
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev/docs.txt
uv pip install -r requirements-dev/docs.txt
- name: Build documentation
run: |
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ jobs:
remove-dotnet: true
remove-android: true

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev/docs.txt
pip install -e .
uv pip install -r requirements-dev/docs.txt
uv pip install -e .
- name: Check that versions match
id: version
Expand Down
38 changes: 14 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: requirements-dev/lint.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev/lint.txt
uv pip install -r requirements-dev/lint.txt
- name: Lint package
run: |
Expand All @@ -51,13 +48,13 @@ jobs:
name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 35000 # for pip packages in /tmp
root-reserve-mb: 32000 # for pip packages in /tmp
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true

- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup FFmpeg
uses: Iamshankhadeep/[email protected]
Expand All @@ -70,17 +67,14 @@ jobs:
- name: Configure Windows compilers
uses: ilammy/msvc-dev-cmd@v1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
uv pip install -e .[tests]
- name: Run tests
run: |
Expand All @@ -90,8 +84,9 @@ jobs:
env:
ZAMBA_RUN_DENSEPOSE_TESTS: 1
run: |
uv pip install flit-core
# torch is alread installed, so just add the densepose extra
pip install -e .[tests,densepose]
uv pip install -e .[densepose] --no-build-isolation
make densepose-tests
- name: Upload coverage to codecov
Expand Down Expand Up @@ -128,19 +123,14 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
version: "4.4"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Set up Python and uv
uses: drivendataorg/setup-python-uv-action@v1
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip

- name: Build package
run: |
uv pip install build
make dist
- name: Install wheel; test CLI + models with assets
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ tests = [
]
densepose = [
"torch<2.1.0", # densepose broken after 2.1.0; https://github.com/facebookresearch/detectron2/issues/5110
"detectron2 @ git+https://github.com/facebookresearch/detectron2.git",
"detectron2-densepose @ git+https://github.com/facebookresearch/detectron2@main#subdirectory=projects/DensePose"
]

Expand Down

0 comments on commit de0df1e

Please sign in to comment.