Skip to content

Fails in a non-Python project #30

Closed
astral-sh/uv
#21777

Description

@tueda

I use ty to check Python scripts (with no third-party dependencies) in a non-Python project. Currently, ty-pre-commit fails if pyproject.toml does not exist:

ty.......................................................................Failed
- hook id: ty
- exit code: 1

warning[uv-metadata]: `uv workspace metadata` failed with status exit status: 2: error: No `pyproject.toml` found in current directory or any parent directory

Found 1 diagnostic

Note that ty itself does not require pyproject.toml.

Configuration:

  - repo: https://github.com/astral-sh/ty-pre-commit
    rev: v0.0.81
    hooks:
      - id: ty

Activity

  1. AlexWaygood commented on Sep 17, 2026

    @AlexWaygood
    Member

    Thanks for the report. It looks like this behaviour changed in ty 0.0.76; ty now has a hard error on failing uv workspace metadata calls when TY_UV=1 is set as an environment variable (that environment variable signals to ty that it should "activate its uv integration"). uv check sets that environment variable unconditionally, and this pre-commit hook invokes uv check.

    We're discussing internally what the best solution here might be.

  2. AlexWaygood commented on Sep 17, 2026

    @AlexWaygood
    Member

    Thanks again for the report. This will be fixed in the first ty release that comes after the next uv release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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