Skip to content

feat: add Python 3.11 and Django 4.2 support - #27

Merged
alenkadev merged 1 commit into
edx:masterfrom
alenkadev:alenka/LP-1282-python-3.11-support
Oct 13, 2026
Merged

alenkadev merged 1 commit into
edx:masterfrom
alenkadev:alenka/LP-1282-python-3.11-support

Conversation

@alenkadev

Copy link
Copy Markdown
Contributor

LP-1282: Add Python 3.11 and Django 4.2 support

Why: edxapp (LMS) runs Python 3.11 with Django 4.2. Version 2.0.0 requires Python 3.12, so the LMS can't install it. This release makes the package work in edxapp.

What changed

  • Supports Python 3.11 and 3.12, Django 4.2 and 5.2 (python_requires>=3.11, classifiers updated).
  • tox and CI now test every combination: py{311,312}-django{42,52}, plus quality, docs and pii_check.
  • Requirements regenerated with Python 3.11 against Django 4.2, the oldest supported versions, so the pins install on both Python versions.
  • The Django<5.0 pin is in a separate requirements/django-constraints.txt. If it were in constraints.txt, setup.py would copy it into install_requires and the package would block Django 5.2.
  • Version bumped to 2.1.0 and CHANGELOG updated.

Testing: tox passes in all 7 envs (24 tests in each Python/Django combination). The built package shows Requires-Python: >=3.11 and Requires-Dist: Django with no cap. makemigrations --check reports no changes on Django 4.2 and 5.2.

Next: after release, bump the learner-pathway-progress<1.3.5 pin in edx-internal to 2.1.0.

@abhalsod-sonata abhalsod-sonata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and thanks for following up on 2.0.0 so the LMS can actually install this. CI is green on 3.11/3.12 × Django 4.2/5.2 plus quality and pii_check, and the matrix include entries correctly add quality and pii_check as separate 3.12 jobs.

The django-constraints.txt approach is the right call for this repo. base.in lists djangorestframework, django-filter, django-simple-history and edx-opaque-keys directly, so per-package caps in constraints.txt (what ai-aside and federated-content-connector did) would be copied into install_requires by load_requirements. Pinning Django<5.0 in a nested file and compiling on Python 3.11 gives 3.11/4.2-compatible pins with no caps in the published metadata.

A few small things:

1. Guard make upgrade to Python 3.11 (optional, Makefile, outside this diff). The pins only stay 3.11-compatible because they're compiled on 3.11. If someone runs make upgrade on 3.12, the 3.12-only releases come straight back (code-annotations 3.0.0, openedx-events 11.x, edx-opaque-keys 4.0.1, edx-ccx-keys 2.1.0), and only the py311 CI legs would catch it. A one-line check at the top of the upgrade target makes it fail fast:

upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
	@python -c "import sys; sys.exit(0 if sys.version_info[:2] == (3, 11) else 'make upgrade must run on Python 3.11, the oldest supported version (see requirements/constraints.txt).')"
	pip install -qr requirements/pip-tools.txt

Checked locally: it stops with that message on 3.12 and continues on 3.11.

2. Rollout of the edx-internal pin bump. From the LMS's current 1.3.4 to 2.1.0, the only runtime changes are the removed default_app_config (already ignored on Django 4.2) and migration 0006. 0006 adds an index on history_date in learner_pathway_progress_historicallearnerpathwayprogress, so it's worth checking that table's size before the LMS bump. edx-internal's check_private_dependencies.yml runs on 3.11, so it will confirm the install. For context, the old <1.3.5 cap only meant "latest 1.3.x" when it was added (2023-07-21); it isn't a known-bug pin.

3. Security (no action in this PR). pip-audit on the new pins flags Django 4.2.30 (CVE-2026-15307, fixed only in 5.2.17/6.0.8 because 4.2 is out of support) and social-auth-app-django/social-auth-core (pulled in by edx-enterprise). These are dev/test pins only, since the LMS installs its own versions, and the Django advisory only affects GeoDjango, which neither this plugin nor the LMS uses. It's one more reason for the edxapp move to Django 5.2 (LP-1304).

@alenkadev
alenkadev merged commit 3f1335b into edx:master Oct 13, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants