setup-python should be able to extract that from pyproject.toml: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-the-python-version-file-input
setup-python should be able to extract that from pyproject.toml: https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-the-python-version-file-input