overhangio / tutor-discovery

Course Discovery plugin for Tutor
GNU Affero General Public License v3.0
11 stars 40 forks source link

tutor-discovery codebase Python 3.12 upgrade #62

Closed DawoudSheraz closed 2 months ago

DawoudSheraz commented 4 months ago

See https://github.com/overhangio/tutor/issues/1004 for the context.

Faraz32123 commented 3 months ago

I attempted building Discovery dockerfile on Python 3.12 on Nightly branch. Faced this error mentioned below

6.867   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
6.867   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
6.867   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
6.867   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
6.867   File "<frozen importlib._bootstrap_external>", line 995, in exec_module
6.867   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
6.867   File "/openedx/discovery/course_discovery/apps/catalogs/models.py", line 1, in <module>
6.868     from collections import Iterable  # lint-amnesty, pylint: disable=deprecated-class, no-name-in-module
6.868     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6.868 ImportError: cannot import name 'Iterable' from 'collections' (/opt/pyenv/versions/3.12.2/lib/python3.12/collections/__init__.py)
7.026 make: *** [Makefile:20: static] Error 1
------
Dockerfile:81
--------------------
  79 |     # Collect static assets
  80 |     COPY --chown=app:app assets.py ./course_discovery/settings/assets.py
  81 | >>> RUN DJANGO_SETTINGS_MODULE=course_discovery.settings.assets make static
  82 |     
  83 |     # Run production server

Above error was fixed by this PR that I created against discovery codebase.

The build was then successful on nightly branch with python 3.12. I was able to access discovery admin panel. Here's the dockerfile updgrade PR link for python 3.12.

Faraz32123 commented 2 months ago

closing this issue manually as its Python 3.12 upgrade PR is merged.