42 Commits
Author SHA1 Message Date
renovate[bot] 5bf63e4c10 Update dependency pyrefly to v1.3.1 (#29564)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| pyrefly | `==1.3.0` → `==1.3.1` |
![age](https://developer.mend.io/api/mc/badges/age/pypi/pyrefly/1.3.1?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pyrefly/1.3.0/1.3.1?slim=true)
|

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNzEuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE3MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-20 19:43:15 -07:00
David Peter c64734bcea [ty] Enable return type inference in scripts and tools (#29439)
## Summary

Enable return type inference for all 24 standalone Python scripts
checked by ty in CI, along with `py-fuzzer` and `ty_benchmark`.
2026-10-16 12:41:30 +00:00
Zanie Blueandzaniebot c79af46103 Require hashes for build dependencies (#29336)
Enable `require-build-hashes` for the Python projects and inline scripts
so isolated builds require declared hashes for their build dependencies.
Pin the build backends and their dependencies with hashes.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-10-15 20:15:23 +01:00
renovate[bot] ab433b1e2b Update dependency pyright to v1.1.414 (#29349)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [pyright](https://redirect.github.com/Microsoft/pyright)
([source](https://redirect.github.com/Microsoft/pyright/tree/HEAD/packages/pyright))
| [`1.1.413` →
`1.1.414`](https://renovatebot.com/diffs/npm/pyright/1.1.413/1.1.414) |
![age](https://developer.mend.io/api/mc/badges/age/npm/pyright/1.1.414?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pyright/1.1.413/1.1.414?slim=true)
|

---

### Release Notes

<details>
<summary>Microsoft/pyright (pyright)</summary>

###
[`v1.1.414`](https://redirect.github.com/microsoft/pyright/releases/tag/1.1.414):
Published 1.1.414

[Compare
Source](https://redirect.github.com/Microsoft/pyright/compare/1.1.413...1.1.414)

#### Changes:

-
[`a28cce4`](https://redirect.github.com/Microsoft/pyright/commit/a28cce4077d87b80bead12de809f79845e39c8ba)
Bump version to 1.1.414
([#&#8203;11724](https://redirect.github.com/Microsoft/pyright/issues/11724))
-
[`10f9e77`](https://redirect.github.com/Microsoft/pyright/commit/10f9e773c012d3ae15fd3232915a86ffda64d371)
Bump the github-actions group across 1 directory with 5 updates
([#&#8203;11720](https://redirect.github.com/Microsoft/pyright/issues/11720))
-
[`d72e2fe`](https://redirect.github.com/Microsoft/pyright/commit/d72e2fe89e4ad4227d6c5be9bb6e57b082768e23)
Fix pnpm setup in benchmark workflow
([#&#8203;11719](https://redirect.github.com/Microsoft/pyright/issues/11719))
-
[`854df36`](https://redirect.github.com/Microsoft/pyright/commit/854df36c470a636ca44fbf222ea7d4f328f5f471)
Allow assigning signature metadata to functions
([#&#8203;11714](https://redirect.github.com/Microsoft/pyright/issues/11714))
-
[`c773932`](https://redirect.github.com/Microsoft/pyright/commit/c77393240247e017db6538d35876e723c518e06c)
Publish pyright-typeserver to npm
([#&#8203;11713](https://redirect.github.com/Microsoft/pyright/issues/11713))
-
[`fa9b200`](https://redirect.github.com/Microsoft/pyright/commit/fa9b200906fadc093e862ce62ec1afa985c7233d)
Pull Pylance with Pyright 1.1.413
([#&#8203;11697](https://redirect.github.com/Microsoft/pyright/issues/11697))
-
[`e690634`](https://redirect.github.com/Microsoft/pyright/commit/e690634a94ab05cf7dd003b63b1ac67cd6d6878e)
Fix printExpression output for slice expressions and set displays
([#&#8203;11598](https://redirect.github.com/Microsoft/pyright/issues/11598))
-
[`685de39`](https://redirect.github.com/Microsoft/pyright/commit/685de39b5d3f32092fb576c9de54e5472a28447d)
Report a specific diagnostic for walrus in a comprehension iterable
([#&#8203;11606](https://redirect.github.com/Microsoft/pyright/issues/11606))
\[
[#&#8203;11514](https://redirect.github.com/Microsoft/pyright/issues/11514)
]
-
[`5a958ca`](https://redirect.github.com/Microsoft/pyright/commit/5a958ca8f5119affaca3c6cfe2157cdc87480f0a)
Add regression tests for sentinel conditional type guards
([#&#8203;11686](https://redirect.github.com/Microsoft/pyright/issues/11686))
-
[`6a7d491`](https://redirect.github.com/Microsoft/pyright/commit/6a7d491300be1fe1c2328fb64b511f7e2a4b356a)
Preserve benchmark result comments
([#&#8203;11682](https://redirect.github.com/Microsoft/pyright/issues/11682))

<details><summary><b>See More</b></summary>

-
[`8575d83`](https://redirect.github.com/Microsoft/pyright/commit/8575d8332f73f96721987e373f9844a666446b94)
Fix Sentinel base type assignability
([#&#8203;11676](https://redirect.github.com/Microsoft/pyright/issues/11676))
-
[`37c0386`](https://redirect.github.com/Microsoft/pyright/commit/37c03866d7929e4745e802c37e7e9bcabeda080b)
Optimize type equality fast paths
([#&#8203;11420](https://redirect.github.com/Microsoft/pyright/issues/11420))
-
[`b8dd159`](https://redirect.github.com/Microsoft/pyright/commit/b8dd159d12ff7e99ad8e8854737ce21e9ecb7042)
Fix keyword-form assignability for standard dest parameters
([#&#8203;11670](https://redirect.github.com/Microsoft/pyright/issues/11670))
-
[`bf6ec03`](https://redirect.github.com/Microsoft/pyright/commit/bf6ec03650710f7dc34fcf42442e6590d960f5cb)
Fix benchmark comparison and reporting
([#&#8203;11680](https://redirect.github.com/Microsoft/pyright/issues/11680))
-
[`390f0aa`](https://redirect.github.com/Microsoft/pyright/commit/390f0aaa54fb0d6f17725a7f999e2457079b3bcb)
Fix TypeGuard and TypeIs narrowing for functions with union return types
([#&#8203;11608](https://redirect.github.com/Microsoft/pyright/issues/11608))
-
[`fabb9f9`](https://redirect.github.com/Microsoft/pyright/commit/fabb9f9f9005c1180a108cac1bb7daf9d1bb0721)
Fix type narrowing for equality comparisons with IntEnum and StrEnum
values
([#&#8203;11622](https://redirect.github.com/Microsoft/pyright/issues/11622))
-
[`20380f2`](https://redirect.github.com/Microsoft/pyright/commit/20380f21f4afe7db79dd4dd7d3e31ab7a6ca4c24)
Push Pylance changes to Pyright
([#&#8203;11678](https://redirect.github.com/Microsoft/pyright/issues/11678))
-
[`3a1e14d`](https://redirect.github.com/Microsoft/pyright/commit/3a1e14df628d4e7454be3bc46ce0f8be672c08fd)
Benchmark pull request merge commits
([#&#8203;11677](https://redirect.github.com/Microsoft/pyright/issues/11677))
-
[`d5162f9`](https://redirect.github.com/Microsoft/pyright/commit/d5162f944f9a565549939eb4dc87934c2f170689)
Cover two remaining dataclass field() override branches
([#&#8203;11679](https://redirect.github.com/Microsoft/pyright/issues/11679))
\[
[#&#8203;11665](https://redirect.github.com/Microsoft/pyright/issues/11665)
]
-
[`0b8c227`](https://redirect.github.com/Microsoft/pyright/commit/0b8c227baf95bae353ce9268336ea09d912cd728)
Fix crashes after clearing analyzer caches
([#&#8203;11675](https://redirect.github.com/Microsoft/pyright/issues/11675))
-
[`b895058`](https://redirect.github.com/Microsoft/pyright/commit/b89505828a17ce2a75df68419eaf10ab9707104d)
Do not inherit dataclass defaults when a subclass uses field() without
one.
([#&#8203;11665](https://redirect.github.com/Microsoft/pyright/issues/11665))
\[
[#&#8203;11660](https://redirect.github.com/Microsoft/pyright/issues/11660)
]
-
[`99854b7`](https://redirect.github.com/Microsoft/pyright/commit/99854b716017afd28e79e61e3904834e0fcbe854)
Dispatch typecheck benchmark workflow directly
([#&#8203;11674](https://redirect.github.com/Microsoft/pyright/issues/11674))
-
[`1be1899`](https://redirect.github.com/Microsoft/pyright/commit/1be1899ebec8591346b64a388ec195298e78f44e)
Do not treat objects with explicit **iter** as iterable via **getitem**.
([#&#8203;11645](https://redirect.github.com/Microsoft/pyright/issues/11645))
-
[`beaac8f`](https://redirect.github.com/Microsoft/pyright/commit/beaac8f2f965a4b27bfb1f958392254fcf86b11e)
Fix functools.partial type evaluation for callable class instances
([#&#8203;11672](https://redirect.github.com/Microsoft/pyright/issues/11672))
-
[`5b448bb`](https://redirect.github.com/Microsoft/pyright/commit/5b448bb99ddee5084ad51e1f7c4eb48455cc492c)
Do not eliminate a TypedDict with extra items on a negative key check
([#&#8203;11663](https://redirect.github.com/Microsoft/pyright/issues/11663))
-
[`bacb814`](https://redirect.github.com/Microsoft/pyright/commit/bacb8141b4e93fe2583db032a5318f42aa3a75e9)
Fix benchmark comment trigger
([#&#8203;11673](https://redirect.github.com/Microsoft/pyright/issues/11673))
-
[`93a6550`](https://redirect.github.com/Microsoft/pyright/commit/93a6550b2acc61d930edf54ad4621638cdc70777)
Add cross-type-checker benchmark regression tracking
([#&#8203;11574](https://redirect.github.com/Microsoft/pyright/issues/11574))
-
[`85837ef`](https://redirect.github.com/Microsoft/pyright/commit/85837efea752fbb1cd04c261a51cded566e21e57)
Add non-publishing registry validation mode
([#&#8203;11667](https://redirect.github.com/Microsoft/pyright/issues/11667))
-
[`3f87071`](https://redirect.github.com/Microsoft/pyright/commit/3f870712c2a2076ccfbfe685c3dbda7a453a590a)
Install pinned pnpm on Azure DevOps build agents
([#&#8203;11661](https://redirect.github.com/Microsoft/pyright/issues/11661))
\[
[#&#8203;11652](https://redirect.github.com/Microsoft/pyright/issues/11652)
]
-
[`d5e77a7`](https://redirect.github.com/Microsoft/pyright/commit/d5e77a7f4856f8e7caee1fa788b25bf67901a3c9)
Fix protocol cache for specialized self overloads
([#&#8203;11649](https://redirect.github.com/Microsoft/pyright/issues/11649))
-
[`7ddd3b1`](https://redirect.github.com/Microsoft/pyright/commit/7ddd3b121bf3421fd3e98ec4f3b38209e24c08d0)
Push Pylance changes to Pyright
([#&#8203;11658](https://redirect.github.com/Microsoft/pyright/issues/11658))
-
[`5cf4afa`](https://redirect.github.com/Microsoft/pyright/commit/5cf4afa88b491795af0a2bfd1683ec24c60dcf03)
Migrate CI package installation to pnpm
([#&#8203;11652](https://redirect.github.com/Microsoft/pyright/issues/11652))
-
[`334e3fb`](https://redirect.github.com/Microsoft/pyright/commit/334e3fb792f7b912a44715e74528fab22b73bf1e)
Pin GitHub Actions to full-length commit SHAs
([#&#8203;11628](https://redirect.github.com/Microsoft/pyright/issues/11628))

This list of changes was [auto
generated](https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=15264113\&view=logs).</details>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNTUuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE1NS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-14 08:05:39 +01:00
renovate[bot] 518d03e379 Update dependency pyrefly to v1.3.0 (#29357)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| pyrefly | `==1.2.0` → `==1.3.0` |
![age](https://developer.mend.io/api/mc/badges/age/pypi/pyrefly/1.3.0?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pyrefly/1.2.0/1.3.0?slim=true)
|

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNTUuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE1NS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-14 08:04:29 +01:00
David Peter 55c48b1e76 [ty] Enable strict rules for even more projects and scripts (#28980)
## Summary

I found some more scripts / projects that were not using these rules.

## Test strategy

Ran `ty_benchmark` locally
2026-09-29 06:44:29 +02:00
David Peter de9071547c [ty] Enable None-union truthiness checks in Python scripts and tools (#28911)
## Summary

Enable `truthiness-test-of-none-union` in the standalone scripts' inline
configuration and in the `py-fuzzer` and `ty_benchmark` projects,
following #28889.
2026-09-28 11:47:03 +00:00
renovate[bot] c61deab820 Update dependency pyright to v1.1.413 (#28626) 2026-09-16 08:21:36 +02:00
Alex Waygood 88ffbca35c Use build backends with fewer dependencies for Python tooling (#27886) 2026-08-19 15:21:56 +00:00
zaniebotandzaniebot 73ffad43aa Disable npm install scripts by default (#27837)
The playground workflows disable dependency lifecycle scripts, but
ordinary local installs in the playground, its API, and the ty benchmark
project still enable them. Set `ignore-scripts` in each project's
`.npmrc` so the same default applies outside CI, while preserving the
existing seven-day release-age policy. Because `ignore-scripts` also
suppresses first-party pre/post hooks, the playground's `build`,
`dev:build`, and `start` commands invoke their required WASM preparation
explicitly. The datastore instructions now install from the API lockfile
and invoke its local Wrangler instead of allowing `npx` to resolve a
separate dependency tree.

Related: astral-sh/ruff-vscode#1151 and astral-sh/ty-vscode#525 apply
the same install-script default to the editor extensions.
astral-sh/ruff#27844 enforces the cooldown-supporting `npm` floor,
astral-sh/ruff#27842 hardens the native `prek` formatter environment,
and astral-sh/ruff#27838 locks the playground deployment toolchain.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-08-19 14:39:35 +00:00
zaniebotandzaniebot 6dd1fa88eb Require wheels for Python tooling dependencies (#27861)
Python tooling can currently build third-party source distributions. Set
`no-build` in the maintained Python projects and PEP 723 scripts,
retaining named exceptions for Git-pinned tooling and the local
ecosystem runner. Pin the isolated build dependencies for those
exceptions, including their transitive requirements.

Follows merged astral-sh/ruff#27856, which gives the legacy `ruff-lsp`
suite a dedicated, locked Python 3.12 test environment.

Follow-up to astral-sh/ruff#27843. Replaces astral-sh/ruff#27840, which
closed when the merged docs branch was deleted.

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-08-19 14:31:32 +00:00
zaniebotandzaniebot 0680a1b01f Require npm with dependency cooldown support (#27844)
Older `npm` releases silently ignore the seven-day dependency cooldown
added in #27796. Require `npm` 11.10.0 or newer in the playground,
playground API, and ty benchmark projects, and enable `engine-strict` so
unsupported clients fail during `npm install` or `npm ci`. The lockfile
changes only record that requirement; dependency versions and the
existing cooldown are unchanged.

Pin Node.js to `24.19.0` for the playground CI and publishing jobs,
which provides a compatible bundled `npm`. The separate script-default
changes are in #27837, and the locked playground deployment tool is in
#27838.

Related: astral-sh/ruff#27855 pins the remaining WebAssembly test and
publication runtimes. astral-sh/setup-uv#1026 and
astral-sh/ruff-action#411 enforce the same legacy-aware `npm` version
floor. astral-sh/uv#21193 applies it to uv's locked formatter toolchain.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-08-19 09:05:19 -05:00
William Woodruff bfc9036e04 Add explicit dependency cooldowns (#27796)
<!--
Thank you for contributing to Ruff/ty! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title? (Please prefix
with `[ty]` for ty pull
  requests.)
- Does this pull request include references to any relevant issues?
- Does this PR follow our AI policy
(https://github.com/astral-sh/.github/blob/main/AI_POLICY.md)?
-->

## Summary

Adds explicit 7d cooldowns to all of our PEP 723 scripts, as well as
similar cooldowns via `.npmrc`.

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

NFC.

<!-- How was it tested? -->


---

<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
2026-08-16 13:19:40 -04:00
renovate[bot] 98aae2ec7b Update dependency pyrefly to v1.2.0 (#27682) 2026-08-12 07:42:36 +02:00
renovate[bot]andBrent Westbrook d91586bd5b Update prek dependencies (#27293)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[astral-sh/ruff-pre-commit](https://redirect.github.com/astral-sh/ruff-pre-commit)
| repository | minor | `v0.15.22` → `v0.16.0` |
|
[astral-sh/uv-pre-commit](https://redirect.github.com/astral-sh/uv-pre-commit)
| repository | minor | `0.11.32` → `0.12.0` |
|
[rbubley/mirrors-prettier](https://redirect.github.com/rbubley/mirrors-prettier)
| repository | patch | `v3.9.5` → `v3.9.6` |
|
[zizmorcore/zizmor-pre-commit](https://redirect.github.com/zizmorcore/zizmor-pre-commit)
| repository | minor | `v1.27.0` → `v1.28.0` |

Note: The `pre-commit` manager in Renovate is not supported by the
`pre-commit` maintainers or community. Please do not report any problems
there, instead [create a Discussion in the Renovate
repository](https://redirect.github.com/renovatebot/renovate/discussions/new)
if you have any questions.

---

### Release Notes

<details>
<summary>astral-sh/ruff-pre-commit (astral-sh/ruff-pre-commit)</summary>

###
[`v0.16.0`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.16.0)

[Compare
Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.15.22...v0.16.0)

See: <https://github.com/astral-sh/ruff/releases/tag/0.16.0>

</details>

<details>
<summary>astral-sh/uv-pre-commit (astral-sh/uv-pre-commit)</summary>

###
[`v0.12.0`](https://redirect.github.com/astral-sh/uv-pre-commit/releases/tag/0.12.0)

[Compare
Source](https://redirect.github.com/astral-sh/uv-pre-commit/compare/0.11.33...0.12.0)

See: <https://github.com/astral-sh/uv/releases/tag/0.12.0>

###
[`v0.11.33`](https://redirect.github.com/astral-sh/uv-pre-commit/compare/0.11.32...0.11.33)

[Compare
Source](https://redirect.github.com/astral-sh/uv-pre-commit/compare/0.11.32...0.11.33)

</details>

<details>
<summary>rbubley/mirrors-prettier (rbubley/mirrors-prettier)</summary>

###
[`v3.9.6`](https://redirect.github.com/rbubley/mirrors-prettier/compare/v3.9.5...v3.9.6)

[Compare
Source](https://redirect.github.com/rbubley/mirrors-prettier/compare/v3.9.5...v3.9.6)

</details>

<details>
<summary>zizmorcore/zizmor-pre-commit
(zizmorcore/zizmor-pre-commit)</summary>

###
[`v1.28.0`](https://redirect.github.com/zizmorcore/zizmor-pre-commit/releases/tag/v1.28.0)

[Compare
Source](https://redirect.github.com/zizmorcore/zizmor-pre-commit/compare/v1.27.0...v1.28.0)

See: <https://github.com/zizmorcore/zizmor/releases/tag/v1.28.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on Wednesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-07-30 09:09:25 -04:00
Samuel RigaudandSamuel Rigaud d78b3d5f32 Fix typos (#26443)
FIix even more typos

Co-authored-by: Samuel Rigaud <rigaud@gmail.com>
2026-06-28 23:23:37 +01:00
Charlie Marsh 08e9c847cf [ty] Refresh benchmark snapshots (#26422)
## Summary

Regenerate the ty benchmark snapshots against the current ty commit and
latest version of each tool:

- ty: `ruff/0.15.20+28 (1d2041ca1 2026-06-26)`
- Pyrefly: `1.1.1`
- Pyright: `1.1.411`
- mypy: `2.1.0`
2026-06-26 19:23:05 -04:00
Charlie Marsh eea5ddd3c0 [ty] Update Pyrefly benchmark snapshots (#26125)
## Summary

This fixes an oversight from #26110, where we bumped the benchmark
Pyrefly pin to 1.1.0 but did not update the expected Pyrefly benchmark
snapshots.
2026-06-18 06:48:09 -04:00
Charlie Marsh 1bc7712633 [ty] Update benchmark Pyrefly to 1.1.0 (#26110)
## Summary

Update the ty benchmark harness to use Pyrefly 1.1.0.

This only changes the benchmark dependency pin and lockfile. Benchmark
outputs and diagnostic snapshots are intentionally left unchanged.

## Test Plan

- `cd scripts/ty_benchmark && uv lock --upgrade-package pyrefly`
- `cd scripts/ty_benchmark && uv run --python 3.14 pyrefly --version`
- `uvx prek run --files scripts/ty_benchmark/pyproject.toml
scripts/ty_benchmark/uv.lock`
2026-06-17 13:19:23 -04:00
Charlie Marsh 1d5d491001 [ty] Update benchmark project revisions (#25730)
## Summary

This PR bumps the project revisions used by `ty_benchmark` and refreshes
the expected CLI diagnostic snapshots against current upstream code.

The refreshed revisions require a few corresponding dependency changes.
Home Assistant now installs its full and test requirements separately
and excludes `dtlssocket`, which is pulled in by `pytradfri[async]` but
only distributed as an sdist that requires `autoconf`; pandas-stubs now
requires Python 3.11 and exposes its development dependencies through a
dependency group; and PyTorch's import environment is refreshed from its
upstream Pyrefly linter configuration while checker versions remain
controlled by this benchmark.

The benchmark harness now installs mypy only when a mypy suite is
selected, and uses a `uv` override to pin those runs to mypy 2.1.0 even
for projects that declare their own mypy development dependency. This
keeps ty and Pyrefly runs from inheriting mypy's Python-version and
dependency constraints while preserving one benchmark-managed mypy
version for mypy runs.

We also advance the dependency cutoff and update the benchmarked type
checkers to mypy 2.1.0, Pyright 1.1.410, and Pyrefly 1.0.0.
2026-06-17 10:17:22 -04:00
renovate[bot] 0b982ea69c Update dependency pyright to v1.1.410 (#25566) 2026-06-02 22:19:49 -04:00
renovate[bot] cb11ec4ba4 Update dependency pyright to v1.1.409 (#24856)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-27 10:40:23 +02:00
renovate[bot] 3127232161 Update dependency pytest to v9.0.3 (#24629)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-04-14 08:34:15 +02:00
Vlad Apostol f854f4fb7f Fix shell injection via shell=True in subprocess calls (#23894)
## Summary

Enable Ruff's own `S602` rule (`subprocess-popen-with-shell-equals-true`
from flake8-bandit) in `pyproject.toml` to enforce no-shell subprocess
calls going forward, and fix the two existing violations it catches.

**`pyproject.toml`** - adds `S602` to the lint `select` list so any
future `shell=True` usage in the scripts is caught automatically by the
linter.

**`scripts/setup_primer_project.py`** - `project.install_cmd` and
`project.deps` come from the mypy-primer project registry (an
externally-fetched third-party config). Both were joined into shell
strings and executed with `shell=True`, making them a supply-chain
injection vector. Fixed by tokenising with `shlex.split()` and dropping
`shell=True`.

**`scripts/ty_benchmark/src/benchmark/snapshot.py`** - `command.prepare`
was passed to `subprocess.run(..., shell=True)`. While no current caller
sets this field, it is a latent injection point. Fixed by tokenising
with `shlex.split()` and dropping `shell=True`; adds the missing `import
shlex`.

## Test Plan

Both scripts are developer-only utilities. The changes are semantically
equivalent for well-formed inputs - `shlex.split()` produces the same
argument list the shell would have constructed, while refusing to pass
metacharacters through to a shell process.

Verified no other `shell=True` uses remain in `scripts/` or `python/`
that would be newly flagged by S602.
2026-03-13 08:13:14 -06:00
Carl Meyer 7d8c6422b1 [ty] do not union Unknown into unannotated container types (#23718)
## Summary

Part of https://github.com/astral-sh/ty/issues/1240

Stop unioning `Unknown` into the types of un-annotated container
literals.

We discussed perhaps continuing to union `Unknown` if the inferred type
is a singleton type like `None`. I'd like to explore this as a separate
change so we can see the ecosystem impact more clearly.

## Test Plan

Adjusted many mdtest expectations.

There's one test case that regresses with this change, because we don't
fully support union type contexts (it can require a lot of repeat
inference in pathological cases). So `x10: list[int | str] | list[int |
None] = [1, 2, 3]` previously passed only because we inferred the RHS as
`list[Unknown | int]` -- now we infer it as `list[int]` and the
assignment fails due to invariance. I've kept this test as a TODO since
it's not trivial to fix. Mypy errors in the same way we now do,
suggesting it's not necessarily a huge priority either.

## Ecosystem

This change is expected to cause new diagnostics and some false
positives, since we are replacing very-forgiving gradual types with
non-gradual inference heuristics.

Many of these issues could be solved or significantly mitigated by
https://github.com/astral-sh/ty/issues/1473, depending how far we are
able to go with that, and particularly whether we can afford to apply it
also to container literals which are not empty at construction. The
downside of broad application of this approach is that in some cases it
could cause us to widen container types when the user actually just made
a mistake and added the wrong thing to a container, and would prefer an
error at that location.

Some categories of new error that show up in the ecosystem report:

### Implicit TypedDicts

These are cases where the dictionary is heterogeneous and would ideally
be typed as a `TypedDict` but isn't, for example:

```py
def make_person(photo: bytes | None):
    person = {"name": "Pat", age: 29}
    if photo is not None:
        person["photo"] = photo
```

We (and pyrefly, and pyright in strict mode) error on the last line here
because we already inferred `dict[str, str | int]`, so we can't add a
`bytes` value.

Mypy prefers common-base joins over union joins, so it infers `dict[str,
object]`, which avoids the error adding a `bytes` value. This means the
value type is less precise, which theoretically means potentially more
errors using values from the dict later. But in practice with this
heterogeneous pattern, either `object` or the union will cause similar
problems when using values from the dict -- in either case you'd
probably have to cast or narrow.

Pyright (in non-strict mode) has a special case where it falls back to
`Unknown` when it sees heterogenous value types, so it infers this as
`dict[str, Unknown]`.

I think we could consider either the mypy or pyright approaches here,
but we don't need to do it in this PR; we can file an issue and consider
it as a follow-up.

Another symptom of this same root cause is repetitive diagnostics
arising from a large union inferred as value type; the same fixes would
address this.

### Negative intersections, particularly with e.g. `~AlwaysFalsy` or
`~None`.

Example:

```py
class A: ...

def _(a: A | None) -> dict[str, A]:
    if a:
        d = {"a": a}
        return d
    return {}
```

We error on `return d` because "expected `dict[str, A]`, found
`dict[str, A & ~AlwaysFalsy]`". This is an issue specific to
intersection types, so no other type checker has this problem.

I think when we "promote literals" (we may need to give this operation a
broader name -- it's really "type promotion to give a better inferred
type when invariance means too-precise is bad") we should also eliminate
all negative types from intersections. I would prefer to do this as a
separate PR for easier review and better visibility of ecosystem impact,
but I think it's high priority to land soon after this PR (ideally
before a release).

### Overly-precise inference for singleton `None`

This did show up, to the tune of ~100 new diagnostics
([example](https://github.com/pytorch/ignite/blob/b73a4c20e991b3e14949f2a69651ed2a7219f2fd/tests/ignite/engine/test_engine.py#L158)),
so I think it is worth addressing as a follow-up.
2026-03-05 15:40:48 -08:00
renovate[bot]andMicha Reiser c50863a0ee Update dependency pyright to v1.1.408 (#22696)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2026-01-19 07:59:38 +00:00
Alex Waygood 6b3de1517a [ty] Improve tracebacks when installing dependencies fails in ty_benchmark (#22399) 2026-01-05 14:55:08 +00:00
Alex Waygood 74978cfff2 Error on unused ty: ignore comments when dogfooding ty on our own scripts (#22347) 2026-01-02 20:27:09 +00:00
renovate[bot]andMicha Reiser a1c3f16358 Update pre-commit dependencies (#22281)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-12-29 17:11:28 +00:00
Rob Hand 7f7485d608 [ty] Fixed benchmark markdown auto-linenumbers (#22008) 2025-12-16 16:38:11 +01:00
Micha Reiser 01c0a3e960 [ty] Fix benchmark assertion (#22003) 2025-12-16 12:24:54 +01:00
Micha ReiserandClaude 5372bb3440 [ty] Use jemalloc on linux (#21975)
Co-authored-by: Claude <noreply@anthropic.com>
2025-12-15 16:04:34 +01:00
Micha Reiser 90b29c9e87 Bump benchmark dependencies (#21951) 2025-12-12 17:05:57 +00:00
Micha Reiser f29436ca9e [ty] Update benchmark dependencies (#21815) 2025-12-05 17:23:18 +01:00
Micha Reiser 2182c750db [ty] Use generator over list comprehension to avoid cast (#21748) 2025-12-02 08:47:47 +01:00
William Woodruff edc6ed5077 Use npm ci --ignore-scripts everywhere (#21742) 2025-12-01 17:13:52 -05:00
Micha Reiser 2e229aa8cb [ty] LSP Benchmarks (#21625) 2025-12-01 11:33:53 +00:00
Micha Reiser 747c39a26a [ty] Add more and update existing projects in ty_benchmark (#21536) 2025-11-25 08:58:34 +01:00
Alex Waygood bfd65c4215 Dogfood ty on the scripts directory (#21617)
## Summary

This PR sets up CI jobs to run ty from the `main` branch on the files
and subdirectories in our `scripts` directory

## Test Plan

Both these commands pass for me locally:
- `uv run --project=./scripts cargo run -p ty check --project=./scripts`
- `uv run --project=./scripts/ty_benchmark cargo run -p ty check
--project=./scripts/ty_benchmark`
2025-11-24 23:13:44 +00:00
Anh-Dung Nguyen e72f10be2d [ty] Fix tool name is None when no ty path is given in ty_benchmark (#19870)
## Summary

When running the ty_benchmark, I found out that the Ty Tool name is None
when no ty_path is given as str(None)='None'
<img width="1011" height="168" alt="image"
src="https://github.com/user-attachments/assets/cf3e6d98-2329-48e9-b180-c72e4f01ccb6"
/>

## Test Plan
Minor fix, tested local
<img width="1105" height="218" alt="image"
src="https://github.com/user-attachments/assets/173128c9-dcfa-49f1-a58d-1b39a6c6b53b"
/>
2025-08-11 21:26:30 +00:00
Ibraheem Ahmed aa1fad61e0 Support relative --ty-path in ty-benchmark (#18385)
## Summary

This currently doesn't work because the benchmark changes the working
directory. Also updates the process name to make it easier to compare
two local ty binaries.
2025-05-30 18:19:20 -04:00
Micha Reiser b51c4f82ea Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00