Skip to content

Fix broken tests. Drop python 3.8. #580

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

Merged
merged 3 commits into from
Oct 27, 2024
Merged

Fix broken tests. Drop python 3.8. #580

merged 3 commits into from
Oct 27, 2024

Conversation

rectalogic
Copy link
Contributor

A number of tests are failing on main, apparently because tests always use the latest version of every dependency (no Pipfile.lock) and e.g. pytest_httpx has breaking changes.

Also pytest_httpx now requires python>=3.9 so I dropped 3.8 support.

What do you think about switching from setup.py to isolated builds using uv and checking in a uv.lock so tests don't fail over time?

=========================== short test summary info ============================
FAILED tests/test_keys.py::test_uses_correct_key - assert 1 == 0
FAILED tests/test_templates.py::test_template_basic[boo-extra_args3-None-None-Error: Cannot use -t/--template and --system together] - TypeError: HTTPXMock.reset() got an unexpected keyword argument 'assert_all...
FAILED tests/test_templates.py::test_template_basic[prompt: 'Say $hello'-extra_args4-None-None-Error: Missing variables: hello] - TypeError: HTTPXMock.reset() got an unexpected keyword argument 'assert_all...
ERROR tests/test_keys.py::test_uses_correct_key - AssertionError: The following requests were not expected:
ERROR tests/test_templates.py::test_template_basic[boo-extra_args3-None-None-Error: Cannot use -t/--template and --system together] - AssertionError: The following responses are mocked but not requested:
ERROR tests/test_templates.py::test_template_basic[prompt: 'Say $hello'-extra_args4-None-None-Error: Missing variables: hello] - AssertionError: The following responses are mocked but not requested:
============ 3 failed, 181 passed, 638 warnings, 3 errors in 3.23s =============
error: Recipe `test` failed on line 10 with exit code 1

rectalogic added a commit to rectalogic/llm that referenced this pull request Oct 10, 2024
* add register_tools hookspec to allow plugins to register tools
* add @llm.Tool decorator that introspects a callables type signature
  and generates a JSON schema
* expose installed tools to Models via new `tools` Model property
* implement tool calling in the openai Model
* register a default `read_files` tool

Note: this pins pytest_httpx until broken tests are fixed in
  simonw#580
Note: this requires openai>=1.40.0
rectalogic added a commit to rectalogic/llm that referenced this pull request Oct 10, 2024
* add register_tools hookspec to allow plugins to register tools
* add @llm.Tool decorator that introspects a callables type signature
  and generates a JSON schema
* expose installed tools to Models via new `tools` Model property
* implement tool calling in the openai Model
* register a default `read_files` tool

Note: this pins pytest_httpx until broken tests are fixed in
  simonw#580
Note: this requires openai>=1.40.0
Note: this drops 3.8 since a number of dependencies no longer
  support it, and adds 3.13 support
@rectalogic rectalogic mentioned this pull request Oct 10, 2024
@simonw
Copy link
Owner

simonw commented Oct 27, 2024

Thanks for this - yeah, I've been meaning to port to pyproject.toml and I'd be pleased to get uv working too.

@simonw simonw merged commit a466ddf into simonw:main Oct 27, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants