Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/cog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ jobs:
with:
ref: ${{ github.head_ref }}

- name: Set up Python 3.11
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
pip install -e '.[test]'
pip install -r docs/requirements.txt
uv sync --extra test
uv pip install -r docs/requirements.txt

- name: Run cog
run: |
cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/**/*.md docs/*.md README.md
uv run cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/**/*.md docs/*.md README.md

- name: Check for changes
id: check-changes
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install dependencies
run: |
pip install '.[test]'
uv sync --extra test
- name: Run tests
run: |
pytest
uv run pytest
deploy:
runs-on: ubuntu-latest
environment: release
Expand All @@ -37,15 +37,10 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: pip
cache-dependency-path: setup.py
- name: Install dependencies
run: |
pip install setuptools wheel build
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Build
run: |
python -m build
uv build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
20 changes: 11 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,37 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
pip install -e '.[test]'
uv sync --extra test
uv pip install -r docs/requirements.txt
- name: Run tests
run: |
python -m pytest -vv
uv run python -m pytest -vv
- name: Check if cog needs to be run
if: matrix.os != 'windows-latest'
run: |
cog --check \
uv run cog --check \
-p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" \
docs/**/*.md docs/*.md
- name: Run Black
if: matrix.os != 'windows-latest'
run: |
black --check .
uv run black --check .
- name: Run mypy
if: matrix.os != 'windows-latest'
run: |
mypy llm
uv run mypy llm
- name: Run ruff
if: matrix.os != 'windows-latest'
run: |
ruff check .
uv run ruff check .
- name: Check it builds
run: |
python -m build
uv build
- name: Run test-llm-load-plugins.sh
if: matrix.os != 'windows-latest'
run: |
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13.7
25 changes: 13 additions & 12 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,48 @@

# Install dependencies and test dependencies
@init:
pipenv run pip install -e '.[test]'
uv sync --extra test
uv pip install -r docs/requirements.txt

# Run pytest with supplied options
@test *options:
pipenv run pytest {{options}}
uv run pytest {{options}}

# Run linters
@lint:
echo "Linters..."
echo " Black"
pipenv run black . --check
uv run black . --check
echo " cog"
pipenv run cog --check \
uv run cog --check \
-p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" \
README.md docs/*.md
echo " mypy"
pipenv run mypy llm
uv run mypy llm
echo " ruff"
pipenv run ruff check .
uv run ruff check .

# Run mypy
@mypy:
pipenv run mypy llm
uv run mypy llm

# Rebuild docs with cog
@cog:
pipenv run cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/**/*.md docs/*.md README.md
uv run cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/**/*.md docs/*.md README.md

# Serve live docs on localhost:8000
@docs: cog
rm -rf docs/_build
cd docs && pipenv run make livehtml
cd docs && uv run make livehtml

# Apply Black
@black:
pipenv run black .
uv run black .

# Run automatic fixes
@fix: cog
pipenv run ruff check . --fix
pipenv run black .
uv run ruff check . --fix
uv run black .

# Push commit if tests pass
@push: test lint
Expand Down
3 changes: 3 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tools]
uv = "0.5.9"
just = "1.42.4"