8000 `.python-version` file is not used to establish the python version · Issue #458 · actions/setup-python · GitHub
[go: up one dir, main page]

Skip to content
.python-version file is not used to establish the python version #458
Closed
@gg-kialo

Description

@gg-kialo

Description:
v4.1.0 introduced a regression where the repo-root .python-version file is no longer used by default to select the python version to install.
The regression was introduced by #450

Reading from .python-version when the python-version input is unset is documented in action.yml -

python-version:
description: "Version range or exact version of Python to use, using SemVer's version range syntax. Reads from .python-version if unset."

Action version:
v4.1.0 (regression from v4.0.0)

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:
N/A

Repro steps:
Create a repository with a .python-version file containing 3.10.4 and a workflow containing a setup-python step, e.g.:

name: CI
on: [push]
jobs:
  python:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install python
        uses: actions/setup-python@v4.0.0

Expected behavior:
setup-python should install 3.10.4 as it is listed in the .python-version file, i.e. the step logs:

Run actions/setup-python@v4
  with:
    token: ***
Resolved  as 3.10.4

This is the behaviour with v4.0.0.

Actual behavior:
setup-python ignores the .python-version file and logs:

Run actions/setup-python@v4
Warning: Neither 'python-version' nor 'python-version-file' inputs were supplied.
Warning: The `python-version` input is not set.  The version of Python currently in `PATH` will be used.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0