Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
split regular and nonhashed requirements install steps (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas authored Feb 22, 2024
1 parent e65bc2f commit 611c6fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/

## [Unreleased]

### Fixed

- Fixed a bug where hashed and non-hashed requirements could not be installed together with the same `pip` command.

## [0.4.1]

### Fixed
Expand Down
18 changes: 6 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,18 @@ runs:
python -m pip install -U pip
INSTALL_ARGS=""
if [ -n "${{ inputs.python-requirements }}" ]; then
IFS=',' read -ra REQ_FILES <<< "${{ inputs.python-requirements }}"
for REQ_FILE in "${REQ_FILES[@]}"; do
INSTALL_ARGS="$INSTALL_ARGS -r $REQ_FILE"
done
fi
if [ -n "${{ inputs.python-requirements-nohash }}" ]; then
IFS=',' read -ra NOHASH_REQ_FILES <<< "${{ inputs.python-requirements-nohash }}"
for NOHASH_REQ_FILE in "${NOHASH_REQ_FILES[@]}"; do
INSTALL_ARGS="$INSTALL_ARGS -r $NOHASH_REQ_FILE"
done
INSTALL_ARGS+="$(echo "${{ inputs.python-requirements }}" | sed "s/,/ -r /g" | sed 's/^/-r /')"
fi
if [ -n "${{ inputs.extra-python-dependencies }}" ]; then
EXTRA_DEPS=$(echo "${{ inputs.extra-python-dependencies }}" | tr ',' ' ')
INSTALL_ARGS="$INSTALL_ARGS $EXTRA_DEPS"
INSTALL_ARGS+=" $(echo "${{ inputs.extra-python-dependencies }}" | tr ',' ' ')"
fi
if [ -n "$INSTALL_ARGS" ]; then
python -m pip install --no-warn-script-location $INSTALL_ARGS
fi
if [ -n "${{ inputs.python-requirements-nohash }}" ]; then
NOHASH_REQ_FILES_ARG="-r $(echo "${{ inputs.python-requirements-nohash }}" | sed "s/,/ -r /g")"
python -m pip install --no-warn-script-location $NOHASH_REQ_FILES_ARG
fi
- name: Install Node.js dependencies
if: ${{ inputs.node-version }}
Expand Down

0 comments on commit 611c6fc

Please sign in to comment.