feature: add a `python-path` output by mayeut · Pull Request #405 · actions/setup-python

Conversation

@mayeut

Description:
Expose a python-path output containing the chosen Python executable path.

Related issue:
fix #309
mitigate #132

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

brcrista

@mayeut mayeut changed the title feature: add an interpreter-path output feature: add a python-path output

May 23, 2022

brcrista

@mayeut

The failure for e2e-cache / Test poetry (Python pypy-3.7-v7.x, windows-latest) seems unrelated to changes in this PR.

@vsafonkin

Hi @mayeut, why you don't want to use pythonLocation environment variable for this purpose?

@henryiii

The output works doesn't rely on modifying the environment, and doesn't get overwritten. So you could do multiple setup-python's, and access the correct output. An example of this might be problematic:

- uses: actions/setup-python@v3
  with:
    python-version: "3.7"
- uses: some/composite-action@v1 # Runs a different setup-python internally
# Now pythonLocation is no longer the 3.7 one!

vsafonkin

brcrista

Expose a `python-path` output containing the chosen Python executable path.

@mayeut

The failure for e2e-cache / Test poetry (Python pypy-3.7-v7.x, windows-latest) seems unrelated to changes in this PR.
(the previous failure on the same test went away with a relaunch of the workflow by @vsafonkin)

brcrista

vsafonkin

marko-zivic-93

@mayeut mayeut deleted the interpreter-path branch

May 25, 2022 21:36

tdfacer pushed a commit to ifit/setup-python that referenced this pull request

Oct 7, 2025
feature: add a `python-path` output