Skip to content

Commit

Permalink
ci: Use uv pip for faster build
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Feb 16, 2024
1 parent ac9fdd1 commit fe7a5f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/build_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,23 @@ 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
# read_requirements.py should be removed once
# https://github.com/pypa/pip/issues/11440 is resolved.
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install toml
pip uninstall pip
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'
Expand All @@ -90,18 +95,23 @@ 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
# read_requirements.py should be removed once
# https://github.com/pypa/pip/issues/11440 is resolved.
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install toml
pip uninstall pip
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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
build-backend = "hatchling.ouroboros"

[project]
name = "Mesa"
Expand Down

0 comments on commit fe7a5f2

Please sign in to comment.