Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell: python doesn't work on macOS 13 #7488

Closed
1 of 9 tasks
shogo82148 opened this issue Apr 25, 2023 · 3 comments
Closed
1 of 9 tasks

shell: python doesn't work on macOS 13 #7488

shogo82148 opened this issue Apr 25, 2023 · 3 comments

Comments

@shogo82148
Copy link

Description

The document says that jobs.<job_id>.steps[*].shell can be python.
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell

For example:

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-running-a-python-script
steps:
  - name: Display the path
    run: |
      import os
      print(os.environ['PATH'])
    shell: python

However, it doesn't work on macOS 13 runners that are available from April 24, 2023.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

My example job is here: https://github.com/shogo82148/python-on-macos-13/actions/runs/4797933486/jobs/8535542817

Runner Image
Image: macos-13
Version: 20230419.1
Included Software: https://github.com/actions/runner-images/blob/macOS-13/20230419.1/images/macos/macos-13-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/macOS-13%2F20230419.1

Is it regression?

it works on macos-12

Expected behavior

My python script works.

Actual behavior

I got Error: python: command not found.

Repro steps

Here is an example workflow: https://github.com/shogo82148/python-on-macos-13/blob/main/.github/workflows/blank.yml

# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
  # Triggers the workflow on push or pull request events but only for the "main" branch
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-22.04
          - ubuntu-20.04
          - windows-2022
          - windows-2019
          - macos-13
          - macos-12
          - macos-11

    runs-on: ${{ matrix.os }}

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v3

      - name: Run a python script
        run: print("Hello, world!")
        shell: python
@ilia-shipitsin
Copy link
Contributor

Hello, @shogo82148 .

I'll have a look

@ilia-shipitsin
Copy link
Contributor

@shogo82148 , we are aware of providing MacOS-13 user experience identical to MacOS-12. However, MacOS-13 is currently in "early" stage, some features are not yet ready, for instance, hosted cache (i.e. preinstalled tools like python).

while python is not yet available out of box (sure, it will be soon), I'd suggest the following workaround to install python


      - uses: actions/setup-python@v4
        with:
          python-version: '3.10' 

@ilia-shipitsin
Copy link
Contributor

here's issue where "preinstalled python" is being tracked actions/setup-python#658

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants