-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03cb6ee
commit aef927c
Showing
2 changed files
with
51 additions
and
3 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 |
---|---|---|
|
@@ -140,9 +140,10 @@ jobs: | |
service_account: ${{ secrets.SERVICE_ACCOUNT }} | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
run: | | ||
if python -V | grep -q -L '3.10'; then | ||
./examples/java/install_python.sh | ||
fi | ||
- name: 'Set up Cloud SDK' | ||
uses: 'google-github-actions/[email protected]' | ||
|
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,47 @@ | ||
#! /bin/bash | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# `-e` enables the script to automatically fail when a command fails | ||
set -ex | ||
|
||
sudo apt update | ||
|
||
# Install dependencies | ||
sudo apt install -y \ | ||
build-essential \ | ||
zlib1g-dev \ | ||
libncurses5-dev \ | ||
libgdbm-dev libnss3-dev \ | ||
libssl-dev \ | ||
libreadline-dev \ | ||
libffi-dev \ | ||
libsqlite3-dev \ | ||
wget \ | ||
libbz2-dev | ||
|
||
# Download Source Code | ||
wget https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tgz | ||
tar -xvf Python-3.10.0.tgz | ||
|
||
# Build from source | ||
cd Python-3.10.0 | ||
sudo ./configure --enable-optimizations | ||
sudo make -j "$(nproc)" | ||
sudo make altinstall | ||
|
||
|
||
update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1 | ||
update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip3.10 1 | ||
python --version |