Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to UV from PDM #40

Merged
merged 13 commits into from
Nov 22, 2024
22 changes: 10 additions & 12 deletions .github/workflows/llm_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,35 @@ jobs:
with:
ref: ${{ github.event.inputs.BRANCH }}

- name: Install uv
run: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-local-path: "./llm-service/uv.lock"

- name: Set up Python
uses: pdm-project/setup-pdm@v3
with:
python-version: '3.10'
cache: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove?


- name: Cache pdm cache folder
uses: actions/cache@v4
id: python_cache
with:
path: ./llm-service/.venv
key: pdm-venv-${{ hashFiles('./llm-service/pdm.lock') }}

- name: Install Python dependencies
if: steps.python_cache.outputs.cache-hit != 'true'
run: |
pdm install
uv python install
working-directory: llm-service

- name: Run ruff
run: |
pdm run ruff check app
uv run ruff check app
working-directory: llm-service

- name: Run mypy
run: |
pdm run mypy app
uv run mypy app
working-directory: llm-service

- name: Test with pytest
run: |
pdm run pytest -sxvvra
uv run pytest -sxvvra
working-directory: llm-service

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ the Node service locally, you can do so by following these steps:
- Install Python (via [pyenv](https://github.com/pyenv/pyenv), probably) (directly via brew, if you must)
- `cd llm-service`
- Create a virtual environment (`python -m venv venv; source venv/bin/activate`)
- Install dependencies (`python -m pip install -r requirements.txt`)
- Install UV (`python -m pip install uv`)
- Install dependencies (`uv pip install -r pyproject.toml`)
- `fastapi dev`
- ends up running on port 8000

Expand Down