Skip to content

build: tox pin django 5.2-5.3 - #2677

Closed
marlonkeating wants to merge 1 commit into
masterfrom
mkeating/tox-pin-django-5-2-5-3
Closed

build: tox pin django 5.2-5.3#2677
marlonkeating wants to merge 1 commit into
masterfrom
mkeating/tox-pin-django-5-2-5-3

Conversation

@marlonkeating

Copy link
Copy Markdown
Contributor

What

The pii_check CI job fails with:

ImportError: cannot import name 'cc_delim_re' from 'django.utils.cache'

Why

requirements/test.txt deliberately omits the Django== pin — the Makefile
strips it out (# Let tox control the Django version for tests) so that each
[testenv] factor (e.g. django52) can supply its own Django>=5.2,<5.3
constraint before installing test.txt.

[testenv:pii_check] is a standalone tox section that never inherited that
constraint, so Django was left completely unpinned in that one job. Once
Django 6.1 landed on PyPI, pip resolved to it for pii_check, but 6.1 removed
cc_delim_re from django.utils.cache, which the pinned
djangorestframework==3.17.1 still imports — breaking
enterprise/admin/views.py's import chain during django_find_annotations.

This isn't caused by any recent requirements upgrade — requirements/*.txt
are unchanged; it's a latent gap in tox.ini that surfaced only once a new
Django release appeared. The edx-requirements-bot PR #2675 hits the same
failure for the same reason.

Fix

Add the same Django>=5.2,<5.3 pin already used by the django52 env to
[testenv:pii_check]'s deps.

Testing

Ran tox -e pii_check locally against this branch:

  • Before: fails with the cc_delim_re ImportError
  • After: Django resolves to 5.2.16; django_find_annotations linting and
    PII coverage checks (85.1%) pass

@marlonkeating

Copy link
Copy Markdown
Contributor Author

Fixed by #2551

@marlonkeating
marlonkeating deleted the mkeating/tox-pin-django-5-2-5-3 branch August 7, 2026 20:07
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.02%. Comparing base (99c7e2c) to head (423fe8b).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2677      +/-   ##
==========================================
+ Coverage   86.97%   87.02%   +0.04%     
==========================================
  Files         261      262       +1     
  Lines       17143    17228      +85     
  Branches     1693     1705      +12     
==========================================
+ Hits        14910    14992      +82     
- Misses       1896     1897       +1     
- Partials      337      339       +2     
Flag Coverage Δ
unittests 87.02% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant