Astral Adds uv check, and ty Will Read PEP 723 Script Metadata
Software / news
Astral Adds uv check, and ty Will Read PEP 723 Script Metadata
The integration is experimental, and environment setup for scripts is opt-in because installing dependencies can run third-party code.
Astral published an experimental integration of its package manager uv and its type checker ty on Oct. 13, adding a uv check command and making ty read the dependency metadata inside standalone Python scripts. It needs uv 0.12.3 or later and ty 0.0.76 or later, and the announcement post, written by Sara Sklenka, calls it a preview.
The post describes two changes. The first covers PEP 723 scripts, a format where a single .py file declares its own dependencies and Python version in a comment block. uv already builds environments from that block. ty now uses the same block, so each script is checked against its own requirements and not those of the project around it.
The task it fixes: a script that disagrees with its project
A script can declare requirements that differ from the project around it. Under the integration, ty discovers scripts across the project and asks uv to create an environment for each one.
In VS Code the switch is a single setting, ty.experimental.useUv, set to "on". From the command line it is the environment variable TY_UV=scripts in front of ty check.
Why environment setup is opt-in
The post says automatic setup for scripts is off by default because installing dependencies can run third-party code. That is the sticking point for anyone who opens a downloaded script in an editor: with the setting on, opening it can trigger an install of whatever it declares. Astral says it plans to turn script support on by default and, later, automatic setup for standard projects, without giving a date for either.
What uv check does
uv check prepares the project environment, installs the dependencies and runs ty. Astral says it plans to add its linter Ruff later so that linting and type checking run in one command. The ty binary is installed on first use, so anyone who never runs the command sees no change.
| Command | What it checks |
|---|---|
uv check | The current project |
uv check --package <name> | One workspace package |
uv check --all-packages | Every package in a workspace |
uv check --script example.py | A standalone script, against its own declared requirements |
The design choice that matters for teams is version pinning. uv check runs the version of ty recorded in the project's lockfile, so a developer's laptop and the CI job use the same checker without a separate pin. The ty pre-commit hook now calls uv check internally.
Versions as of Oct. 25
The requirements are low enough that most current installs meet them. The uv releases page lists 0.13.5 as the latest release, and the ty releases page lists 0.0.91, published Oct. 22. ty's 0.0.x numbering still marks it as pre-1.0, and the post says Astral continues working toward a stable release.
Under the hood the integration relies on uv workspace metadata, which gives ty a structured view of packages, dependencies and the interpreter. The uv 0.13.2 release on Oct. 19 changed that command to report all installed packages.
Astral credits Aria Desires, Micha Reiser and Zsolt Dollenstein with the implementation. It is also working on checks that combine uv's dependency knowledge with ty's code analysis, such as flagging unused dependencies, and said they will be covered in a later post.
Other toolchain releases this month are covered in Wild 0.11.0 and Rune 1.3.1.
Sources
More in Software
- 01Tencent's LoopForge Installs With Docker Socket Access and Listens on All InterfacesThe MIT-licensed coding-agent workspace has 1.6k stars, ten supported agent CLIs, and a security section its quick-start does not lead with.
- 02Plannotator, at 11.9k Stars, Reviews Agent Plans Locally but Has No Release-Check Opt-OutThe browser review tool for ten coding agents installs with a curl-to-bash script and puts small shares in an unencrypted URL fragment.
- 03Jiff 1.0 Freezes Its API, Putting a Rust Datetime Library Beside ChronoThe release post commits to the 1.0 interface indefinitely and names uv, Cargo, Starship and Nushell among the projects already using it.
- 04Chrome DevTools MCP Gives Agents 63 Tools and Sends Usage Statistics by DefaultThe repository's own README, not the launch post, is where the data-collection default and the opt-out flags are written down.