Skip to content

Commit 9fbc8fc

Browse files
authored
Merge pull request #24 from gforcada/python-313
Add python 3.13
2 parents 11124f9 + 0a69842 commit 9fbc8fc

File tree

8 files changed

+186
-154
lines changed

8 files changed

+186
-154
lines changed

ansible.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
roles:
44
- ansible-compile-python
55
vars:
6-
- python_24: true
7-
- python_26: true
8-
- pillow: true
9-
- lxml: true
6+
python_24: true
7+
python_26: true
8+
pillow: true
9+
lxml: true

defaults/main.yml

+36-23
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ python_39: false
1818
python_310: false
1919
python_311: false
2020
python_312: true
21+
python_313: false
2122

2223
pillow: false
2324
lxml: false
@@ -38,6 +39,7 @@ versions:
3839
py310: "3.10.14"
3940
py311: "3.11.9"
4041
py312: "3.12.3"
42+
py313: "3.13.0b1" # on a final release, the url path needs to be adjusted
4143

4244
hashes:
4345
py24: "76083277f6c7e4d78992f36d7ad9018d"
@@ -55,6 +57,7 @@ hashes:
5557
py310: "05148354ce821ba7369e5b7958435400"
5658
py311: "22ea467e7d915477152e99d5da856ddc"
5759
py312: "8defb33f0c37aa4bdd3a38ba52abde4e"
60+
py313: "e1208b22c67c77de72a5e20025b2fb53"
5861

5962
venv_versions:
6063
py24: "1.7.2"
@@ -68,6 +71,30 @@ base_install_folder: "/srv"
6871
ftp_url: "https://www.python.org/ftp/python"
6972
pkg_url: "https://files.pythonhosted.org/packages"
7073

74+
venv24:
75+
version: "{{ venv_versions.py24 }}"
76+
file_hash: "7b88d35d0a353ec70e42aa37fd8b0bd1c643419c80f022ffaafa4d6449f0"
77+
url: "{{ pkg_url }}/16/86/{{ file_hash }}/virtualenv-1.7.2.tar.gz"
78+
md5: "b5d63b05373a4344ae099a68875aae78"
79+
tar_file: "/tmp/virtualenv-{{ venv_versions.py24 }}.tar.gz"
80+
sources: "/tmp/virtualenv-{{ venv_versions.py24 }}"
81+
82+
venv26:
83+
version: "{{ venv_versions.py26 }}"
84+
file_hash: "f425e456e017af4801bb08920e30c149a44ac0c194f2225bdb712e77701c"
85+
url: "{{ pkg_url }}/d5/5b/{{ file_hash }}/virtualenv-1.10.tar.gz"
86+
md5: "9745c28256c70c76d36adb3767a00212"
87+
tar_file: "/tmp/virtualenv-{{ venv_versions.py26 }}.tar.gz"
88+
sources: "/tmp/virtualenv-{{ venv_versions.py26 }}"
89+
90+
venv27:
91+
version: "{{ venv_versions.py27 }}"
92+
file_hash: "706af3ee62032933a3217454609c50a5325a6bd9c2c2f495b58c456ba286"
93+
url: "{{ pkg_url }}/37/27/{{ file_hash }}/virtualenv-16.6.1.tar.gz"
94+
md5: "b05b03dc6ecb3caaa3d58bfcccf4e786"
95+
tar_file: "/tmp/virtualenv-{{ venv_versions.py27 }}.tar.gz"
96+
sources: "/tmp/virtualenv-{{ venv_versions.py27 }}"
97+
7198
py24:
7299
version: "{{ versions.py24 }}"
73100
major_version: "2.4"
@@ -218,26 +245,12 @@ py312:
218245
install: "{{ base_install_folder }}/python{{ versions.py312 }}"
219246
bin: "{{ base_install_folder }}/python{{ versions.py312 }}/bin/python3.12"
220247

221-
venv24:
222-
version: "{{ venv_versions.py24 }}"
223-
file_hash: "7b88d35d0a353ec70e42aa37fd8b0bd1c643419c80f022ffaafa4d6449f0"
224-
url: "{{ pkg_url }}/16/86/{{ file_hash }}/virtualenv-1.7.2.tar.gz"
225-
md5: "b5d63b05373a4344ae099a68875aae78"
226-
tar_file: "/tmp/virtualenv-{{ venv_versions.py24 }}.tar.gz"
227-
sources: "/tmp/virtualenv-{{ venv_versions.py24 }}"
228-
229-
venv26:
230-
version: "{{ venv_versions.py26 }}"
231-
file_hash: "f425e456e017af4801bb08920e30c149a44ac0c194f2225bdb712e77701c"
232-
url: "{{ pkg_url }}/d5/5b/{{ file_hash }}/virtualenv-1.10.tar.gz"
233-
md5: "9745c28256c70c76d36adb3767a00212"
234-
tar_file: "/tmp/virtualenv-{{ venv_versions.py26 }}.tar.gz"
235-
sources: "/tmp/virtualenv-{{ venv_versions.py26 }}"
236-
237-
venv27:
238-
version: "{{ venv_versions.py27 }}"
239-
file_hash: "706af3ee62032933a3217454609c50a5325a6bd9c2c2f495b58c456ba286"
240-
url: "{{ pkg_url }}/37/27/{{ file_hash }}/virtualenv-16.6.1.tar.gz"
241-
md5: "b05b03dc6ecb3caaa3d58bfcccf4e786"
242-
tar_file: "/tmp/virtualenv-{{ venv_versions.py27 }}.tar.gz"
243-
sources: "/tmp/virtualenv-{{ venv_versions.py27 }}"
248+
py313:
249+
version: "{{ versions.py313 }}"
250+
major_version: "3.13"
251+
url: "{{ ftp_url }}/3.13.0/Python-{{ versions.py313 }}.tar.xz"
252+
md5: "{{ hashes.py313 }}"
253+
tar_file: "/tmp/py{{ versions.py313 }}.tar.xz"
254+
sources: "/tmp/Python-{{ versions.3.13 }}"
255+
install: "{{ base_install_folder }}/python{{ versions.3.13 }}"
256+
bin: "{{ base_install_folder }}/python{{ versions.3.13 }}/bin/python3.13"

