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
- uses: cdqag/setup-python-env@v1
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 | `` |
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)
This project is licensed under the MIT License. See the LICENSE file for details.