-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
This works around a change in poetry 1.2; see explanation here: matrix-org/synapse#12626 (comment) I had originally made the "install deps" and "install project" steps separate, to allow us to skip the installing deps bit if there was a cache hit. Maintaining that approach would now be painful because I'd need two different `poetry install` invocations: one with extras and one without. And it only saved us 1 or 2 seconds per run.
but we want to leave it doing so for Reasons
Once merged, I'll make a 1.1.2 release and push the v1 tag forward. Should resolve matrix-org/synapse#12626. |
Tested by manually running the latest deps job against matrix-org/synapse@3630220. That run is still in progress, but https://github.com/matrix-org/synapse/actions/runs/2269925714 shows that mypy passed. |
- 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 }}" |
There was a problem hiding this comment.
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.
Regression introduced in #4, see #4 (comment)
This works around a change in poetry 1.2; see explanation here:
matrix-org/synapse#12626 (comment)
I had originally made the "install deps" and "install project" steps
separate, to allow us to skip the installing deps bit if there was a
cache hit. I I don't mind losing this, for two reasons:
need two different
poetry install
invocations: one with extras and onewithout.