99 description : Poetry version to install via pip.
1010 required : false
1111 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 : " "
1221runs :
1322 using : composite
1423 steps :
5867 uses : actions/cache@v2
5968 with :
6069 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 }}
6271
6372 - name : Check that the poetry lockfile is up to date
6473 # This is rather hacky. We look for the warning message in poetry's
@@ -70,11 +79,16 @@ runs:
7079 (echo pyproject.toml was updated without running \`poetry lock --no-update\`. && false)
7180 shell : bash
7281
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 == ''
7584 run : poetry install --no-interaction --no-root
7685 shell : bash
7786
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+
7892 # (Not sure if this is needed if there's a cache hit?)
7993 - name : Install project
8094 run : poetry install --no-interaction
0 commit comments