Skip to content

Commit

Permalink
Try installing Python manually if Ubuntu is 20.04 to update version
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd committed Sep 9, 2024
1 parent 7f7ed83 commit 6417ba8
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
fail-fast: false
matrix:
r: ["4.4"]
ubuntu: [22.04]
ubuntu: [20.04]
force-tests: ["true"]
env:
R: ${{ matrix.r }}
Expand Down
14 changes: 14 additions & 0 deletions ci/docker/linux-apt-python-3.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ COPY python/requirements-build.txt \
/arrow/python/

ENV ARROW_PYTHON_VENV /arrow-dev

ARG ubuntu
ARG python="3.12"
COPY ci/scripts/install_python.sh /arrow/ci/scripts/
RUN if [ "${ubuntu}" = "20.04" ]; then \
quiet=$([ "${DEBUG}" = "yes" ] || echo "-qq") && \
apt update ${quiet} && \
apt install -y -V ${quiet} \
xz-utils && \
apt clean && \
rm -rf /var/lib/apt/lists/* && \
/arrow/ci/scripts/install_python.sh linux ${python} \
; fi

RUN python3 -m venv ${ARROW_PYTHON_VENV} && \
. ${ARROW_PYTHON_VENV}/bin/activate && \
pip install -U pip setuptools wheel && \
Expand Down
24 changes: 24 additions & 0 deletions ci/scripts/install_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,32 @@ if [ $platform = "macOS" ]; then
python="/Library/Frameworks/Python.framework/Versions/${version}/bin/python${version}"
pip="${python} -m pip"

$python -m ensurepip
$pip install -U pip setuptools
elif [ $platform = "Linux" ] ; then
echo "Downloading Python installer..."

if [ "$version" = "3.13" ];
then
fname="Python-${full_version}rc1.tar.xz"
else
fname="Python-${full_version}.tar.xz"
fi
wget "https://www.python.org/ftp/python/${full_version}/${fname}"

echo "Building and installing Python..."
tar -xf ${fname}
rm $fname
pushd Python-3.*
./configure
make install
popd
python=/usr/local/bin/python3
pip="${python} -m pip"

$python -m ensurepip
$pip install -U pip setuptools
else
echo "Unsupported platform: $platform"
exit 1
fi
9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -984,14 +984,17 @@ services:
# Parameters:
# ARCH: amd64, arm64v8, ...
# UBUNTU: 20.04, 22.04
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-3
# PYTHON: 3.9, 3.10, ...
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-${PYTHON}
build:
context: .
dockerfile: ci/docker/linux-apt-python-3.dockerfile
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-3
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-${PYTHON}
args:
base: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp
ubuntu: ${UBUNTU}
python: ${PYTHON}
shm_size: *shm-size
environment:
<<: [*common, *ccache]
Expand Down Expand Up @@ -1521,6 +1524,8 @@ services:
tz: ${TZ}
r_prune_deps: ${R_PRUNE_DEPS}
r_duckdb_dev: ${R_DUCKDB_DEV:-}
ubuntu: ${UBUNTU}
python: ${PYTHON}
shm_size: *shm-size
environment:
<<: [*common, *ccache, *sccache]
Expand Down

0 comments on commit 6417ba8

Please sign in to comment.