Auto-detect minimal Python version
See original GitHub issueMy proposition is to have pyupgrade
auto detect the minimal Python version targeted by a project and set by itself the --py3-plus
/ --py36-plus
/ (...)
/ --py311-plus
option flags.
I hacked this autodetection feature in my GitHub workflows by inspecting the pyproject.toml
.
Note this feature is also considered by black
and discussed for mypy
.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Auto-detect minimal Python for --python-version option #13294
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 ...
Read more >How do I detect the Python version at runtime? - Stack Overflow
I have a Python file which might have to support Python versions < 3.x and >= 3.x. Is there a way to introspect...
Read more >3. Configure Python — Python 3.11.1 documentation
Select the ensurepip command run on Python installation: upgrade (default): run python -m ensurepip --altinstall --upgrade ...
Read more >Compatibility and requirements for the Python agent
Recommendation: Use Python version 3.7 or higher with our agent. Python versions 2.6 and 3.3 are supported only by Python agent versions 3.4.0.95...
Read more >Python 3 Support - Ansible Documentation
Ansible will automatically detect and use Python 3 on many platforms that ship with it. To explicitly configure a Python 3 interpreter, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
no thanks – that would involve reading configuration files of which I don’t want anything to do with that complexity
Oh, and thanks @asottile for
pyupgrade
: it’s a really cool project. Love it!