Skip to content

Commit 99e1858

Browse files
committed
Allow users to specify pip installing cylc packages in editable mode to allow coverage checking
1 parent e96fc74 commit 99e1858

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

install-cylc-components/action.yml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ inputs:
1717
The branch to use when determining compatible versions, if running
1818
in workflow dispatch.
1919
required: false
20+
editable_installations:
21+
description: |
22+
Install repositories in editable mode.
23+
This may be useful for running coverage.
24+
default: false
25+
required: false
2026

2127
cylc_flow:
2228
description: Install cylc-flow (default=true)
@@ -113,28 +119,38 @@ runs:
113119
meto_rose: ${{ inputs.metomi_rose_tag || steps.get_tag.outputs.rose }}
114120
cylc_rose: ${{ inputs.cylc_rose_tag || steps.get_tag.outputs.cylc_rose }}
115121
run: |
116-
REQS=requirement.txt
117-
touch "$REQS"
122+
ARGS=()
123+
124+
if [[ ${{ inputs.editable_installations }} == true ]]; then
125+
EDITABLE="--editable"
126+
else
127+
EDITABLE=''
128+
fi
129+
118130
if [[ ${{ inputs.cylc_flow }} == true ]]; then
119-
echo \
120-
"cylc-flow[${{ inputs.cylc_flow_opts }}] @ git+https://github.com/${{ inputs.cylc_flow_repo }}@${cylc_flow}" \
121-
>> "$REQS"
131+
if [[ ${{ inputs.editable_installations }} == true ]]; then
132+
ARGS+=("--editable")
133+
fi
134+
ARGS+=("git+https://github.com/${{ inputs.cylc_flow_repo }}@${cylc_flow}#egg=cylc-flow[${{ inputs.cylc_flow_opts }}]")
122135
fi
123136
if [[ ${{ inputs.cylc_uiserver }} == true ]]; then
124-
echo \
125-
"cylc-uiserver[${{ inputs.cylc_uiserver_opts }}] @ git+https://github.com/${{ inputs.cylc_uiserver_repo }}@${cylc_uis}" \
126-
>> "$REQS"
137+
if [[ ${{ inputs.editable_installations }} == true ]]; then
138+
ARGS+=("--editable")
139+
fi
140+
ARGS+=("git+https://github.com/${{ inputs.cylc_uiserver_repo }}@${cylc_uiserver}#egg=cylc-uiserver[${{ inputs.cylc_uiserver_opts }}]")
127141
fi
128142
if [[ ${{ inputs.metomi_rose }} == true ]]; then
129-
echo \
130-
"metomi-rose[${{ inputs.metomi_rose_opts }}] @ git+https://github.com/${{ inputs.metomi_rose_repo }}@${meto_rose}" \
131-
>> "$REQS"
143+
if [[ ${{ inputs.editable_installations }} == true ]]; then
144+
ARGS+=("--editable")
145+
fi
146+
ARGS+=("git+https://github.com/${{ inputs.metomi_rose_repo }}@${metomi_rose}#egg=metomi-rose[${{ inputs.metomi_rose_opts }}]")
132147
fi
133148
if [[ ${{ inputs.cylc_rose }} == true ]]; then
134-
echo \
135-
"cylc-rose[${{ inputs.cylc_rose_opts }}] @ git+https://github.com/${{ inputs.cylc_rose_repo }}@${cylc_rose}" \
136-
>> "$REQS"
149+
if [[ ${{ inputs.editable_installations }} == true ]]; then
150+
ARGS+=("--editable")
151+
fi
152+
ARGS+=("git+https://github.com/${{ inputs.cylc_rose_repo }}@${cylc_rose}#egg=cylc-rose[${{ inputs.cylc_rose_opts }}]")
137153
fi
138154
139-
cat "$REQS"
140-
pip install -r "$REQS"
155+
echo "${ARGS[@]}"
156+
pip install "${ARGS[@]}"

0 commit comments

Comments
 (0)