Skip to content

uv is not available as package when using uv-venv-lock-runner #183

@leon1995

Description

@leon1995

Issue

When configuring the runner as "uv-venv-lock-runner" in pyproject.toml, then uv is not available as package

[tool.tox] 
env_list = ["py311", "py312", "py313"]

[tool.tox.env_run_base]
runner = "uv-venv-lock-runner"
package = "uv"
commands = [["pytest"]]
dependency_groups = ["test"]

Is this intended?

Environment

Provide at least:

  • OS: windows
Output of pip list of the host Python, where tox is installed

Output of running tox

Output of tox -rvv
py311: 667 W remove tox env folder C:\project\path\.tox\py311 [tox\tox_env\api.py:332]
py311: 905 W venv> C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\uv.exe venv -p C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\python.exe --allow-existing -v --python-preference system C:\project\path\.tox\py311 [tox\tox_env\api.py:434]
DEBUG uv 0.6.3 (a0b9f22a2 2025-02-24)
DEBUG Found project root: `C:\project\path`
DEBUG No workspace root found, using project root
DEBUG Using Python request `C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\python.exe` from explicit request
DEBUG Checking for Python interpreter at path `C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\python.exe`
Using CPython 3.11.6 interpreter at: C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\python.exe
Creating virtual environment at: .tox\py311
DEBUG Using base executable for virtual environment: C:\Users\<redacted>\AppData\Roaming\uv\python\cpython-3.11.6-windows-x86_64-none\python.exe
DEBUG Allowing existing directory
Activate with: .tox\py311\Scripts\activate
py311: 1549 I exit 0 (0.64 seconds) C:\project\path> C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\uv.exe venv -p C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\python.exe --allow-existing -v --python-preference system C:\project\path\.tox\py311 pid=31552 [tox\execute\api.py:294]
py311: 1550 E internal error [tox\session\cmd\run\single.py:60]
Traceback (most recent call last):
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\session\cmd\run\single.py", line 47, in _evaluate
    tox_env.setup()
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\tox_env\api.py", line 257, in setup
    self._setup_env()
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox_uv\_run_lock.py", line 90, in _setup_env
    package = self.conf["package"]
              ~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\sets.py", line 122, in __getitem__
    return self.load(item)
           ^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\sets.py", line 133, in load
    return config_definition.__call__(self._conf, self.loaders, ConfigLoadArgs(chain, self.name, self.env_name))  # noqa: PLC2801
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\of_type.py", line 109, in __call__
    value = loader.load(key, self.of_type, self.factory, conf, args)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\api.py", line 148, in load
    converted = self.build(key, of_type, factory, conf, raw, args)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\toml\__init__.py", line 66, in build
    return self.to(exploded, of_type, factory)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\convert.py", line 33, in to
    return self._to_typing(raw, of_type, factory)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\convert.py", line 87, in _to_typing
    raise ValueError(msg)
ValueError: uv must be one of ('editable', 'wheel', 'skip')
py311: FAIL ✖ in 0.97 seconds
py312: 1644 W remove tox env folder C:\project\path\.tox\py312 [tox\tox_env\api.py:332]
py312: 1884 W venv> C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\uv.exe venv -p cpython3.12 --allow-existing -v --python-preference system C:\project\path\.tox\py312 [tox\tox_env\api.py:434]
DEBUG uv 0.6.3 (a0b9f22a2 2025-02-24)
DEBUG Found project root: `C:\project\path`
DEBUG No workspace root found, using project root
DEBUG Using Python request `[email protected]` from explicit request
DEBUG Searching for CPython 3.12 in managed installations, search path, or registry
DEBUG Found `cpython-3.11.6-windows-x86_64-none` at `C:\project\path\.venv/Scripts\python.exe` (first executable in the search path)
DEBUG Ignoring Python interpreter at `C:\project\path\.venv\Scripts\python.exe`: system interpreter required
DEBUG `LOCALAPPDATA` not set, ignoring Microsoft store Pythons
DEBUG Found `cpython-3.12.3-windows-x86_64-none` at `C:\Users\<redacted>\AppData\Local\Programs\Python\Python312\python.exe` (registry)
Using CPython 3.12.3 interpreter at: C:\Users\<redacted>\AppData\Local\Programs\Python\Python312\python.exe
Creating virtual environment at: .tox\py312
DEBUG Using base executable for virtual environment: C:\Users\<redacted>\AppData\Local\Programs\Python\Python312\python.exe
DEBUG Allowing existing directory
Activate with: .tox\py312\Scripts\activate
py312: 1987 I exit 0 (0.09 seconds) C:\project\path> C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\uv.exe venv -p cpython3.12 --allow-existing -v --python-preference system C:\project\path\.tox\py312 pid=29784 [tox\execute\api.py:294]
py312: 1990 E internal error [tox\session\cmd\run\single.py:60]
Traceback (most recent call last):
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\session\cmd\run\single.py", line 47, in _evaluate
    tox_env.setup()
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\tox_env\api.py", line 257, in setup
    self._setup_env()
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox_uv\_run_lock.py", line 90, in _setup_env
    package = self.conf["package"]
              ~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\sets.py", line 122, in __getitem__
    return self.load(item)
           ^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\sets.py", line 133, in load
    return config_definition.__call__(self._conf, self.loaders, ConfigLoadArgs(chain, self.name, self.env_name))  # noqa: PLC2801
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\of_type.py", line 109, in __call__
    value = loader.load(key, self.of_type, self.factory, conf, args)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\api.py", line 148, in load
    converted = self.build(key, of_type, factory, conf, raw, args)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\toml\__init__.py", line 66, in build
    return self.to(exploded, of_type, factory)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\convert.py", line 33, in to
    return self._to_typing(raw, of_type, factory)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\convert.py", line 87, in _to_typing
    raise ValueError(msg)
ValueError: uv must be one of ('editable', 'wheel', 'skip')
py312: FAIL ✖ in 0.36 seconds
py313: 1994 W remove tox env folder C:\project\path\.tox\py313 [tox\tox_env\api.py:332]
py313: 2258 W venv> C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\uv.exe venv -p cpython3.13 --allow-existing -v --python-preference system C:\project\path\.tox\py313 [tox\tox_env\api.py:434]
DEBUG uv 0.6.3 (a0b9f22a2 2025-02-24)
DEBUG Found project root: `C:\project\path`
DEBUG No workspace root found, using project root
DEBUG Using Python request `[email protected]` from explicit request
DEBUG Searching for CPython 3.13 in managed installations, search path, or registry
DEBUG Found `cpython-3.11.6-windows-x86_64-none` at `C:\project\path\.venv/Scripts\python.exe` (first executable in the search path)
DEBUG Ignoring Python interpreter at `C:\project\path\.venv\Scripts\python.exe`: system interpreter required
DEBUG `LOCALAPPDATA` not set, ignoring Microsoft store Pythons
DEBUG Searching for managed installations at `C:\Users\<redacted>\AppData\Roaming\uv\python`
DEBUG Skipping incompatible managed installation `cpython-3.14.0a5-windows-x86_64-none`
DEBUG Found managed installation `cpython-3.13.2-windows-x86_64-none`
DEBUG Found `cpython-3.13.2-windows-x86_64-none` at `C:\Users\<redacted>\AppData\Roaming\uv\python\cpython-3.13.2-windows-x86_64-none\python.exe` (managed installations)
Using CPython 3.13.2
Creating virtual environment at: .tox\py313
DEBUG Using base executable for virtual environment: C:\Users\<redacted>\AppData\Roaming\uv\python\cpython-3.13.2-windows-x86_64-none\python.exe
DEBUG Allowing existing directory
Activate with: .tox\py313\Scripts\activate
py313: 2394 I exit 0 (0.12 seconds) C:\project\path> C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Scripts\uv.exe venv -p cpython3.13 --allow-existing -v --python-preference system C:\project\path\.tox\py313 pid=31252 [tox\execute\api.py:294]
py313: 2396 E internal error [tox\session\cmd\run\single.py:60]
Traceback (most recent call last):
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\session\cmd\run\single.py", line 47, in _evaluate
    tox_env.setup()
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\tox_env\api.py", line 257, in setup
    self._setup_env()
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox_uv\_run_lock.py", line 90, in _setup_env
    package = self.conf["package"]
              ~~~~~~~~~^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\sets.py", line 122, in __getitem__
    return self.load(item)
           ^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\sets.py", line 133, in load
    return config_definition.__call__(self._conf, self.loaders, ConfigLoadArgs(chain, self.name, self.env_name))  # noqa: PLC2801
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\of_type.py", line 109, in __call__
    value = loader.load(key, self.of_type, self.factory, conf, args)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\api.py", line 148, in load
    converted = self.build(key, of_type, factory, conf, raw, args)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\toml\__init__.py", line 66, in build
    return self.to(exploded, of_type, factory)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\convert.py", line 33, in to
    return self._to_typing(raw, of_type, factory)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\<redacted>\AppData\Roaming\uv\tools\tox\Lib\site-packages\tox\config\loader\convert.py", line 87, in _to_typing
    raise ValueError(msg)
ValueError: uv must be one of ('editable', 'wheel', 'skip')
  py311: FAIL code 2 (0.97 seconds)
  py312: FAIL code 2 (0.36 seconds)
  py313: FAIL code 2 (0.41 seconds)
  evaluation failed :( (1.95 seconds)

Minimal example

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions