Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .github/actions/python-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,44 @@ inputs:
required: true
default: "."

extras:
description: 'Comma-separated list of extras'
required: false

use-cache:
description: 'Use cache for poetry environment'
required: false
default: 'true'

runs:

using: "composite"
steps:

- name: Setup Poetry (${{ inputs.poetry-version }})
- name: Set up pipx if not present
shell: bash
run: |
python3 -m pip install --upgrade pipx
python3 -m pipx ensurepath
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Set up Poetry (${{ inputs.poetry-version }})
shell: bash
run: pipx install poetry==${{ inputs.poetry-version }}

- name: Setup Python (${{ inputs.python-version}})
- name: Set up Python (${{ inputs.python-version}})
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: 'poetry'
cache: ${{ inputs.use-cache == 'true' && 'poetry' || '' }}

- name: Poetry install
- name: Poetry install with extras
working-directory: ${{ inputs.working-directory }}
shell: bash
run: poetry install
run: |
EXTRAS=$(echo "${{ inputs.extras }}" | tr -d ' ')
if [[ -n "$EXTRAS" ]]; then
poetry install --extras "$EXTRAS"
else
poetry install
fi
6 changes: 5 additions & 1 deletion doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ permissions to be increased for specific jobs.
## Security

* [#420](https://github.com/exasol/python-toolbox/issues/420): Replaced 3rd party action with GitHub actions for gh-pages
* [#422](https://github.com/exasol/python-toolbox/issues/422): Set permissions within the GitHub workflows to restrict usage of the default GitHub token
* [#422](https://github.com/exasol/python-toolbox/issues/422): Set permissions within the GitHub workflows to restrict usage of the default GitHub token

## ✨ Features

* [#413](https://github.com/exasol/python-toolbox/pull/413): Add support for installing extras to python-environment action
13 changes: 13 additions & 0 deletions doc/github_actions/python_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ Parameters
- Poetry version to use
- True
- 2.1.2
* - working-directory
- 'Working directory to use'
- True
- .
* - extras
- Comma-separated list of extras
- False
-
* - use-cache
- Use cache for poetry environment
- False
- true

Example Usage
-------------
Expand All @@ -44,5 +56,6 @@ Example Usage
with:
python-version: 3.12
poetry-version: 2.1.2
working-directory: .

...