Add option to not install the project#18
Conversation
action.yml
Outdated
| if: inputs.extras != '' || inputs.groups != '' | ||
| # (Empty extras or groups lists are fine.) | ||
| run: poetry install --no-interaction --extras="${{ inputs.extras }}" --with="${{ inputs.groups }}" | ||
| run: poetry install --no-interaction --extras="${{ inputs.extras }}" --with="${{ inputs.groups }}" ${{ inputs.install-project == 'true' && '' || '--no-root' }} |
There was a problem hiding this comment.
No wait, '' is falsey so this won't work nyargh
There was a problem hiding this comment.
Why does GHA not have a ternary syntax :((
There was a problem hiding this comment.
Oh bugger, I just trusted you here! https://github.com/orgs/community/discussions/26738 has some context
There was a problem hiding this comment.
GHA would probably say "if it's complicated, write it in javascript" tbh
There was a problem hiding this comment.
Don't you want {{ inputs.install-project == 'true' && '--no-root' || '' }}?
DMRobertson
left a comment
There was a problem hiding this comment.
LGTM. It'd be good to test it on a Synapse PR if you could before merging, e.g. by changing it to use setup-python-poetry@erikj/install_project, but I won't block you on doing so.
| - name: Install project (no extras or groups) | ||
| if: inputs.extras == '' && inputs.groups == '' | ||
| run: poetry install --no-interaction | ||
| run: poetry install --no-interaction ${{ inputs.install-project == 'true' && '' || '--no-root' }} | ||
| shell: bash | ||
|
|
||
| - name: Install project with --extras=${{ inputs.extras }} --with=${{ inputs.groups }} | ||
| if: inputs.extras != '' || inputs.groups != '' | ||
| # (Empty extras or groups lists are fine.) | ||
| run: poetry install --no-interaction --extras="${{ inputs.extras }}" --with="${{ inputs.groups }}" | ||
| run: poetry install --no-interaction --extras="${{ inputs.extras }}" --with="${{ inputs.groups }}" ${{ inputs.install-project == 'true' && '' || '--no-root' }} | ||
| shell: bash |
There was a problem hiding this comment.
Was a bit confused by why we have these two steps here. I think it's because I couldn't find a cleaner way to only add --extras if inputs.extras was specified: I don't think there's a ternary syntax or helper function?
|
matrix-org/synapse#15338 seems to now do the right thing, which tests this |
Thanks, I can see that the pydantic job succeeds (so compiled the Rust, ergo installed the project) and that the sampleconfig job failed because it couldn't import Synapse with the new option set. LGTM |
Fixes #15