Skip to content

Commit

Permalink
feat: python 3.12 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeemshahzad committed Oct 17, 2024
1 parent a3047ef commit c4fb760
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions playbooks/roles/edx_django_service/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edx_django_service_home: '{{ COMMON_APP_DIR }}/{{ edx_django_service_name }}'
edx_django_service_user: '{{ edx_django_service_name }}'
edx_django_service_use_python3: true
edx_django_service_use_python38: false
edx_django_service_use_python312: false

# This should be overwritten at the time Ansible is run.
edx_django_service_is_devstack: false
Expand Down
25 changes: 25 additions & 0 deletions playbooks/roles/edx_django_service/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@
- install
- install:configuration

- name: install python3.12
apt:
pkg:
- python3.12-dev
- python3.12-distutils
update_cache: yes
register: install_pkgs
until: install_pkgs is success
retries: 10
delay: 5
when: edx_django_service_use_python312 and not edx_django_service_enable_experimental_docker_shim
tags:
- install
- install:system-requirements

- name: install python3.8
apt:
pkg:
Expand Down Expand Up @@ -92,6 +107,16 @@
- install
- install:system-requirements

- name: build virtualenv with python3.12
command: "virtualenv --python=python3.12 {{ edx_django_service_venv_dir }}"
args:
creates: "{{ edx_django_service_venv_dir }}/bin/pip"
become_user: "{{ edx_django_service_user }}"
when: edx_django_service_use_python312 and not edx_django_service_enable_experimental_docker_shim
tags:
- install
- install:system-requirements

- name: build virtualenv with python3.8
command: "virtualenv --python=python3.8 {{ edx_django_service_venv_dir }}"
args:
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/edx_service/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ edx_service_local_config_file: "{{ UNENCRYPTED_CFG_DIR }}/{{ edx_service_name }}
edx_service_decrypt_config_enabled: false
edx_service_copy_config_enabled: false

edx_service_use_python312: false
edx_service_use_python38: false
edx_service_use_python3: false
edx_service_venv_dir: "{{ edx_service_home }}/venvs/{{ edx_service_name }}"
25 changes: 25 additions & 0 deletions playbooks/roles/edx_service/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@
- install:configuration
- install:app-configuration

- name: Install Python 3.12
apt:
pkg:
- python3.12-dev
- python3.12-distutils
update_cache: yes
register: install_pkgs
until: install_pkgs is success
retries: 10
delay: 5
when: edx_service_use_python312
tags:
- install
- install:system-requirements

- name: Install Python 3.8
apt:
pkg:
Expand Down Expand Up @@ -161,6 +176,16 @@
- install
- install:system-requirements

- name: Build virtualenv with Python 3.12
command: "virtualenv --python=python3.12 {{ edx_service_venv_dir }}"
args:
creates: "{{ edx_service_venv_dir }}/bin/pip"
become_user: "{{ edx_service_user }}"
when: edx_service_use_python312
tags:
- install
- install:system-requirements

- name: Build virtualenv with Python 3.8
command: "virtualenv --python=python3.8 {{ edx_service_venv_dir }}"
args:
Expand Down

0 comments on commit c4fb760

Please sign in to comment.