Skip to content

Commit

Permalink
Fix WSL workflow setup and Python configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Nov 12, 2024
1 parent d7fbb29 commit e7aa419
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/py-unit-tests-wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,34 @@ jobs:
with:
distribution: Ubuntu-22.04
update: true
- name: Install poetry via pipx in WSL
shell: wsl-bash {0}
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Set up Python in WSL
- name: Set up Python and Poetry in WSL
shell: wsl-bash {0}
run: |
sudo apt-get update
sudo apt-get install -y python${{ matrix.python-version }}
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python${{ matrix.python-version }} python${{ matrix.python-version }}-venv python3-pip
python${{ matrix.python-version }} -m pip install --user pipx
python${{ matrix.python-version }} -m pipx ensurepath
export PATH="$HOME/.local/bin:$PATH"
pipx install poetry
- name: Install Python dependencies using Poetry
shell: wsl-bash {0}
run: |
export PATH="$HOME/.local/bin:$PATH"
poetry env use python${{ matrix.python-version }}
poetry install --without evaluation,llama-index
- name: Build Environment
shell: wsl-bash {0}
run: make build
run: |
export PATH="$HOME/.local/bin:$PATH"
make build
- name: Run Tests
shell: wsl-bash {0}
run: poetry run pytest --forked --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py
run: |
export PATH="$HOME/.local/bin:$PATH"
poetry run pytest --forked --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
Expand Down

0 comments on commit e7aa419

Please sign in to comment.