Skip to content

Allow --project to refer to a pyproject.toml directly and reduce to a warning on other files#18513

Merged
zanieb merged 3 commits intoastral-sh:mainfrom
zaniebot:claude/investigate-uv-18508-LdhjY
Mar 16, 2026
Merged

Allow --project to refer to a pyproject.toml directly and reduce to a warning on other files#18513
zanieb merged 3 commits intoastral-sh:mainfrom
zaniebot:claude/investigate-uv-18508-LdhjY

Conversation

@zanieb
Copy link
Copy Markdown
Member

@zanieb zanieb commented Mar 16, 2026

Closes #18508

This unintentionally regressed in #17714 as it appeared that --project <file> always failed but it actually succeeds if the file is has an ancestor directory with a pyproject.toml.

This also removes the warning for --project [path/]pyproject.toml as I think that's a fine use-case.

@zaniebot zaniebot force-pushed the claude/investigate-uv-18508-LdhjY branch 5 times, most recently from ffe47ad to 0eb8961 Compare March 16, 2026 17:23
…-sh#18508)

Fix a regression from astral-sh#17714 where `--project pyproject.toml` stopped
working. When `--project` points to a `pyproject.toml` file, resolve to
its parent directory since downstream code expects a directory. For other
file types, emit a warning (or error with preview flag) and let
downstream code fail naturally if there is no ancestor project.

https://claude.ai/code/session_01NSUgyAxK5iz4VXKFW2L5ja
@zaniebot zaniebot force-pushed the claude/investigate-uv-18508-LdhjY branch from 0eb8961 to 8e58133 Compare March 16, 2026 17:31
claude and others added 2 commits March 16, 2026 17:44
These tests only need to run `python --version`, so the build-system
section is unnecessary and adds network dependency on setuptools.

https://claude.ai/code/session_01NSUgyAxK5iz4VXKFW2L5ja
@zanieb zanieb marked this pull request as ready for review March 16, 2026 17:54
@zanieb zanieb added the bug Something isn't working label Mar 16, 2026
@zanieb zanieb merged commit add312b into astral-sh:main Mar 16, 2026
104 of 106 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UV 0.10.10 wouldn't work with --project pointing to a file, not a directory

3 participants