Skip to content

chore: update to Python 3.11/3.12 and Django 4.2/5.2#13

Open
Gi-ron wants to merge 6 commits intomainfrom
sgb/upgrade-python-django-versions
Open

chore: update to Python 3.11/3.12 and Django 4.2/5.2#13
Gi-ron wants to merge 6 commits intomainfrom
sgb/upgrade-python-django-versions

Conversation

@Gi-ron
Copy link
Copy Markdown

@Gi-ron Gi-ron commented Mar 26, 2026

Description

This PR updates the openedx-cas plugin to support Open edX Teak release, which runs on Python 3.11/3.12 and Django 4.2/5.2. It also removes support for older Python and Django versions.

The update includes:

  • Dependency upgrades to match the new platform requirements.
  • Updates to tox and GitHub Actions matrices.
  • Bump of version to 0.3.0.
  • Updated changelog and documentation.

Changes

Added

  • Support for Python 3.11 and 3.12.
  • Support for Django 4.2 and 5.2.
  • New GitHub Actions test matrix with the supported Python/Django combinations.
  • Set DJANGO_SETTINGS_MODULE in the quality tox environment to avoid pylint configuration errors.

Changed

  • Updated social-auth-core from 4.1.0 to 4.8.5.
  • Upgraded all dependencies via make upgrade.
  • Updated GitHub workflows (ci.yml, pypi-publish.yml) to use recent action versions.
  • Updated tox.ini to test against the new Python and Django versions.
  • Updated classifiers in setup.py to reflect Python 3.11/3.12 and Django 4.2/5.2.
  • Updated README.rst compatibility table to include Teak.

Removed

  • Dropped support for Python 3.8.
  • Dropped support for Django 2.2, 3.2, and 4.0.
  • Removed obsolete pylint options (regenerated .pylintrc with edx-lint).

Fixed

  • Fixed pylint warnings in setup.py by using with statements for file operations.
  • Fixed tox.ini to allow external commands in the quality environment.

Local Testing on Teak Instance

To validate the plugin works correctly in a real Open edX Teak environment, I performed the following steps on a local Tutor instance (Teak release):

  1. Create a Teak environment
      pip install "tutor[full]>=20.0.0,<21.0.0"
      export TUTOR_ROOT=$PWD
      export TUTOR_PLUGINS_ROOT=$PWD/plugins
      tutor local launch
  2. Install the plugin from this branch
       OPENEDX_EXTRA_PIP_REQUIREMENTS:
       - git+https://github.com/eduNEXT/openedx-cas.git@sgb/upgrade-python-django-versions
  3. Apply database migrations
       tutor local exec lms python manage.py lms migrate openedx_cas
  4. Configure a CAS provider via Django admin

Screenshot of the provider list:

Screenshot from 2026-03-31 14-59-54 Screenshot from 2026-03-31 14-30-28

The LMS logs showed no exceptions related to openedx_cas

Versioning

  • Current version: 0.3.0
  • Previous version: 0.2.4

The version has been bumped to minor because new Python and Django versions are supported and backward compatibility with older releases is dropped.

Checklist

  • Dependencies updated (make upgrade).
  • Tox matrix updated.
  • GitHub Actions workflows updated.
  • setup.py classifiers updated.
  • README.rst compatibility table updated.
  • CHANGELOG.rst updated.
  • Version bumped to 0.3.0.
  • Quality checks (tox -e quality) pass.
  • Tests pass for all supported combinations.

@Gi-ron Gi-ron force-pushed the sgb/upgrade-python-django-versions branch 2 times, most recently from 916aee1 to aba45ba Compare March 30, 2026 13:36
@magajh magajh requested review from jignaciopm and magajh March 30, 2026 15:06
@Gi-ron Gi-ron closed this Mar 31, 2026
@Gi-ron Gi-ron reopened this Mar 31, 2026
@Gi-ron Gi-ron force-pushed the sgb/upgrade-python-django-versions branch from aba45ba to 5a56827 Compare March 31, 2026 14:37
@Gi-ron Gi-ron closed this Mar 31, 2026
@Gi-ron Gi-ron reopened this Mar 31, 2026
@magajh magajh self-requested a review March 31, 2026 18:39
@magajh
Copy link
Copy Markdown

magajh commented Mar 31, 2026

@Gi-ron, regarding the local testing section you added in the PR description:

Local testing with tox

Run the following commands to verify the plugin works with all supported combinations:

tox -e py311-django42
tox -e py311-django52
tox -e py312-django42
tox -e py312-django52
tox -e quality

I don’t think this adds much value here, since these exact test combinations are already running in GitHub Actions and we already know they are passing.

What we really need to validate locally before merging is the plugin behavior in a real Open edX instance: install it in a Teak instance, verify that it installs cleanly, confirm there are no runtime errors, and test that the plugin actually works as expected there.

Have you tested it on your side by installing the plugin in a Teak instance and verifying that everything works correctly without errors? I think that is the validation we still need before merging this PR.

@Gi-ron
Copy link
Copy Markdown
Author

