Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutor-discovery codebase Python 3.12 upgrade #62

Closed
2 tasks done
DawoudSheraz opened this issue Feb 21, 2024 · 2 comments · Fixed by #67
Closed
2 tasks done

tutor-discovery codebase Python 3.12 upgrade #62

DawoudSheraz opened this issue Feb 21, 2024 · 2 comments · Fixed by #67
Assignees

Comments

@DawoudSheraz
Copy link

DawoudSheraz commented Feb 21, 2024

  • Ensure tutor-discovery codebase is compatible with Python 3.12
  • Update Python to 3.12 in Dockerfile for nightly and ensure the image builds as expected. The changes would be merged to nightly. his task would rely on upgrade of course-discovery to Python 3.12

See overhangio/tutor#1004 for the context.

@Faraz32123
Copy link
Collaborator

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

3 participants