readthedocs.org
01623c29 - Add tests for uv native support and fix path validation bugs (#12881)

Commit
17 days ago
Add tests for uv native support and fix path validation bugs (#12881) Tests for the `uv` native install support added in the base PR. While writing tests, two bugs were found and fixed in the validation logic. ## Bug fixes (`config.py`) - **Path default**: `_validate_uv_install` was defaulting `path` to `"."` instead of `None`, conflicting with `UvInstall.path: str | None = None` - **`uv pip` path check**: `_validate_uv_pip` checked `raw_install` for `path`, but path had already been popped from `raw_install` by `_validate_uv_install` — making `uv pip` with only `path` always raise `UV_PIP_REQUIREMENTS_OR_PATH_REQUIRED`. Fixed to check `python_install.get("path")` instead. ```python # This config was silently broken before — path was popped before the check python: install: - method: uv command: pip path: . ``` ## Tests added (`test_config.py`) 30 new tests in `TestBuildConfigV2` covering: - **`uv sync`**: basic, with path, groups (list and `"all"`), extras (list and `"all"`) - **`uv pip`**: with requirements file, with local path, with extras - **Error cases**: missing command, invalid command, `sync` + requirements, `pip` + groups, `pip` with neither requirements nor path, multiple `python.install` entries with `uv`, empty/invalid-type groups/extras - **`is_using_uv` property**: true, false with pip, false with empty install <!-- START COPILOT CODING AGENT TIPS --> --- ⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with [Raycast](https://gh.io/cca-raycast-docs). --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: humitos <244656+humitos@users.noreply.github.com> Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
Author
Committer
Parents
Loading