Skip to content

Commit daa653f

Browse files
authored
fix:(r-python-julia): copy past install-python.sh from python-minimal into r-python-julia to fix test (#296)
1 parent 34aab64 commit daa653f

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

r-python-julia/scripts/install-python.sh

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,19 @@ apt_install \
2929
xz-utils \
3030
zlib1g-dev
3131

32-
# Install Python
32+
# Build Python from sources
3333
wget -q https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
3434
tar xzvf Python-${PYTHON_VERSION}.tgz
3535
cd Python-${PYTHON_VERSION}
3636
./configure \
37-
--enable-loadable-sqlite-extensions \
38-
--enable-optimizations \
39-
--enable-shared \
40-
--with-lto
41-
make -j4
37+
--prefix="${PYTHON_DIR}" \
38+
--enable-loadable-sqlite-extensions \
39+
--enable-optimizations \
40+
--enable-shared \
41+
--with-lto \
42+
LDFLAGS="-Wl,-rpath ${PYTHON_DIR}/lib"
43+
make -j"$(nproc)"
4244
make install
43-
ldconfig
44-
45-
# Useful symlinks
46-
ln -s /usr/local/bin/python3 /usr/local/bin/python
47-
ln -s /usr/local/bin/pip3 /usr/local/bin/pip
48-
49-
# Checks
50-
python --version
5145

5246
# Clean install files
5347
cd ..
@@ -56,6 +50,14 @@ apt-mark auto '.*' > /dev/null
5650
apt-mark manual $savedAptMark
5751
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
5852

59-
# Upgrade pip & install uv for further Python packages installation
53+
# Useful symlinks
54+
ln -sf "${PYTHON_DIR}/bin/python3" "${PYTHON_DIR}/bin/python"
55+
ln -sf "${PYTHON_DIR}/bin/pip3" "${PYTHON_DIR}/bin/pip"
56+
57+
# Checks
58+
python --version
59+
which python
60+
61+
# Upgrade pip & install uv
6062
pip install --no-cache-dir --upgrade pip
61-
pip install --no-cache-dir uv
63+
pip install --no-cache-dir uv

0 commit comments

Comments
 (0)