You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PYTHON_FOR_REGEN only works with Python 3.10 or newer #104487
On current main, PYTHON_FOR_REGEN only works with Python 3.10 or newer.
Previously, we've tried to maintain backwards compatibility with older Python versions in our build system. Last time we adjusted PYTHON_FOR_REGEN (gh-98988), we deliberately did not bump the minimal version requirements; our configure checks for Python 3.11 through Python 3.6.
While working on gh-104050, a discussion about version requirements came up, and we found out that on main, make clinic only works when PYTHON_FOR_REGEN is Python 3.10 or newer. Also, the newly introduced "generate cases script" uses pattern matching and uses newly introduced typing features. Per now, PYTHON_FOR_REGEN must be 3.10 or newer.
There are two solution to this:
bump the PYTHON_FOR_REGEN version requirements to 3.10 in configure
amend the problematic build scripts, so older Python versions are still supported
Personally, I think I'm leaning towards the former. Apparently no core dev, triager or other contributor has noticed this issue until now. No buildbot has failed (we don't test the minimum required version; perhaps we should). OTOH, I understand that it makes stuff like bootstrapping slightly more cumbersome.
Anyway, we should probably at least bump the version requirement from Python 3.6 to 3.8.
(FWIW, this issue was originally highlighted by running mypy on Tools/clinic with --python-version=3.8, which pointed out that clinic.py currently makes regular use of types.NoneType, a symbol that's new in Python 3.10.)
I’m reluctant to have to dumb down the cases generator to 3.8. Can we please just bump the required version to 3.10? As you say there isn’t much need for earlier versions, apparently.
I also agree with bumping minimal version to 3.10 (as I said in the original issue).
I cannot imagine real-life use-cases when you need to compile the most recent Python version from source, but at the same time you don't have an access to at least 3.10
Plus, this makes writting code much more pleasant due to new typing + syntax features.
I cannot imagine real-life use-cases when you need to compile the most recent Python version from source, but at the same time you don't have an access to at least 3.10
Bootstrapping Python on a new platform.
Come to think of it, you probably won't use PYTHON_FOR_REGEN when building from a clean check-out anyways. You'd only need it for regenerating stuff you touched, and in that case, you can point PYTHON_FOR_REGEN to for example ./python.exe in the build dir.
Activity
erlend-aasland commentedon May 14, 2023
cc. @AlexWaygood, @JelleZijlstra, @hugovk
AlexWaygood commentedon May 14, 2023
(FWIW, this issue was originally highlighted by running mypy on
Tools/clinicwith--python-version=3.8, which pointed out thatclinic.pycurrently makes regular use oftypes.NoneType, a symbol that's new in Python 3.10.)erlend-aasland commentedon May 14, 2023
cc. @gvanrossum and @iritkatriel for
Tools/cases_generator/erlend-aasland commentedon May 14, 2023
Related:
pythongh-104487: PYTHON_FOR_REGEN must be minimum Python 3.8
gvanrossum commentedon May 15, 2023
I’m reluctant to have to dumb down the cases generator to 3.8. Can we please just bump the required version to 3.10? As you say there isn’t much need for earlier versions, apparently.
erlend-aasland commentedon May 15, 2023
I've updated my PR with Python 3.10 as the minimum version, and I also included Python 3.12 in the list.
sobolevn commentedon May 15, 2023
I also agree with bumping minimal version to 3.10 (as I said in the original issue).
I cannot imagine real-life use-cases when you need to compile the most recent Python version from source, but at the same time you don't have an access to at least 3.10
Plus, this makes writting code much more pleasant due to new typing + syntax features.
@erlend-aasland thanks for raising this! 👍
erlend-aasland commentedon May 15, 2023
Bootstrapping Python on a new platform.
Come to think of it, you probably won't use
PYTHON_FOR_REGENwhen building from a clean check-out anyways. You'd only need it for regenerating stuff you touched, and in that case, you can pointPYTHON_FOR_REGENto for example./python.exein the build dir.gh-104487: PYTHON_FOR_REGEN must be minimum Python 3.10 (#104488)
erlend-aasland commentedon May 15, 2023
Resolved with:
Merge branch 'main' into supermon
Merge branch 'main' into cached_property_docs