mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Fix WSL workflow issues with Python and Poetry setup
This commit is contained in:
14
.github/workflows/py-unit-tests-wsl.yml
vendored
14
.github/workflows/py-unit-tests-wsl.yml
vendored
@@ -37,32 +37,34 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y python3.12 python3.12-venv python3.12-dev
|
||||
|
||||
# Create and activate virtual environment
|
||||
# Create virtual environment
|
||||
python3.12 -m venv ~/.venv
|
||||
source ~/.venv/bin/activate
|
||||
|
||||
# Install poetry
|
||||
source ~/.venv/bin/activate
|
||||
curl -sSL https://install.python-poetry.org | python3 -
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
echo "export PATH=$HOME/.local/bin:$PATH" >> ~/.bashrc
|
||||
|
||||
- name: Install Python dependencies using Poetry
|
||||
shell: wsl-bash {0}
|
||||
run: |
|
||||
source ~/.venv/bin/activate
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
poetry install --without evaluation,llama-index
|
||||
source ~/.bashrc
|
||||
$HOME/.local/bin/poetry install --without evaluation,llama-index
|
||||
|
||||
- name: Build Environment
|
||||
shell: wsl-bash {0}
|
||||
run: |
|
||||
source ~/.venv/bin/activate
|
||||
source ~/.bashrc
|
||||
make build
|
||||
|
||||
- name: Run Tests
|
||||
shell: wsl-bash {0}
|
||||
run: |
|
||||
source ~/.venv/bin/activate
|
||||
poetry run pytest --forked --cov=openhands --cov-report=xml -svv ./tests/unit --ignore=tests/unit/test_memory.py
|
||||
source ~/.bashrc
|
||||
$HOME/.local/bin/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
|
||||
|
||||
Reference in New Issue
Block a user