-
Notifications
You must be signed in to change notification settings - Fork 1k
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
allow "uv run" to work without a project #8666
Comments
|
Yeah thanks for pointing that out and I confirmed it works. Having to add an extra arg there on every command is a deal breaker right - |
What are you using the |
Things like build-system, black config, isort config, and tool.ruff config. |
What build system are you using without a |
setuptools doesn’t require it - it can pull all the data from setup.py and setup.cfg like it has for decades. :-) I guess I should switch it up to use project but it’s not required by the build backend PEP. |
To be clear I know it’s required to use uv sync and uv lock + lock files but that’s not my short term goal. |
Maybe as an alternative workaround, setup an shell alias for |
Yeah I can work around it, but this ticket is here incase y'all want a cleaner story for the larger community for "older" projects. In pyramid we have for years recommended for people to do the following as a simple starter sequence:
And I thought it'd be cool to at least have a "drop in replacement" story for uv where we'd recommend the following:
As of today we need to add Also mainly for my sanity and to clarify for anyone else I went back to just check and this issue occurs whether or not you have a pyproject.toml. It's just complaining about the missing |
Fwiw I think this should probably work but doesn't
|
👍 on this, I use uv primarily as a manager to venv's per project, but im not necessarily making changes to the projects im dropping into that would allow me to modify pyproject.toml. Being able to set an env var that silences no-project, but still works when a project dir i go to actually DOES have project settings, would be ideal. |
If a directory contains nothing but a script, with no If there's a Is that the intended behaviour? If so it seems strange to require a |
The presence of a |
I have a example for this, a python backend web server doesn't need any build-system. When deploying I just need to copy everything to docker and install deps from requirements.txt, no Maybe we can add a option or env to make For example, |
I just find that we have a option uv/docs/concepts/projects/config.md Lines 147 to 148 in 8a27d4d
|
For real world examples, I've been hitting this in typeshed. Not sure if I wanna try adding a dummy project config. |
In trying to use uv to prepare environments for a web application (no compilation or package involved), I noticed that
OK, so we add the project section to
OK, so it seems I have to run (EDIT: To pre-empt the question of "why do you have a pyproject.toml" in the first place: it's where we configure project linting.) |
Here's an example I ran into today: https://github.com/swe-bench/SWE-bench It has a [build-system]
requires = ['setuptools>=42']
build-backend = 'setuptools.build_meta' Notice the above doesn't include a My team member is having issues with his environment, so I wish I could tell him to just slap
Don't want to instruct on changing that open source project's |
👍 We do currently plan to support this -- hopefully soon. |
It'd be nice if this flow worked simply to avoid needing to activate a virtualenv - regardless of whether I'm using a full uv project or not.
However as of 0.4.28 I get the following error:
Obviously in this case I'm not asking uv to do anything except use the correct path as if I was activating the virtualenv - equivalent to
.venv/bin/activate; python
.The text was updated successfully, but these errors were encountered: