9
9
description : Poetry version to install via pip.
10
10
required : false
11
11
default : " 1.1.12"
12
+ extras :
13
+ description : >
14
+ If present, a space separated list of extras to pass to
15
+ `poetry install --extra ...`. Either way, dev-dependencies
16
+ will be installed.
17
+ # If https://github.com/python-poetry/poetry/issues/3413 get solved, I think
18
+ # we should make this action install all extras by default.
19
+ required : false
20
+ default : " "
12
21
runs :
13
22
using : composite
14
23
steps :
58
67
uses : actions/cache@v2
59
68
with :
60
69
path : ${{ steps.poetry-venvs.outputs.dir }}
61
- key : poetry-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
70
+ key : poetry-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ inputs.extras }}
62
71
63
72
- name : Check that the poetry lockfile is up to date
64
73
# This is rather hacky. We look for the warning message in poetry's
@@ -70,11 +79,16 @@ runs:
70
79
(echo pyproject.toml was updated without running \`poetry lock --no-update\`. && false)
71
80
shell : bash
72
81
73
- - name : Install dependencies
74
- if : " ${{ steps.poetry-venv-cache.outputs.cache-hit != 'true' }} "
82
+ - name : Install base dependencies only
83
+ if : steps.poetry-venv-cache.outputs.cache-hit != 'true' && inputs.extras == ''
75
84
run : poetry install --no-interaction --no-root
76
85
shell : bash
77
86
87
+ - name : Install poetry with --extras=${{ inputs.extras }}
88
+ if : steps.poetry-venv-cache.outputs.cache-hit != 'true' && inputs.extras != ''
89
+ run : poetry install --no-interaction --no-root --extras="${{ inputs.extras }}"
90
+ shell : bash
91
+
78
92
# (Not sure if this is needed if there's a cache hit?)
79
93
- name : Install project
80
94
run : poetry install --no-interaction
0 commit comments