Skip to content

🔧 fix(type): resolve ty 0.0.25 type errors#468

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:remove-ty-pin
Mar 26, 2026
Merged

🔧 fix(type): resolve ty 0.0.25 type errors#468
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:remove-ty-pin

Conversation

@gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Mar 26, 2026

ty 0.0.25 introduced stricter type checking. This PR fixes the actual type errors and removes the temporary version pin.

Changes:

  • Add _site_data_dirs, _site_config_dirs, _site_applications_dirs as concrete properties on PlatformDirsABC so XDGMixin.super() calls resolve
  • Replace direct ctypes.WinDLL assignment with mocker.patch.object in tests
  • Remove # type: ignore[misc] comments from _xdg.py
  • Remove ty<0.0.25 version pin

@gaborbernat gaborbernat requested a review from ofek as a code owner March 26, 2026 05:35
@ofek
Copy link
Collaborator

ofek commented Mar 26, 2026

You're basically the lead maintainer here so it's all up to you but have you considered pyrefly? When we introduce a type checking command in Hatch we will very likely use that over ty by default because its behavior is generally safer for users (example).

@gaborbernat
Copy link
Member Author

Yeah, for now I prefer ty 🤔 but can change if OpenAI starts doing crazy things 😆

@ofek
Copy link
Collaborator

ofek commented Mar 26, 2026

Fair enough! What do you prefer about its behavior?

@gaborbernat
Copy link
Member Author

https://pyrefly.org/blog/container-inference-comparison/ I don't really run into this because I consider it best practice to type annotate upfront such elements. It's more unified with the ruff/uv we already use, and is just as fast as pyrefly, and I already use it in all my other projects, so makes sense to not migrate everything else too now to pyrefly. (until few days ago I trusted Astral more than FB, but alas while I still trust Astral, OpenAI I'm not that eager so that benefit is gone).

@gaborbernat gaborbernat changed the title 🔧 build(deps): remove ty version pin 🔧 fix(type): resolve ty 0.0.25 type errors Mar 26, 2026
@gaborbernat gaborbernat merged commit e3cf124 into tox-dev:main Mar 26, 2026
29 checks passed
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.

2 participants