github astral-sh/ty 0.0.40

6 hours ago

Release Notes

Released on 2026-05-27.

Bug fixes

  • Accept complete enum-literal alias unions as enums (#25341)
  • Fix diagnostics in ignored folders after adding new files (#25236)
  • Show LiteralString when hovering over an inline of a literal string in an IDE (#25373)

LSP server

  • Follow aliases when attempting to map a definition in a stub file to its "real" runtime definition (#25328)
  • Treat Python notebook text documents as Python sources (#25393)
  • Fix autocompletion for elements inside incomplete list comprehensions (#25326)

Diagnostics

  • Add a subdiagnostic help message to invalid-generic-class diagnostics regarding incompatible variance (#25385)

Core type checking

  • Ignore and reject annotations on non-name targets (#25324)
  • Infer class attributes assigned by metaclass initialization (#25342)
  • Reject inconsistent generic bases in "dynamic" classes created using type(...), types.new_type(...), etc. (#25413)
  • Resolve enum names for all unions arms in Literal enum subsets (#25379)
  • Support typing.TypeForm (#25334)
  • Fix many issues in the generics solver by using constraint sets more widely to solve type variables (#24540)

Contributors

Install ty 0.0.40

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://releases.astral.sh/github/ty/releases/download/0.0.40/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://releases.astral.sh/github/ty/releases/download/0.0.40/ty-installer.ps1 | iex"

Download ty 0.0.40

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ty-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ty-riscv64gc-unknown-linux-gnu.tar.gz RISCV Linux checksum
ty-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ty-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
ty-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
ty-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
ty-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
ty-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
ty-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
ty-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum

Verifying GitHub Artifact Attestations

The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the GitHub CLI:

gh attestation verify <file-path of downloaded artifact> --repo astral-sh/ty

You can also download the attestation from GitHub and verify against that directly:

gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>

Don't miss a new ty release

NewReleases is sending notifications on new releases.