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

Auto-detect minimal Python for --python-version option #13294

Closed
kdeldycke opened this issue Jul 31, 2022 · 2 comments
Closed

Auto-detect minimal Python for --python-version option #13294

kdeldycke opened this issue Jul 31, 2022 · 2 comments
Labels
feature topic-configuration Configuration files and flags

Comments

@kdeldycke
Copy link

Feature

Let mypy extract the minimal Python version of a project from its pyproject.toml file and auto-set its --python-version x.y option flag.

Pitch

This would help simplify the maintenance of CI jobs as we will have mypy picks up the right setting by itself. A similar feature is being discussed for black and pyupgrade.

I already hacked this autodetection feature for pyupgrade in my GitHub workflows by inspecting the pyproject.toml.

@kdeldycke kdeldycke changed the title Auto-detect minimal Python for --python-version x.y option Auto-detect minimal Python for --python-version option Jul 31, 2022
kdeldycke added a commit to kdeldycke/workflows that referenced this issue Jul 31, 2022
@AlexWaygood AlexWaygood added the topic-configuration Configuration files and flags label Jul 31, 2022
@hauntsaninja
Copy link
Collaborator

You can set python_version in the tool.mypy section of pyproject.toml. We're not going to root around in poetry's configuration for that kind of thing.

@hauntsaninja hauntsaninja closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2022
@kdeldycke
Copy link
Author

OK no worries, I understand the decision. I'll keep my minimal version detection confined to my CI scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-configuration Configuration files and flags
Projects
None yet
Development

No branches or pull requests

3 participants