Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielfalcao/pyenv-action
Enables pyenv within your github actions workflow
https://github.com/gabrielfalcao/pyenv-action
actions github github-actions pip pyenv python python3 virtualenv
Last synced: 2 days ago
JSON representation
Enables pyenv within your github actions workflow
- Host: GitHub
- URL: https://github.com/gabrielfalcao/pyenv-action
- Owner: gabrielfalcao
- License: mit
- Created: 2020-03-21T20:26:22.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T15:16:57.000Z (2 months ago)
- Last Synced: 2024-10-23T19:42:49.897Z (2 months ago)
- Topics: actions, github, github-actions, pip, pyenv, python, python3, virtualenv
- Language: TypeScript
- Homepage:
- Size: 1.56 MB
- Stars: 39
- Watchers: 4
- Forks: 19
- Open Issues: 22
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - GitHub Actions for Python project with pyenv
- fucking-awesome-actions - GitHub Actions for Python project with pyenv
- awesome-workflows - GitHub Actions for Python project with pyenv
README
pyenv-action
============.. image:: https://github.com/gabrielfalcao/pyenv-action/workflows/Continuous%20Integration/badge.svg
:target: https://github.com/gabrielfalcao/pyenv-action/actions.. image:: https://img.shields.io/github/license/gabrielfalcao/pyenv-action?label=License
:target: https://github.com/gabrielfalcao/pyenv-action/blob/master/LICENSE.. image:: https://img.shields.io/github/v/tag/gabrielfalcao/pyenv-action?label=Latest%20Release
:target: https://github.com/gabrielfalcao/pyenv-action/releasesThis GitHub Action allows using pyenv in your build.
Features:
=========- Installs pyenv ``2.4.1``.
- Exports `PYENV_ROOT `_ environment variable.
- Injects ``$PYENV_ROOT/bin`` in the PATH.
- Injects `pyenv shims `_ in the PATH.
- Pre-install specified python versions.
- Set default python version (through ``pyenv local``).**Note:** Supports Linux and MacOS (but not Windows).
Usage
=====Example
-------Installs python versions 3.8.16 and 3.9 with pyenv, upgrade pip for
each of them and run pytest... code:: yaml
name: Using
on: [push, pull_request]jobs:
my_python_job:
name: "Python"
runs-on: ubuntu-latest
strategy:
matrix:
python:
- 3.8.16
- 3.9steps:
- uses: actions/checkout@v4
- name: Install python version
uses: gabrielfalcao/pyenv-action@v18
with:
default: "${{ matrix.python }}"
command: pip install -U pip # upgrade pip after installing python- name: Install dependencies
run: pip install -r requirements.txt- name: Run tests
run: pytest .Enable multiple python versions in your github-action
-----------------------------------------------------.. code:: yaml
name: Using python 3.9 with pyenv
on: [push, pull_request]jobs:
test_pyenv:
runs-on: ubuntu-latest
name: install pyenv
steps:
- name: setup pyenv
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: 3.7.2
versions: 3.8.16, 3.5.7# create virtualenv for each python version
- name: Create virtualenv for python 3.5.7
run: pyenv local 3.5.7 && python3 -mvenv .venv357- name: Create virtualenv for python 3.8.16
run: pyenv local 3.8.16 && python3 -mvenv .venv365- name: Create virtualenv for python 3.7.2
run: pyenv local 3.7.2 && python3 -mvenv .venv372Inputs
======**default**
-----------The default python version to install and set with ``pyenv local ``
MUST be a valid python version supported by ``pyenv install ``
**MUST** be defined
Example:
.. code:: yaml
- name: setup pyenv
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: 3.9**versions**
------------A comma-separated list of versions that will be pre-installed in your
github action.Each version must be a valid and supported by ``pyenv install ``
Example:
.. code:: yaml
- name: setup pyenv
uses: "gabrielfalcao/pyenv-action@v18"
with:
versions: 3.6.4, 3.7.2**command**
-----------A command that will be executed after installing each python version.
This is useful, for example, for pre-installing pip dependencies in each python.
Example:
.. code:: yaml
- name: setup pyenv
uses: "gabrielfalcao/pyenv-action@v18"
with:
versions: 3.6.4, 3.7.2
command: |
pip install -U pip setuptools
pip install -r development.txtOutputs
=======**pyenv_root**
--------------The full path to the `PYENV_ROOT
`_Example:
.. code:: yaml
name: Example pyenv_root action output
on: [push, pull_request]jobs:
my_debug_job:
runs-on: ubuntu-latest
name: install pyenv
steps:
- name: setup pyenv
id: pyenv_installation
uses: "gabrielfalcao/pyenv-action@v18"- name: debug pyenv
run: echo ${{ steps.pyenv_installation.outputs.pyenv_root }}