tasks/main.yml

+6-118
Original file line numberDiff line numberDiff line change
@@ -3,126 +3,14 @@
33
- name: Install dependencies
44
ansible.builtin.import_tasks: deps.yml
55

6-
- name: Install Python 2.4
7-
ansible.builtin.import_tasks: python24.yml
6+
- name: Install Python 2.x
7+
ansible.builtin.import_tasks: python2x.yml
88

9-
- name: Install Python 2.6
10-
ansible.builtin.import_tasks: python26.yml
9+
- name: Install Python 3.x
10+
ansible.builtin.import_tasks: python3x.yml
1111

12-
- name: Install Python 2.7
13-
ansible.builtin.include_tasks:
14-
file: python_generic.yml
15-
vars:
16-
py_data: "{{ py27 }}"
17-
when: python_27
18-
19-
- name: Install Python 3.1
20-
ansible.builtin.include_tasks:
21-
file: python_generic.yml
22-
vars:
23-
py_data: "{{ py31 }}"
24-
when: python_31
25-
26-
- name: Install Python 3.2
27-
ansible.builtin.include_tasks:
28-
file: python_generic.yml
29-
vars:
30-
py_data: "{{ py32 }}"
31-
when: python_32
32-
33-
- name: Install Python 3.3
34-
ansible.builtin.include_tasks:
35-
file: python_generic.yml
36-
vars:
37-
py_data: "{{ py33 }}"
38-
when: python_33
39-
40-
- name: Install Python 3.4
41-
ansible.builtin.include_tasks:
42-
file: python_generic.yml
43-
vars:
44-
py_data: "{{ py34 }}"
45-
when: python_34
46-
47-
- name: Install Python 3.5
48-
ansible.builtin.include_tasks:
49-
file: python_generic.yml
50-
vars:
51-
py_data: "{{ py35 }}"
52-
when: python_35
53-
54-
- name: Install Python 3.6
55-
ansible.builtin.include_tasks:
56-
file: python_generic.yml
57-
vars:
58-
py_data: "{{ py36 }}"
59-
when: python_36
60-
61-
- name: Install Python 3.7
62-
ansible.builtin.include_tasks:
63-
file: python_generic.yml
64-
vars:
65-
py_data: "{{ py37 }}"
66-
when: python_37
67-
68-
- name: Install Python 3.8
69-
ansible.builtin.include_tasks:
70-
file: python_generic.yml
71-
vars:
72-
py_data: "{{ py38 }}"
73-
when: python_38
74-
75-
- name: Install Python 3.9
76-
ansible.builtin.include_tasks:
77-
file: python_generic.yml
78-
vars:
79-
py_data: "{{ py39 }}"
80-
when: python_39
81-
82-
- name: Install Python 3.10
83-
ansible.builtin.include_tasks:
84-
file: python_generic.yml
85-
vars:
86-
py_data: "{{ py310 }}"
87-
when: python_310
88-
89-
- name: Install Python 3.11
90-
ansible.builtin.include_tasks:
91-
file: python_generic.yml
92-
vars:
93-
py_data: "{{ py311 }}"
94-
when: python_311
95-
96-
- name: Install Python 3.12
97-
ansible.builtin.include_tasks:
98-
file: python_generic.yml
99-
vars:
100-
py_data: py312
101-
when: python_312
102-
103-
- name: Install Virtualenv for Python 2.4
104-
ansible.builtin.include_tasks:
105-
file: venv.yml
106-
vars:
107-
py_data: py24
108-
venv_data: venv24
109-
when: python_24
110-
111-
- name: Install Virtualenv for Python 2.6
112-
ansible.builtin.include_tasks:
113-
file: venv.yml
114-
vars:
115-
py_data: py26
116-
venv_data: venv26
117-
when: python_26
118-
119-
- name: Install Virtualenv for Python 2.7
120-
ansible.builtin.include_tasks:
121-
file: venv.yml
122-
vars:
123-
py_data: py27
124-
venv_data: venv27
125-
when: python_27
12+
- name: Install virtualenvs
13+
ansible.builtin.import_tasks: venvs.yml
12614

