uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv run --script` should imply `--no-project`

Open offbyone opened this issue 1 year ago • 2 comments

I'm running into a variation of https://github.com/astral-sh/uv/issues/8666

I have some uv scripts that are just generic command line tools, not part of a project. If I run them inside a Python project that uses Poetry, though, I get error: No projecttable found in:/Users/offby1/projects/autopub/autopub/pyproject.toml` errors constantly.

I'm using the --script shebang:

#!/usr/bin/env uv --script

I realize that I can add --no-project to it, but really, I think once you're using --script there's a good argument to be made that uv should assume --no-project

offbyone avatar Nov 02 '24 13:11 offbyone

We should just stop throwing that error so aggressively. I don't want --script to imply --no-project in case we want to read things like settings from the project too in the future.

zanieb avatar Nov 02 '24 14:11 zanieb

I actually can't reproduce this. Are you still able to? I don't think we discover projects when --script is provided, from reading the code.

charliermarsh avatar Dec 09 '24 01:12 charliermarsh

Agreed, could not reproduce.

zanieb avatar Dec 09 '24 14:12 zanieb

I no longer see this either.

offbyone avatar Dec 09 '24 15:12 offbyone