Skip to content

Setup Python Env

Actions
Setup Python Environment
v1.0.2
Latest
Star (1)

Setup Python Env

This action:

  • installs Python via actions/setup-python@v5
  • (optionally) installs and activated virtualenv
  • (optionally) installs Poetry
  • (optionally) sets custom index URL
  • (optionally) installs dependencies either via pip or Poetry
  • (optionally) installs additional packages

Usage

- uses: cdqag/setup-python-env@v1

Inputs

Name Description Default
python-version Version of Python to use 3.10
use-local-python3-if-possible Should use local Python if possible? false
setup-virtualenv Should setup virtualenv? false
virtualenv-dir Directory to setup virtualenv .venv
install-poetry Should install Poetry? false
poetry-version Version of Poetry to use 1.8.1
index-url Index URL to set for pip - set empty to skip ``
install-dependencies Should install dependencies? true
install-packages Install packages - set empty to skip ``

Example

name: Setup virtualenv

on:
  workflow_dispatch:

jobs:
  example_job:
    runs-on: my-self-hosted-runner

    steps:
      - uses: cdqag/setup-python-env@v1
        with:
          setup-virtualenv: true
          install-packages: flake8 pycodestyle
      - run: pip --version  # This should output also location of used pip (you should see path/.venv/bin/pip)

License

This project is licensed under the MIT License. See the LICENSE file for details.

Setup Python Env is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Setup Python Environment
v1.0.2
Latest

Setup Python Env is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.