Skip to content

Commit 4b26950

Browse files
changed github action python env
1 parent 586d220 commit 4b26950

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

.github/actions/python-environment/action.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,40 @@ inputs:
1313
required: true
1414
default: "2.1.2"
1515

16+
extras:
17+
description: 'Comma-separated list of extras'
18+
required: false
19+
1620
runs:
1721

1822
using: "composite"
1923
steps:
2024

21-
- name: Setup Poetry (${{ inputs.poetry-version }})
22-
run: pipx install poetry==${{ inputs.poetry-version }}
23-
shell: bash
24-
2525
- name: Setup Python (${{ inputs.python-version}})
2626
uses: actions/setup-python@v5
2727
with:
2828
python-version: ${{ inputs.python-version }}
2929
cache: 'poetry'
3030

31-
- name: Poetry install
32-
run: poetry install
31+
- name: Setup up pipx if not present
32+
shell: bash
33+
run: |
34+
if ! command -v pipx >/dev/null 2>&1; then
35+
python -m pip install --upgrade pip
36+
python -m pip install pipx
37+
pipx ensurepath
38+
fi
39+
40+
- name: Setup Poetry (${{ inputs.poetry-version }})
41+
run: pipx install poetry==${{ inputs.poetry-version }}
42+
shell: bash
43+
44+
- name: Poetry install with extras
45+
run: |
46+
EXTRAS=$(echo "${{ inputs.extras }}" | tr -d ' ')
47+
if [[ -n "$EXTRAS" ]]; then
48+
poetry install --with "$EXTRAS"
49+
else
50+
poetry install
51+
fi
3352
shell: bash

0 commit comments

Comments
 (0)