Skip to content

Conversation

@EmilyBZhang
Copy link
Contributor

Closes astral-sh/ty#453.

Summary

Add an additional info diagnostic to unresolved-import check to hint to users that they should make sure their Python environment is properly configured for ty, linking them to the corresponding doc. This diagnostic is only shown when an import is not relative, e.g., import maturin not import .maturin.

Test Plan

Updated snapshots with new info message and reran tests.

@EmilyBZhang EmilyBZhang force-pushed the emily/unresolved-import-python-env-note branch from 50fadda to 6bfbf47 Compare May 19, 2025 20:39
@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label May 19, 2025
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me! I guess my only concern is that the link could become stale in the future, since our docs aren't particularly stable right now. Will wait for another maintainer's approval before landing.

@github-actions
Copy link
Contributor

mypy_primer results

No ecosystem changes detected ✅

Copy link
Member

@dcreager dcreager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you!

I'm okay with the link to the GitHub repo readme — we will want to update that to a more stable URL in the future once we have the docs hosted in a more stable place. But I don't think that needs to block this, since we'll want to do a careful vet of links when we do that anyway!

@dcreager dcreager merged commit a2c87c2 into astral-sh:main May 19, 2025
35 checks passed
@EmilyBZhang EmilyBZhang deleted the emily/unresolved-import-python-env-note branch May 19, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unresolved-import: Add note if no third-party search path is configured

3 participants