Gi-ron commented Mar 31, 2026

@Gi-ron, regarding the local testing section you added in the PR description:

Local testing with tox

Run the following commands to verify the plugin works with all supported combinations:

tox -e py311-django42
tox -e py311-django52
tox -e py312-django42
tox -e py312-django52
tox -e quality

I don’t think this adds much value here, since these exact test combinations are already running in GitHub Actions and we already know they are passing.

What we really need to validate locally before merging is the plugin behavior in a real Open edX instance: install it in a Teak instance, verify that it installs cleanly, confirm there are no runtime errors, and test that the plugin actually works as expected there.

Have you tested it on your side by installing the plugin in a Teak instance and verifying that everything works correctly without errors? I think that is the validation we still need before merging this PR.

@magajh Sure, i updated the description to provide a series of steps on how to test locally.

Copy link
Copy Markdown

@magajh magajh left a comment

Choose a reason for hiding this comment

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

Thanks @Gi-ron for this work

toxenv: [
'py311-django42',
'py311-django52',
'py312-django42',
Copy link
Copy Markdown

@magajh magajh Mar 31, 2026

Choose a reason for hiding this comment

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

I’m not sure we need to include the Python 3.12 / Django 4.2 combination here, since I don't think any supported Open edX version runs on it. Looks like testing Python 3.12 with only Django 5.2 would be enough

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Gi-ron you closed this comment but we still have 'py312-django42' listed here

- name: Install pip
run: pip install -r requirements/pip.txt

python-version: ${{ matrix.toxenv == 'py311-django42' && '3.11' || matrix.toxenv == 'py311-django52' && '3.11' || matrix.toxenv == 'py312-django42' && '3.12' || matrix.toxenv == 'py312-django52' && '3.12' || '3.11' }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think this would be cleaner if we defined the supported environments explicitly in the matrix instead of deriving the Python version from toxenv in one long expression. Since we only support a fixed set of combinations, using matrix.include makes the workflow much easier to read and maintain

matrix:
  include:
    - python-version: "3.11"
      toxenv: "py3.11-django4.2"
    - python-version: "3.11"
      toxenv: "py3.11-django5.2"
    - python-version: "3.12"
      toxenv: "py3.12-django5.2"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Gi-ron this comment is closed but this has not been solved yet

with:
fetch-depth: 100

- name: Download configuration
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Gi-ron I’m curious why this step and the related changes in this action are needed now. Was the action not working properly before?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The issue was that the default configuration file (downloaded from openedx/edx-lint) uses ES module syntax (export default), but the action expects CommonJS (module.exports). This caused a syntax error when the action tried to run. I’m not entirely sure if this failure was already present before (I didn’t run the action on previous commits)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Gi-ron are we sure there is not a cleaner way to run this workflow?
If not, I'm ok with merging this but first I would like us to do a double check

@magajh
Copy link
Copy Markdown

magajh commented Mar 31, 2026

@Gi-ron can we please add a compatibility notes table here like we've done for the other plugins? https://github.com/eduNEXT/eox-hooks?tab=readme-ov-file#compatibility-notes

This new version is compatible for releases Sumac, Teak and Ulmo and the previous version is compatible with releases <=Redwood

@magajh magajh self-requested a review April 1, 2026 20:12
Copy link
Copy Markdown

@magajh magajh left a comment

Choose a reason for hiding this comment

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

@Gi-ron seems like they are still pending changes, please double check all the comments I left in my first review

toxenv: [
'py311-django42',
'py311-django52',
'py312-django42',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Gi-ron you closed this comment but we still have 'py312-django42' listed here

- name: Install pip
run: pip install -r requirements/pip.txt

python-version: ${{ matrix.toxenv == 'py311-django42' && '3.11' || matrix.toxenv == 'py311-django52' && '3.11' || matrix.toxenv == 'py312-django42' && '3.12' || matrix.toxenv == 'py312-django52' && '3.12' || '3.11' }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Gi-ron this comment is closed but this has not been solved yet

@Gi-ron Gi-ron force-pushed the sgb/upgrade-python-django-versions branch from 6f0670b to 69ef4d5 Compare April 1, 2026 21:12
@Gi-ron Gi-ron force-pushed the sgb/upgrade-python-django-versions branch 2 times, most recently from 234d9f2 to c89582b Compare April 1, 2026 21:29
@Gi-ron Gi-ron force-pushed the sgb/upgrade-python-django-versions branch from 83ba58c to 8fd3e1f Compare April 1, 2026 21:43
Copy link
Copy Markdown

@magajh magajh left a comment

Choose a reason for hiding this comment

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

@Gi-ron, thanks for the work on this.

If we already tested the installation in a Teak environment with these latest changes and we’re confident it installs correctly without issues, then feel free to go ahead and merge it and release the new version.

I left one last comment about the commitlint flow, but I don’t consider it a blocker, so I’m approving this anyway

with:
fetch-depth: 100

- name: Download configuration
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Gi-ron are we sure there is not a cleaner way to run this workflow?
If not, I'm ok with merging this but first I would like us to do a double check

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