Skip to content

Set up your GitHub Actions workflow with a specific version of Python (including Python 2.7)

License

Notifications You must be signed in to change notification settings

LizardByte/setup-python-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setup-python-action

This action provides the following functionality for GitHub Actions users:

  • Installing a version of Python or PyPy and (by default) adding it to the PATH, including Python 2.7.

The action was developed after GitHub decided to remove support for Python 2.7 from their actions/setup-python action.

Basic usage

See action.yml

Python

steps:
- uses: actions/checkout@v4
- uses: LizardByte/setup-python-action@master
  with:
    python-version: '3.10'
- run: python my_script.py

Python 2.7

steps:
- uses: actions/checkout@v4
- uses: LizardByte/setup-python-action@master
  with:
    python-version: '2.7'
- run: python my_script.py

PyPy

steps:
- uses: actions/checkout@v4
- uses: LizardByte/setup-python-action@master
  with:
    python-version: 'pypy3.9'
- run: python my_script.py

The python-version input is required.

If the version of Python is not 2.7 the action will use actions/setup-python and pass the version to that action. Otherwise, it will install Python 2.7 on your platform.

License

The scripts and documentation in this project are released under the MIT License.

Contributions

Contributions are welcome! See our Contributor's Guide.