Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use uv for CI #311

Merged
merged 19 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/setup-ffmpeg@v1.1
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
Loading