Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install deps and project in one go #4

Merged
merged 2 commits into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}"
Comment on lines -82 to +97
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a mistake here. Line +92 should not have --no-root. Its presence now means that we don't install the package in question when no extras are to be installed.

Didn't spot this when testing because the latest deps job doesn't install with no-extras.

shell: bash

# For debugging---let's just check what we're working with.
Expand Down