Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove red_knot_python_semantic::python_version::TargetVersion #12790

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

AlexWaygood
Copy link
Member

Summary

This PR is a followup to @MichaReiser's comment at #12782 (comment):

I think it's now a bit confusing when to use TargetVersion vs PythonVersion? Shouldn't all (or at least most) our code be open for new Python versions? Or to phrase it differently, what's the benefit of limiting TargetVersion to a fixed set?

Instead of having two types in ruff_python_semantic -- one that represents an arbitrary Python version, and another that represents the fixed set of versions that we know we support -- this PR consolidates it so that we only use a single type (the more general one). The only case where we need a fixed enumeration of versions that we actually support (at least currently) is in a CLI argparsing context -- but the CLI crates already have their own enums.

This will have quite a few merge conflicts with #12786... I'm okay with waiting until @MichaReiser's stack of module-resolver validation PRs has landed before merging this. It's not urgent.

cargo test

@AlexWaygood AlexWaygood added the red-knot Multi-file analysis & type inference label Aug 9, 2024
Copy link
Contributor

github-actions bot commented Aug 9, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Looks fine to me!

Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks. Feel free to go ahead with merging.

@AlexWaygood AlexWaygood merged commit cf1a57d into main Aug 10, 2024
20 checks passed
@AlexWaygood AlexWaygood deleted the alex/remove-target-version branch August 10, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants