Use prebuilt Python 3.11 instead of building Python 3.9

Closes tildes-community/tildes-cf#14

See merge request tildes-community/tildes-cf!8
This commit is contained in:
talklittle
2025-01-17 11:12:20 +00:00
committed by Deimos
parent 58784c4465
commit 4210b1e3e8
20 changed files with 90 additions and 115 deletions
+6 -52
View File
@@ -1,56 +1,10 @@
---
- name: Check if the correct version of Python is already installed
stat:
path: /usr/local/bin/python{{ python_version }}
register: python_binary
- name: Download and install Python
when: not python_binary.stat.exists
block:
- name: Download Python source code
get_url:
dest: /tmp/python.tar.gz
url: https://www.python.org/ftp/python/{{ python_full_version }}/Python-{{ python_full_version }}.tgz
checksum: sha256:1e71f006222666e0a39f5a47be8221415c22c4dd8f25334cc41aee260b3d379e
- name: Create temp directory to extract Python to
file:
path: /tmp/python
state: directory
- name: Extract Python
unarchive:
remote_src: true
src: /tmp/python.tar.gz
dest: /tmp/python
extra_opts:
- --strip-components=1
- name: Install build dependencies for Python
apt:
name:
- make
- build-essential
- libssl-dev
- zlib1g-dev
- libbz2-dev
- libreadline-dev
- libsqlite3-dev
- wget
- curl
- llvm
- libncurses5-dev
- libncursesw5-dev
- xz-utils
- tk-dev
- name: Build and install Python (this can take a long time)
shell:
chdir: /tmp/python
cmd: |
./configure --enable-optimizations --with-ensurepip=install
make
make altinstall
- name: Install Python and dependencies needed by packages
apt:
name:
- python{{ python_version }}
- python{{ python_version }}-venv
- libgit2-dev
- name: Create dir for venvs
file: