Skip to content

Commit

Permalink
migrate environment installs to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnv1 committed Mar 11, 2024
1 parent 3ae3c00 commit f8e904c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
12 changes: 8 additions & 4 deletions .github/actions/env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,28 @@ runs:
with:
python-version: ${{ inputs.python-version }}

- name: Install UV
shell: bash
run: pip install uv

- if: ${{ contains(fromJson('["nightly"]'), inputs.pytorch-version ) }}
name: Install PyTorch nightly
shell: bash
run: pip install numpy --pre torch[dynamo] ${{ inputs.extra-deps }} --force-reinstall --extra-index-url https://download.pytorch.org/whl/nightly/cpu/
run: uv pip install --system numpy --pre torch[dynamo] ${{ inputs.extra-deps }} --force-reinstall --extra-index-url https://download.pytorch.org/whl/nightly/cpu/

- if: ${{ contains(fromJson('["nightly"]'), inputs.pytorch-version ) == false}}
name: Install pytorch
shell: bash
run: pip install torch==${{ inputs.pytorch-version }} ${{ inputs.extra-deps }} --index-url https://download.pytorch.org/whl/cpu
run: uv pip install --system torch==${{ inputs.pytorch-version }} ${{ inputs.extra-deps }} --index-url https://download.pytorch.org/whl/cpu

- if: ${{ contains(fromJson('["1.9.1"]'), inputs.pytorch-version) }}
name: Install accelerate for old torchs
shell: bash
run: pip install accelerate==0.20.3
run: uv pip install --system accelerate==0.20.3

- name: Install Kornia dev
shell: bash
run: pip install .[dev,x]
run: uv pip install --system --editable .[dev,x]

- name: Check torch version
shell: bash
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ jobs:
with:
python-version: ${{ inputs.python-version }}

- name: Install UV
shell: bash
run: pip install uv

- name: Install dev dependencies
shell: bash
run: pip install -r ./requirements/requirements-dev.txt
run: uv pip install --system -r ./requirements/requirements-dev.txt

- name: Run coverage
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

- name: Install docs deps
shell: bash -l {0}
run: pip install -e .[docs]
run: uv pip install --system --editable .[docs]

- name: Build Documentation
shell: bash -l {0}
Expand Down

0 comments on commit f8e904c

Please sign in to comment.