Skip to content

Commit

Permalink
Install deps and project in one go (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson authored May 5, 2022
1 parent 387b367 commit 71e0c44
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 71e0c44

Please sign in to comment.