File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,25 +29,19 @@ apt_install \
2929 xz-utils \
3030 zlib1g-dev
3131
32- # Install Python
32+ # Build Python from sources
3333wget -q https://www.python.org/ftp/python/${PYTHON_VERSION} /Python-${PYTHON_VERSION} .tgz
3434tar xzvf Python-${PYTHON_VERSION} .tgz
3535cd 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) "
4244make 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
5347cd ..
@@ -56,6 +50,14 @@ apt-mark auto '.*' > /dev/null
5650apt-mark manual $savedAptMark
5751apt-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
6062pip install --no-cache-dir --upgrade pip
61- pip install --no-cache-dir uv
63+ pip install --no-cache-dir uv
You can’t perform that action at this time.
0 commit comments