Skip to content

Fail if --project directory does not exist#17093

Closed
ddoemonn wants to merge 3 commits intoastral-sh:release/010from
ddoemonn:fix-validate-project-flag
Closed

Fail if --project directory does not exist#17093
ddoemonn wants to merge 3 commits intoastral-sh:release/010from
ddoemonn:fix-validate-project-flag

Conversation

@ddoemonn
Copy link
Copy Markdown
Contributor

Summary

Fixes #17087

When --project is specified with a non-existent path, uv now fails immediately with a clear error message instead of silently continuing and potentially discovering a different project.

The fix validates that the provided --project path exists and is a directory before proceeding with any command execution.

Test Plan

  • Added two new unit tests: run_project_not_found and run_project_is_file
  • Manually tested with non-existent directory, file path, and valid directory

@zanieb zanieb added the breaking A breaking change label Dec 12, 2025
@zanieb zanieb added this to the v0.10.0 milestone Dec 12, 2025
@zanieb
Copy link
Copy Markdown
Member

zanieb commented Dec 12, 2025

This looks good to me but is a breaking change.

It'd be good to add it as a warning first then make it fail in 0.10

@konstin konstin changed the title Fix validate --project directory exists before use Fail if --project directory does not exist Jan 26, 2026
@konstin konstin changed the base branch from main to release/010 January 26, 2026 14:29
@konstin
Copy link
Copy Markdown
Member

konstin commented Jan 26, 2026

Moving off the milestone as we need a version with a warning first.

@konstin konstin marked this pull request as draft January 26, 2026 14:36
konstin added a commit that referenced this pull request Jan 27, 2026
konstin pushed a commit that referenced this pull request Jan 27, 2026
@konstin konstin modified the milestones: v0.10.0, v0.11.0 Jan 27, 2026
@zanieb zanieb force-pushed the release/010 branch 2 times, most recently from 49db9df to ad2a660 Compare February 3, 2026 22:27
konstin pushed a commit that referenced this pull request Feb 4, 2026
@zanieb zanieb deleted the branch astral-sh:release/010 February 5, 2026 17:52
@zanieb zanieb closed this Feb 5, 2026
konstin added a commit that referenced this pull request Mar 13, 2026
For #17093

Errors if `--project` points to a file, as this already errors on Linux.

---------

Co-authored-by: ddoemonn <ozergokalpsezer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--project <path> does not fail if <path> does not exist

3 participants