Skip to content

Commit 0a08ffb

Browse files
Many Updates (#17)
* replace poetry with uv, remove docs * fix type check job * update liquid * fix typos job * anthropic llm provider * fix typing errors
1 parent 35db7a1 commit 0a08ffb

File tree

23 files changed

+2788
-4376
lines changed

23 files changed

+2788
-4376
lines changed

.github/copilot-instructions.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Python Rules
2+
- The user is using Python version >= 3.11 with uv as the Python package and project manager.
3+
- Follow the Google Python Style Guide.
4+
- Instead of importing `Optional` from typing, using the `| `syntax.
5+
- Always add appropriate type hintssuch that the code would pass a mypy type check.
6+
- For type hints, use `list`, not `List`. For example, if the variable is `[{"name": "Jane", "age": 32}, {"name": "Amy", "age": 28}]` the type hint should be `list[dict]`
7+
- If the user is using Pydantic, it is version >=2.10
8+
- Always prefer pathlib for dealing with files. Use `Path.open` instead of `open`.
9+
- Prefer to use pendulum instead of datetime
10+
- Prefer to use loguru instead of logging

.github/workflows/pages.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/python.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,65 @@ on:
88
branches: ["main"]
99

1010
env:
11-
POETRY_VERSION: "2.0.1"
11+
UV_VERSION: "0.6.9"
1212
PYTHON_VERSION: "3.12"
1313

1414
jobs:
1515
test:
1616
runs-on: ubuntu-24.04
1717
strategy:
1818
matrix:
19-
python-version: ["3.11", "3.12" ]
19+
python-version: [ "3.11", "3.12" ]
2020
steps:
2121
- uses: actions/checkout@v4
22-
- name: Install poetry
23-
run: pipx install poetry==${POETRY_VERSION}
24-
- name: Install poetry-plugin-export
25-
run: pipx inject poetry poetry-plugin-export
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v5
24+
# Caching is enabled by default for GitHub-hosted runners:
25+
# https://github.com/astral-sh/setup-uv?tab=readme-ov-file#enable-caching
26+
with:
27+
version: ${{ env.UV_VERSION }}
2628
- name: Set up Python ${{ matrix.python-version }}
2729
uses: actions/setup-python@v5
2830
with:
2931
python-version: ${{ matrix.python-version }}
30-
cache: poetry
3132
- name: Install Nox
32-
run: poetry sync --only nox
33+
run: uv sync --locked --all-extras
3334
- name: Test with Nox
3435
env:
3536
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
3637
OPENAI_ORG_ID: ${{ secrets.OPENAI_ORG_ID }}
37-
SKIP_TESTS_NAAI: "tests/llm tests/data"
38-
run: poetry run nox -s test-${{ matrix.python-version }}
38+
SKIP_TESTS_NAAI: "tests/llm/chat_completion tests/llm/embedding tests/data"
39+
run: uv run nox -s test-${{ matrix.python-version }}
3940
quality:
4041
runs-on: ubuntu-24.04
4142
strategy:
4243
matrix:
43-
job:
44-
- { nox-session: lint, poetry-groups: "lint" }
45-
# type_check needs main and test dependencies for inline type annotations.
46-
- { nox-session: type_check, poetry-groups: "type_check,main,test" }
47-
- { nox-session: docs, poetry-groups: "docs" }
44+
nox-session: ["lint", "type_check", "typos"]
4845
steps:
4946
- uses: actions/checkout@v4
50-
- name: Install poetry
51-
run: pipx install poetry==${POETRY_VERSION}
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v5
49+
with:
50+
version: ${{ env.UV_VERSION }}
5251
- name: Set up Python
5352
uses: actions/setup-python@v5
5453
with:
5554
python-version: ${{ env.PYTHON_VERSION }}
56-
cache: poetry
57-
- name: Install Nox and group dependencies
58-
run: poetry sync --all-extras
55+
- name: Install dependencies
56+
run: uv sync --locked --all-extras
5957
- name: Test with Nox
60-
run: poetry run nox -s ${{ matrix.job.nox-session }}
61-
poetry-check:
58+
run: uv run nox -s ${{ matrix.nox-session }}
59+
lock-check:
6260
runs-on: ubuntu-24.04
6361
steps:
6462
- uses: actions/checkout@v4
65-
- name: Install poetry
66-
run: pipx install poetry==${POETRY_VERSION}
63+
- name: Install uv
64+
uses: astral-sh/setup-uv@v5
65+
with:
66+
version: ${{ env.UV_VERSION }}
6767
- name: Set up Python
6868
uses: actions/setup-python@v5
6969
with:
7070
python-version: ${{ env.PYTHON_VERSION }}
71-
- name: Validate Poetry Configuration
72-
run: poetry check --lock --strict
71+
- name: Validate Lockfile Up-to-date
72+
run: uv lock --check

.github/workflows/typos.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"ruff.lint.args": [
3-
"--config=./pyproject.toml"
4-
],
2+
"ruff.configuration": "./pyproject.toml",
53
"notebook.formatOnSave.enabled": true,
64
"notebook.codeActionsOnSave": {
75
"notebook.source.fixAll": "explicit",

0 commit comments

Comments
 (0)