From 71e0c442d1dff598316bd217a8c7afe86a83958f Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 5 May 2022 19:31:14 +0100 Subject: [PATCH] Install deps and project in one go (#4) --- action.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index e676973..50481d2 100644 --- a/action.yml +++ b/action.yml @@ -74,24 +74,27 @@ runs: # output. We really want to use `poetry lock --check`, but that is only # available in poetry 1.2. # https://github.com/python-poetry/poetry/issues/1406 + # + # Note that the error message has changed with Poetry 1.2 to + # Warning: poetry.lock is not consistent with pyproject.toml. You may be + # getting improper dependencies. Run poetry lock [--no-update] to fix it. + # So this check fails on Poetry 1.2. But that version of poetry wants to change + # the lockfile to include versions of setuptools for each dependency. So it's + # convenient to leave this as-is, unless we want to change to use Poetry 1.2 by + # default in the future. run: >- poetry export --without-hashes | (! grep "The lock file is not up to date") || (echo pyproject.toml was updated without running \`poetry lock --no-update\`. && false) shell: bash - - name: Install base dependencies only - if: steps.poetry-venv-cache.outputs.cache-hit != 'true' && inputs.extras == '' + - name: Install project (no extras) + if: inputs.extras == '' run: poetry install --no-interaction --no-root shell: bash - - name: Install poetry with --extras=${{ inputs.extras }} - if: steps.poetry-venv-cache.outputs.cache-hit != 'true' && inputs.extras != '' - run: poetry install --no-interaction --no-root --extras="${{ inputs.extras }}" - shell: bash - - # (Not sure if this is needed if there's a cache hit?) - - name: Install project - run: poetry install --no-interaction + - name: Install project with --extras=${{ inputs.extras }} + if: inputs.extras != '' + run: poetry install --no-interaction --extras="${{ inputs.extras }}" shell: bash # For debugging---let's just check what we're working with.