Skip to content

refactor: updated how to install poetry #26

refactor: updated how to install poetry

refactor: updated how to install poetry #26

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
paths:
- "chatbot/**"
- "tests/**"
- ".github/workflows/**"
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
paths:
- "chatbot/**"
- "tests/**"
- ".github/workflows/**"
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get poetry version
id: poetry-version
run: echo "poetry-version=$(cat poetry_version)" >> "$GITHUB_OUTPUT"
- name: Install poetry
uses: snok/install-poetry@v1
with:
version: ${{ steps.poetry-version.outputs.poetry-version }}
virtualenvs-in-project: true
# Installing torch (CPU) and sentence-transformers with pip to avoid poetry's issues in installing torch.
# Installing llama-cpp-python without NVIDIA CUDA acceleration.
- name: Setup environment
run: |
poetry lock --check
poetry install --no-root --no-ansi
. .venv/bin/activate && pip3 install torch~=2.1.2 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
. .venv/bin/activate && pip3 install sentence-transformers~=2.2.2
. .venv/bin/activate && pip3 install llama-cpp-python~=0.2.23
- name: Run tests
run: |
poetry run python -m pytest --durations=5 --log-cli-level=DEBUG --capture=tee-sys -v