uv
uv copied to clipboard
no-config and config-file arguments still read pyproject.toml
Summary
I came across an issue when trying to use VS Code internal terminal, which starts up in the project directory, when using uv to automate some of my things in bashrc
Basically, it was reading the pyproject.toml of that project, which had no project entry, and returned with an error, even if the uv call was designed to run for a different virtual env.
I boiled it down to trying in the same project directory, trying all kinds of flags to make it ignore the pyproject in the current directory, with different combinations of using --no-config and --config-file:
❯ UV_NO_CONFIG=1 uv --no-config --config-file="/home/g4b/.local/python/uv.toml" run python
error: No `project` table found in: `/home/g4b/projects/redacted/pyproject.toml
Expected according to the docs: --no-config should ignore the pyproject.toml --config-file should read that file and ignore pyproject.toml as well
Instead: error message and uv exiting further instructions
Yes I did a workaround by adding "cd ~/.local/python && uv run ..." into my script, which works for me, but I still think this might be a bug, that also should be easy to replicate by just running such commands in a directory with an empty pyproject.toml file.
Platform
Windows, Ubuntu 22.04 WSL
Version
uv 0.6.14
Python version
any