File tree Expand file tree Collapse file tree 4 files changed +22
-11
lines changed Expand file tree Collapse file tree 4 files changed +22
-11
lines changed Original file line number Diff line number Diff line change 1+ name : Test
2+
13on : [ push ]
24
35jobs :
Original file line number Diff line number Diff line change 1+ # Contributing
2+
13## Context
24
35This action is built as a composite action, for more details kindly refer
Original file line number Diff line number Diff line change 1- name : ' Setup python amazon linux'
1+ name : ' Setup python on amazon linux'
22description : ' Adds support to install python in amazon linux'
33inputs :
44 python-version :
@@ -11,6 +11,13 @@ inputs:
1111runs :
1212 using : " composite"
1313 steps :
14+ - name : Ensure dependencies of python are installed
15+ shell : bash
16+ run : |
17+ sudo yum groupinstall -y "Development Tools"
18+ sudo yum install -y gcc openssl-devel bzip2-devel libffi-devel
19+ sudo yum install -y tar gzip wget
20+
1421 - name : Find exact python version
1522 id : find-exact-python-version
1623 shell : bash
4754 shell : bash
4855 run : |
4956 installation_directory=${{ steps.set-installation-directory.outputs.installation_directory }}
50- echo "${installation_directory}/bin" >> ${GITHUB_PATH}
57+ echo "${installation_directory}/bin" >> "${GITHUB_PATH}"
58+
59+ echo "The following python binaries are now available in the PATH"
60+ ls "${installation_directory}/bin"
61+
62+ echo "Linking python libraries.."
63+ ls "${installation_directory}/lib"
64+ ldconfig "${installation_directory}/lib"
5165
5266branding :
5367 icon : ' code'
Original file line number Diff line number Diff line change @@ -4,12 +4,6 @@ set -euo pipefail
44
55# Follows the guidelines from https://realpython.com/installing-python/#how-to-build-python-from-source-code
66
7- function setup_build_prerequisites() {
8- sudo yum groupinstall -y " Development Tools"
9- sudo yum install -y tar gzip wget
10- sudo yum install -y gcc openssl-devel bzip2-devel libffi-devel
11- }
12-
137function set_aliases() {
148 ln -sf " ${python_installation_dir} /bin/python3" " ${python_installation_dir} /bin/python"
159 ln -sf " ${python_installation_dir} /bin/pip3" " ${python_installation_dir} /bin/pip"
@@ -19,15 +13,14 @@ function setup_python() {
1913 python_version=" $1 "
2014 python_installation_dir=" $2 "
2115
22- setup_build_prerequisites
23-
2416 mkdir -p " ${python_installation_dir} "
2517 temp_dir=$( mktemp -d)
2618 pushd " ${temp_dir} " > /dev/null
2719 wget " https://www.python.org/ftp/python/${python_version} /Python-${python_version} .tgz"
2820 tar -zxf " Python-${python_version} .tgz"
2921 pushd " Python-${python_version} " > /dev/null
30- ./configure --enable-optimizations --prefix=" ${python_installation_dir} "
22+ # Have not added --enable-optimizations flag because that shoots up the build time by ~5 minutes
23+ ./configure --prefix=" ${python_installation_dir} " --enable-shared
3124 make -j 8
3225 make install
3326 popd > /dev/null
You can’t perform that action at this time.
0 commit comments