Skip to content

Commit

Permalink
Refactor nm-actions/install-whl
Browse files Browse the repository at this point in the history
This refactor reduces complexity (simpler conditional construct) and
groups output.
  • Loading branch information
dbarbuzzi committed Nov 14, 2024
1 parent c8d2034 commit f2faeb9
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions actions/install-whl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@ runs:
using: composite
steps:
- id: install_whl
env:
VENV: ${{ inputs.venv }}
NAME: ${{ inputs.name }}
EXTRA: ${{ inputs.extra }}
run: |
source ${{ inputs.venv }}/bin/activate
python --version
WHL=$(find . -type f -iname "${{ inputs.name }}*.whl")
if [ ! -z "${{ inputs.extra }}" ]; then
pip install ${WHL}${{ inputs.extra }}
else
pip install ${WHL}
source "$VENV/bin/activate"
whl=$(find . -type f -iname "$NAME*.whl")
if [ -n "$EXTRA" ]; then
whl="$whl$EXTRA"
fi
version=$(pip freeze | grep "${{ inputs.name }}")
echo "installed ${version}"
echo "::group::pip install $whl"
pip install "$whl"
version=$(pip freeze | grep "$NAME")
echo "installed $version"
echo "::endgroup::"
shell: bash

0 comments on commit f2faeb9

Please sign in to comment.