Skip to content

Fix the Type checking job, which now fails on every Python PR - #250

Merged
kaxil merged 1 commit into
mainfrom
worktree-fix-typecheck
Aug 3, 2026
Merged

Fix the Type checking job, which now fails on every Python PR#250
kaxil merged 1 commit into
mainfrom
worktree-fix-typecheck

Conversation

@jlaneve

@jlaneve jlaneve commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Type checking fails on main as it stands. Any PR touching Python in this repo hits it — #249 is how I found it. I reproduced it by running the job's own command against an untouched checkout of origin/main:

error[unresolved-import]: Cannot resolve imported module `click`
  --> cli.py:26:8

main reads green only because its last CI run was 2026-07-20, before the ty release that changed this.

What broke

The job at .github/workflows/ci.yml:85-96 runs uvx ty check, unpinned, so every run picks up the latest ty.

ty 0.0.62 (2026-07-21) shipped this, under Configuration:

Respect rules and analysis in PEP 723 script metadata configurations

cli.py carries a PEP 723 inline metadata block. As of that release the block configures the file, and ty.toml no longer reaches it. The unresolved-import = "ignore" rule stopped applying and the click import surfaced as an error.

Bisected:

ty result
0.0.61 passes
0.0.62 fails ← behaviour change
0.0.65 (what CI pulls today) fails

What this does

Repeats the suppression in the script's own metadata, which is where ty now reads it from, plus a note in ty.toml so the next person understands the duplication.

The dependency is not actually missing — cli.py declares click>=8.0.0 in its PEP 723 header and runs via uv run cli.py. ty does not install dependencies, which is the reason ty.toml suppressed the rule in the first place. This keeps that decision, it just states it where ty will now look.

cli.py is the only PEP 723 script in the checked directory, so it is the only file affected.

Testing

uvx ty check passes on ty 0.0.65 and on 0.0.61, so it works either side of the change. uv run cli.py --help still works, confirming the added block does not disturb PEP 723 execution.

One thing for the owners to decide

I did not pin ty, because that is a policy call rather than part of the fix. Worth considering though: an unpinned tool in CI means an upstream release can turn main red without anyone touching the repo, which is exactly what happened. A pin would make the job reproducible at the cost of someone bumping it. Happy to add it if you want.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NKSW26NfBtfq8hVeeLdfLj

The job runs `uvx ty check` in skills/analyzing-data/scripts, unpinned, so
it picks up whatever ty released last. ty 0.0.62 started reading rules
from PEP 723 inline script metadata. cli.py carries such a block, so its
own metadata now configures it and ty.toml no longer reaches it. The
unresolved-import suppression stopped applying and the undeclared `click`
import surfaced as an error.

The dependency is not missing. cli.py declares click in its PEP 723
header and runs with `uv run cli.py`; ty does not install dependencies,
which is why ty.toml suppressed the rule to begin with. So the fix is to
repeat that suppression in the script's own metadata.

Main looks green only because it last ran before ty 0.0.62. Anything
touching Python in this repo fails today. Confirmed by running the job's
command against an untouched checkout of main.

Checked against ty 0.0.65 and 0.0.61, and `uv run cli.py` still works.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NKSW26NfBtfq8hVeeLdfLj
@kaxil
kaxil merged commit e5af00a into main Aug 3, 2026
5 checks passed
@kaxil
kaxil deleted the worktree-fix-typecheck branch August 3, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants