Skip to content

tox-gh fails with uv-venv-lock-runner (again) #223

@huynguyengl99

Description

@huynguyengl99

tox-gh fails with AttributeError: '_thread._local' object has no attribute 'installing' when using uv-venv-lock-runner.

Root Cause

uv-venv-lock-runner uses uv sync directly and bypasses the tox_on_install hook, so _STATE.installing is never set. The strict assertion in tox_before_run_commands then fails:

assert _STATE.installing  # This fails

Proposed Fix

Replace the assertion with a defensive check:

installing = getattr(_STATE, "installing", False)
if installing:
    _STATE.installing = False
    print("::endgroup::")

This supports both traditional runners (that call tox_on_install) and lock-based runners (that don't).

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions