-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'AcademySoftwareFoundation:master' into master
- Loading branch information
Showing
14 changed files
with
346 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Setup python | ||
|
||
description: Setup python using either actions/setup-pythono or conda | ||
|
||
inputs: | ||
python-version: | ||
description: Python version to setup | ||
required: true | ||
os: | ||
description: os | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up Python ${{ inputs.python-version }} with actions/setup-python | ||
if: ${{ inputs.python-version != '2.7' }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
# Conda comes pre-installed with the GitHub hosted runners. | ||
- name: Create conda environment | ||
if: ${{ inputs.python-version == '2.7' }} | ||
shell: bash | ||
run: | | ||
if [[ "${OSTYPE}" == "msys" ]]; then | ||
eval "$(/c/Miniconda/condabin/conda.bat shell.bash hook)" | ||
else | ||
eval "$(conda shell.bash hook)" | ||
fi | ||
conda create -n python python=2.7 setuptools wheel | ||
- name: Fix conda installed python | ||
if: inputs.python-version == '2.7' && (startsWith(inputs.os, 'ubuntu') || startsWith(inputs.os, 'macos')) | ||
shell: bash -el {0} | ||
run: | | ||
set -ex | ||
eval "$(conda shell.bash hook)" | ||
conda activate python | ||
conda info | ||
if [[ "${{ inputs.os }}" = macos* ]]; then | ||
install_name_tool -change @rpath/libpython2.7.dylib $(dirname $(which python))/../lib/libpython2.7.dylib $(which python) | ||
else | ||
sudo apt-get install patchelf | ||
# This will allow virtualenv to work correctly. | ||
# Basically, Python provided by conda is "fully portable". Its default | ||
# RPATH is "$ORIGIN/../lib". The problem is that once the virtualenv | ||
# is created, the copied/symlinked interpreter in the venv won't be | ||
# able to load lib since the lib folder isn't copied in the venv. | ||
patchelf --set-rpath $(dirname $(which python))/../lib $(which python) | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.