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

Conversation

DMRobertson
Copy link
Contributor

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:

  1. Maintaining that approach would now be painful because I'd
    need two different poetry install invocations: one with extras and one
    without.
  2. From very rough testing, I'm not convinced we saved more than 1 or 2 seconds anyway.

David Robertson added 2 commits May 4, 2022 11:45
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
@DMRobertson DMRobertson requested a review from a team as a code owner May 4, 2022 13:14
@DMRobertson
Copy link
Contributor Author

Once merged, I'll make a 1.1.2 release and push the v1 tag forward.

Should resolve matrix-org/synapse#12626.

@DMRobertson
Copy link
Contributor Author

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.

@DMRobertson DMRobertson merged commit 71e0c44 into release/v1 May 5, 2022
@DMRobertson DMRobertson deleted the dmr/extras-poetry-1.2 branch May 5, 2022 18:31
Comment on lines -82 to +97
- 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 }}"
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.

DMRobertson pushed a commit that referenced this pull request May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants