Skip to content

Commit

Permalink
Merge pull request #320 from edx/python312-upgrade
Browse files Browse the repository at this point in the history
feat!: Python 3.12 Upgrade
  • Loading branch information
varshamenon4 authored Sep 19, 2024
2 parents 1b76cf3 + 4e6a490 commit 87aa3f5
Show file tree
Hide file tree
Showing 15 changed files with 247 additions and 397 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: ['3.11']
python-version: ['3.12']
toxenv: [django42, quality, pii_check]

steps:
Expand All @@ -38,7 +38,7 @@ jobs:
run: tox

- name: Run coverage
if: matrix.python-version == '3.11' && matrix.toxenv == 'django42'
if: matrix.python-version == '3.12' && matrix.toxenv == 'django42'
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-python-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master
with:
branch: ${{ github.event.inputs.branch || 'main' }}
python_version: "3.8"
python_version: "3.12"
# optional parameters below; fill in if you'd like github or email notifications
# user_reviewers: ""
# team_reviewers: ""
Expand Down
33 changes: 29 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,50 @@ MAINTAINER [email protected]

# make; necessary to provision the container

# ENV variables for Python 3.12 support
ARG PYTHON_VERSION=3.12
ENV TZ=UTC
ENV TERM=xterm-256color
ENV DEBIAN_FRONTEND=noninteractive

# software-properties-common is needed to setup Python 3.12 env
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-add-repository -y ppa:deadsnakes/ppa

# If you add a package here please include a comment above describing what it is used for
RUN apt-get update && apt-get -qy install --no-install-recommends \
build-essential \
language-pack-en \
locales \
python3.8 \
python3-pip \
libmysqlclient-dev \
pkg-config \
libssl-dev \
python3-dev \
gcc \
make \
git
git \
curl \
python3-pip \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
python${PYTHON_VERSION}-distutils

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN pip install --upgrade pip setuptools
# delete apt package lists because we do not need them inflating our image
RUN rm -rf /var/lib/apt/lists/*

# need to use virtualenv pypi package with Python 3.12
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION}
RUN pip install virtualenv

# Create virtual environment with Python 3.12
ENV VIRTUAL_ENV=/edx/venvs/edx-exams
RUN virtualenv -p python${PYTHON_VERSION} $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# python is python3
RUN ln -s /usr/bin/python3 /usr/bin/python

RUN locale-gen en_US.UTF-8
Expand Down
45 changes: 19 additions & 26 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
Expand All @@ -10,24 +10,22 @@ asgiref==3.8.1
# via
# django
# django-cors-headers
async-timeout==4.0.3
# via redis
attrs==24.2.0
# via
# -r requirements/base.in
# lti-consumer-xblock
# openedx-events
bleach==6.1.0
# via lti-consumer-xblock
boto3==1.35.9
boto3==1.35.22
# via fs-s3fs
botocore==1.35.9
botocore==1.35.22
# via
# boto3
# s3transfer
certifi==2024.8.30
# via requests
cffi==1.17.0
cffi==1.17.1
# via
# cryptography
# pynacl
Expand All @@ -45,15 +43,15 @@ coreapi==2.3.3
# openapi-codec
coreschema==0.0.4
# via coreapi
cryptography==43.0.0
cryptography==43.0.1
# via
# pyjwt
# social-auth-core
defusedxml==0.8.0rc2
# via
# python3-openid
# social-auth-core
django==4.2.15
django==4.2.16
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
Expand Down Expand Up @@ -99,7 +97,7 @@ django-extensions==3.2.3
# via -r requirements/base.in
django-filter==24.3
# via lti-consumer-xblock
django-model-utils==4.5.1
django-model-utils==5.0.0
# via -r requirements/base.in
django-rest-swagger==2.2.0
# via -r requirements/base.in
Expand Down Expand Up @@ -128,9 +126,9 @@ drf-jwt==1.19.2
# via edx-drf-extensions
drf-yasg==1.21.7
# via edx-api-doc-tools
edx-api-doc-tools==1.8.0
edx-api-doc-tools==2.0.0
# via -r requirements/base.in
edx-auth-backends==4.3.0
edx-auth-backends==4.4.0
# via -r requirements/base.in
edx-ccx-keys==1.3.0
# via
Expand All @@ -148,28 +146,28 @@ edx-django-utils==5.15.0
# edx-rest-api-client
# edx-toggles
# openedx-events
edx-drf-extensions==10.3.0
edx-drf-extensions==10.4.0
# via -r requirements/base.in
edx-event-bus-kafka==5.8.1
# via -r requirements/base.in
edx-event-bus-redis==0.5.0
# via -r requirements/base.in
edx-opaque-keys[django]==2.10.0
edx-opaque-keys[django]==2.11.0
# via
# -r requirements/base.in
# edx-ccx-keys
# edx-drf-extensions
# lti-consumer-xblock
# openedx-events
edx-rest-api-client==5.7.1
edx-rest-api-client==6.0.0
# via -r requirements/base.in
edx-toggles==5.2.0
# via
# edx-event-bus-kafka
# edx-event-bus-redis
edx-token-utils==0.2.1
# via -r requirements/base.in
fastavro==1.9.5
fastavro==1.9.7
# via openedx-events
fs==2.4.16
# via
Expand All @@ -180,7 +178,7 @@ fs-s3fs==1.1.1
# via openedx-django-pyfs
future==1.0.0
# via pyjwkest
idna==3.8
idna==3.10
# via requests
inflection==0.5.1
# via drf-yasg
Expand Down Expand Up @@ -226,7 +224,7 @@ openapi-codec==1.3.2
# via django-rest-swagger
openedx-django-pyfs==3.7.0
# via lti-consumer-xblock
openedx-events==9.12.0
openedx-events==9.14.1
# via
# -r requirements/base.in
# edx-event-bus-kafka
Expand Down Expand Up @@ -258,7 +256,7 @@ pyjwt[crypto]==2.9.0
# social-auth-core
pymemcache==4.0.0
# via -r requirements/base.in
pymongo==4.8.0
pymongo==4.9.1
# via edx-opaque-keys
pynacl==1.5.0
# via edx-django-utils
Expand All @@ -270,7 +268,7 @@ python-slugify==8.0.4
# via code-annotations
python3-openid==3.2.0
# via social-auth-core
pytz==2024.1
pytz==2024.2
# via
# -r requirements/base.in
# drf-yasg
Expand All @@ -290,7 +288,6 @@ requests==2.32.3
# edx-rest-api-client
# pyjwkest
# requests-oauthlib
# slumber
# social-auth-core
requests-oauthlib==2.0.0
# via social-auth-core
Expand All @@ -312,8 +309,6 @@ six==1.16.0
# fs-s3fs
# pyjwkest
# python-dateutil
slumber==0.7.1
# via edx-rest-api-client
social-auth-app-django==5.4.2
# via edx-auth-backends
social-auth-core==4.5.4
Expand All @@ -330,14 +325,12 @@ stevedore==5.3.0
text-unidecode==1.3
# via python-slugify
typing-extensions==4.12.2
# via
# asgiref
# edx-opaque-keys
# via edx-opaque-keys
uritemplate==4.1.1
# via
# coreapi
# drf-yasg
urllib3==1.26.20
urllib3==2.2.3
# via
# botocore
# requests
Expand Down
16 changes: 6 additions & 10 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# make upgrade
Expand All @@ -14,27 +14,23 @@ coverage==7.6.1
# via -r requirements/ci.in
distlib==0.3.8
# via virtualenv
filelock==3.15.4
filelock==3.16.1
# via
# tox
# virtualenv
packaging==24.1
# via
# pyproject-api
# tox
platformdirs==4.2.2
platformdirs==4.3.6
# via
# tox
# virtualenv
pluggy==1.5.0
# via tox
pyproject-api==1.7.1
pyproject-api==1.8.0
# via tox
tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.18.0
tox==4.20.0
# via -r requirements/ci.in
virtualenv==20.26.3
virtualenv==20.26.5
# via tox
Loading

0 comments on commit 87aa3f5

Please sign in to comment.