Skip to content

Commit 6c413c1

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

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

install-cylc-components/action.yml

Lines changed: 20 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,26 @@ 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+
ARGS+=("${EDITABLE:}" "git+https://github.com/${{ inputs.cylc_flow_repo }}@${cylc_flow}#egg=cylc-flow[${{ inputs.cylc_flow_opts }}]")
122132
fi
123133
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"
134+
ARGS+=("${EDITABLE}" "git+https://github.com/${{ inputs.cylc_uiserver_repo }}@${cylc_uiserver}#egg=cylc-uiserver[${{ inputs.cylc_uiserver_opts }}]")
127135
fi
128136
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"
137+
ARGS+=("${EDITABLE}" "git+https://github.com/${{ inputs.metomi_rose_repo }}@${metomi_rose}#egg=metomi-rose[${{ inputs.metomi_rose_opts }}]")
132138
fi
133139
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"
140+
ARGS+=("${EDITABLE}" "git+https://github.com/${{ inputs.cylc_rose_repo }}@${cylc_rose}#egg=cylc-rose[${{ inputs.cylc_rose_opts }}]")
137141
fi
138142
139-
cat "$REQS"
140-
pip install -r "$REQS"
143+
echo "${ARGS[@]}"
144+
pip install "${ARGS[@]}"

0 commit comments

Comments
 (0)