diff --git a/.github/workflows/cog.yml b/.github/workflows/cog.yml index 95a35399f..e1d9a4cdb 100644 --- a/.github/workflows/cog.yml +++ b/.github/workflows/cog.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1b63d02c9..7e441c055 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 39e7f62d2..9b2818bf4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: | diff --git a/.python-version b/.python-version new file mode 100644 index 000000000..976544ccb --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13.7 diff --git a/Justfile b/Justfile index 033ebdacc..ebe20307a 100644 --- a/Justfile +++ b/Justfile @@ -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 diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..adbf49ddb --- /dev/null +++ b/mise.toml @@ -0,0 +1,3 @@ +[tools] +uv = "0.5.9" +just = "1.42.4"