12715
- name: Miscellaneous
12816
ansible.builtin.import_tasks: misc.yml

tasks/python2x.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
- name: Install Python 2.4
4+
ansible.builtin.import_tasks: python24.yml
5+
6+
- name: Install Python 2.6
7+
ansible.builtin.import_tasks: python26.yml
8+
9+
- name: Install Python 2.7
10+
ansible.builtin.include_tasks:
11+
file: python_generic.yml
12+
vars:
13+
py_data: "{{ py27 }}"
14+
when: python_27

tasks/python3x.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
3+
- name: Install Python 3.1
4+
ansible.builtin.include_tasks:
5+
file: python_generic.yml
6+
vars:
7+
py_data: "{{ py31 }}"
8+
when: python_31
9+
10+
- name: Install Python 3.2
11+
ansible.builtin.include_tasks:
12+
file: python_generic.yml
13+
vars:
14+
py_data: "{{ py32 }}"
15+
when: python_32
16+
17+
- name: Install Python 3.3
18+
ansible.builtin.include_tasks:
19+
file: python_generic.yml
20+
vars:
21+
py_data: "{{ py33 }}"
22+
when: python_33
23+
24+
- name: Install Python 3.4
25+
ansible.builtin.include_tasks:
26+
file: python_generic.yml
27+
vars:
28+
py_data: "{{ py34 }}"
29+
when: python_34
30+
31+
- name: Install Python 3.5
32+
ansible.builtin.include_tasks:
33+
file: python_generic.yml
34+
vars:
35+
py_data: "{{ py35 }}"
36+
when: python_35
37+
38+
- name: Install Python 3.6
39+
ansible.builtin.include_tasks:
40+
file: python_generic.yml
41+
vars:
42+
py_data: "{{ py36 }}"
43+
when: python_36
44+
45+
- name: Install Python 3.7
46+
ansible.builtin.include_tasks:
47+
file: python_generic.yml
48+
vars:
49+
py_data: "{{ py37 }}"
50+
when: python_37
51+
52+
- name: Install Python 3.8
53+
ansible.builtin.include_tasks:
54+
file: python_generic.yml
55+
vars:
56+
py_data: "{{ py38 }}"
57+
when: python_38
58+
59+
- name: Install Python 3.9
60+
ansible.builtin.include_tasks:
61+
file: python_generic.yml
62+
vars:
63+
py_data: "{{ py39 }}"
64+
when: python_39
65+
66+
- name: Install Python 3.10
67+
ansible.builtin.include_tasks:
68+
file: python_generic.yml
69+
vars:
70+
py_data: "{{ py310 }}"
71+
when: python_310
72+
73+
- name: Install Python 3.11
74+
ansible.builtin.include_tasks:
75+
file: python_generic.yml
76+
vars:
77+
py_data: "{{ py311 }}"
78+
when: python_311
79+
80+
- name: Install Python 3.12
81+
ansible.builtin.include_tasks:
82+
file: python_generic.yml
83+
vars:
84+
py_data: py312
85+
when: python_312
86+
87+
- name: Install Python 3.13
88+
ansible.builtin.include_tasks:
89+
file: python_generic.yml
90+
vars:
91+
py_data: py313
92+
when: python_313

tasks/python_generic.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
---
22

3-
- name: "{{ py_data.version }} | Check that it is still not installed"
3+
- name: "Python | Check that it is still not installed | {{ py_data.version }}"
44
become: true
55
ansible.builtin.stat:
66
path: "{{ py_data.bin }}"
77
register: already_installed
88
ignore_errors: true
99

10-
- name: "{{ py_data.version }} | Download"
10+
- name: "Python | Download | {{ py_data.version }}"
1111
ansible.builtin.get_url:
1212
url: "{{ py_data.url }}"
1313
dest: "{{ py_data.tar_file }}"
1414
checksum: "md5:{{ py_data.md5 }}"
1515
mode: "0440"
1616
when: not already_installed.stat.exists
1717

18-
- name: "{{ py_data.version }} | Uncompress"
18+
- name: "Python | Uncompress | {{ py_data.version }}"
1919
ansible.builtin.unarchive:
2020
src: "{{ py_data.tar_file }}"
2121
dest: /tmp
2222
copy: false
2323
creates: "{{ py_data.sources }}"
2424
when: not already_installed.stat.exists
2525

26-
- name: "{{ py_data.version }} | Compile and install"
26+
- name: "Python | Compile and install | {{ py_data.version }}"
2727
become: true
2828
ansible.builtin.command: "{{ item }}"
2929
args:
@@ -36,7 +36,7 @@
3636
register: output
3737
changed_when: output.rc != 0
3838

39-
- name: "{{ py_data.version }} | Create python_major_version symlink"
39+
- name: "Python | Create symlink | {{ py_data.version }}"
4040
become: true
4141
ansible.builtin.file:
4242
src: "{{ py_data.install }}"

0 commit comments

Comments
 (0)