Skip to content

Commit

Permalink
Install packages in a virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescurtin committed Oct 14, 2024
1 parent f5c0654 commit 1ce2165
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- A [problem matcher](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) so you can see issues without trawling through logs

### Fixed

- Packages are installed into a virtualenv due to the fact that system-wide
installs fail by default when run on newer versions of Python.

## [1.1.0] - 2022-11-04

- All inputs changed to use kebab-case: `isort-version`, `sort-paths`, and
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ runs:
steps:
- run: $GITHUB_ACTION_PATH/bin/ensure_python
shell: bash
- run: python -m venv "${HOME}/isort-venv"
shell: bash
- run: >
source "${HOME}/isort-venv/bin/activate"
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
- run: >
$GITHUB_ACTION_PATH/bin/install_packages
${{ inputs.isort-version || inputs.isortVersion }}
Expand Down
1 change: 1 addition & 0 deletions bin/install_packages
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ isort_version=$1
requirements_files=$2

echo "::group::Install isort"

if [ -z "$isort_version" ] || [ "$isort_version" == "latest" ]; then
echo "Installing latest version of isort"
python3 -m pip install "isort[requirements_deprecated_finder,pipfile_deprecated_finder]"
Expand Down

0 comments on commit 1ce2165

Please sign in to comment.