From b13ac3955eb7e30ec1afd790c54ddaf3e924ccdd Mon Sep 17 00:00:00 2001 From: rht Date: Thu, 15 Feb 2024 20:43:14 -0500 Subject: [PATCH] ci: Use uv pip for faster build --- .github/workflows/build_lint.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_lint.yml b/.github/workflows/build_lint.yml index c1dcedb83d5..5145657317b 100644 --- a/.github/workflows/build_lint.yml +++ b/.github/workflows/build_lint.yml @@ -60,6 +60,10 @@ jobs: with: path: ${{ env.pythonLocation }} key: ${{ runner.os }}-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} + # Workaround; remove once https://github.com/astral-sh/uv/issues/1386 is fixed + - run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV + - name: Install uv + run: pip install uv - name: Install dependencies # Only if the cache misses # Based on https://github.com/pypa/pip/issues/8049#issuecomment-633845028 @@ -67,11 +71,13 @@ jobs: # https://github.com/pypa/pip/issues/11440 is resolved. if: steps.cache.outputs.cache-hit != 'true' run: | - pip install toml + rm -fr ${Python_ROOT_DIR}/lib/python${{ matrix.python-version}}/site-packages/pip-23.0.1.dist-info + rm -fr ${Python_ROOT_DIR}/lib/python${{ matrix.python-version}}/site-packages/pip-23.3.1.dist-info + uv pip install toml python tests/read_requirements.py > requirements.txt - pip install -r requirements.txt + uv pip install -r requirements.txt - name: Install Mesa - run: pip install --no-deps . + run: uv pip install --no-deps "mesa @ ." - name: Test with pytest run: pytest --durations=10 --cov=mesa tests/ --cov-report=xml - if: matrix.os == 'ubuntu' @@ -90,6 +96,10 @@ jobs: with: path: ${{ env.pythonLocation }} key: test-examples-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} + # Workaround; remove once https://github.com/astral-sh/uv/issues/1386 is fixed + - run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV + - name: Install uv + run: pip install uv - name: Install dependencies # Only if the cache misses # Based on https://github.com/pypa/pip/issues/8049#issuecomment-633845028 @@ -97,11 +107,13 @@ jobs: # https://github.com/pypa/pip/issues/11440 is resolved. if: steps.cache.outputs.cache-hit != 'true' run: | - pip install toml + rm -fr ${Python_ROOT_DIR}/lib/python${{ matrix.python-version}}/site-packages/pip-23.0.1.dist-info + rm -fr ${Python_ROOT_DIR}/lib/python${{ matrix.python-version}}/site-packages/pip-23.3.1.dist-info + uv pip install toml python tests/read_requirements.py > requirements.txt - pip install -r requirements.txt + uv pip install -r requirements.txt - name: Install Mesa - run: pip install --no-deps . + run: uv pip install --no-deps "mesa @ ." - name: Checkout mesa-examples uses: actions/checkout@v4 with: