From f8e904c1eb64f9d86c7869d34fe31b0923a289d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Gustavo=20A=2E=20Amorim?= Date: Mon, 11 Mar 2024 18:30:40 -0300 Subject: [PATCH] migrate environment installs to uv https://github.com/astral-sh/uv --- .github/actions/env/action.yml | 12 ++++++++---- .github/workflows/coverage.yml | 6 +++++- .github/workflows/docs.yml | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/actions/env/action.yml b/.github/actions/env/action.yml index 7a70727..bfa9aa5 100644 --- a/.github/actions/env/action.yml +++ b/.github/actions/env/action.yml @@ -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 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8cd23dd..6dd504d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -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: | diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b359674..cc35a00 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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}