question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto-detect minimal Python version

See original GitHub issue

My 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:closed
  • Created a year ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Jul 31, 2022

no thanks – that would involve reading configuration files of which I don’t want anything to do with that complexity

0reactions
kdeldyckecommented, Aug 1, 2022

Oh, and thanks @asottile for pyupgrade: it’s a really cool project. Love it!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found