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

fix: update celery and libsass versions #4147

Conversation

Faraz32123
Copy link

@Faraz32123 Faraz32123 commented Mar 19, 2024

celery version needs to updated due to below error

1.512   File "/openedx/ecommerce/ecommerce/extensions/offer/utils.py", line 15, in <module>
1.513     from ecommerce_worker.email.v1.api import send_offer_assignment_email, send_offer_update_email
1.513   File "/openedx/venv/lib/python3.12/site-packages/ecommerce_worker/email/v1/api.py", line 7, in <module>
1.513     from .tasks import (
1.513   File "/openedx/venv/lib/python3.12/site-packages/ecommerce_worker/email/v1/tasks.py", line 6, in <module>
1.514     from celery import shared_task
1.514   File "/openedx/venv/lib/python3.12/site-packages/celery/__init__.py", line 19, in <module>
1.514     from . import local  # noqa
1.514     ^^^^^^^^^^^^^^^^^^^
1.514   File "/openedx/venv/lib/python3.12/site-packages/celery/local.py", line 17, in <module>
1.515     from .five import PY3, bytes_if_py2, items, string, string_t
1.515   File "/openedx/venv/lib/python3.12/site-packages/celery/five.py", line 7, in <module>
1.515     import vine.five
1.515   File "/openedx/venv/lib/python3.12/site-packages/vine/__init__.py", line 8, in <module>
1.515     from .abstract import Thenable
1.515   File "/openedx/venv/lib/python3.12/site-packages/vine/abstract.py", line 6, in <module>
1.516     from .five import with_metaclass, Callable
1.516   File "/openedx/venv/lib/python3.12/site-packages/vine/five.py", line 364, in <module>
1.516     from inspect import formatargspec, getargspec as _getargspec  # noqa
1.516     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.517 ImportError: cannot import name 'formatargspec' from 'inspect' (/opt/pyenv/versions/3.12.2/lib/python3.12/inspect.py). Did you mean: 'formatargvalues'?

libsass version needs to updated due to below error

1.603   File "/openedx/ecommerce/ecommerce/theming/management/commands/update_assets.py", line 7, in <module>
1.604     import sass
1.604   File "/openedx/venv/lib/python3.12/site-packages/sass.py", line 609, in <module>
1.604     class SassMap(collections.Mapping):
1.604                   ^^^^^^^^^^^^^^^^^^^
1.604 AttributeError: module 'collections' has no attribute 'Mapping'

This PR needs to be merged to close this tutor-ecommerce issue. These changes work with python 3.8.0 to 3.12.2.

requirements/docs.txt Outdated Show resolved Hide resolved
@Faraz32123 Faraz32123 force-pushed the update_celery_and_libsass_version_to_work_with_python.3.12 branch 4 times, most recently from 78aeacf to 2b3d2ed Compare April 19, 2024 07:46
@Faraz32123 Faraz32123 force-pushed the update_celery_and_libsass_version_to_work_with_python.3.12 branch from 2b3d2ed to 346d7dc Compare April 19, 2024 08:00
Exception in thread django-main-thread:
2024-04-15 14:56:18 Traceback (most recent call last):
2024-04-15 14:56:18   File "/opt/pyenv/versions/3.12.2/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
2024-04-15 14:56:18     self.run()
2024-04-15 14:56:18   File "/opt/pyenv/versions/3.12.2/lib/python3.12/threading.py", line 1010, in run
2024-04-15 14:56:18     self._target(*self._args, **self._kwargs)
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/utils/autoreload.py", line 64, in wrapper
2024-04-15 14:56:18     fn(*args, **kwargs)
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/core/management/commands/runserver.py", line 118, in inner_run
2024-04-15 14:56:18     self.check(display_num_errors=True)
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/core/management/base.py", line 419, in check
2024-04-15 14:56:18     all_issues = checks.run_checks(
2024-04-15 14:56:18                  ^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/core/checks/registry.py", line 76, in run_checks
2024-04-15 14:56:18     new_errors = check(app_configs=app_configs, databases=databases)
2024-04-15 14:56:18                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 13, in check_url_config
2024-04-15 14:56:18     return check_resolver(resolver)
2024-04-15 14:56:18            ^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/core/checks/urls.py", line 23, in check_resolver
2024-04-15 14:56:18     return check_method()
2024-04-15 14:56:18            ^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 416, in check
2024-04-15 14:56:18     for pattern in self.url_patterns:
2024-04-15 14:56:18                    ^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/utils/functional.py", line 48, in __get__
2024-04-15 14:56:18     res = instance.__dict__[self.name] = self.func(instance)
2024-04-15 14:56:18                                          ^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 602, in url_patterns
2024-04-15 14:56:18     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
2024-04-15 14:56:18                        ^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/utils/functional.py", line 48, in __get__
2024-04-15 14:56:18     res = instance.__dict__[self.name] = self.func(instance)
2024-04-15 14:56:18                                          ^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/urls/resolvers.py", line 595, in urlconf_module
2024-04-15 14:56:18     return import_module(self.urlconf_name)
2024-04-15 14:56:18            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/opt/pyenv/versions/3.12.2/lib/python3.12/importlib/__init__.py", line 90, in import_module
2024-04-15 14:56:18     return _bootstrap._gcd_import(name[level:], package, level)
2024-04-15 14:56:18            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
2024-04-15 14:56:18   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
2024-04-15 14:56:18   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
2024-04-15 14:56:18   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
2024-04-15 14:56:18   File "<frozen importlib._bootstrap_external>", line 995, in exec_module
2024-04-15 14:56:18   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
2024-04-15 14:56:18   File "/openedx/ecommerce/ecommerce/urls.py", line 23, in <module>
2024-04-15 14:56:18     from ecommerce.extensions.urls import urlpatterns as extensions_patterns
2024-04-15 14:56:18   File "/openedx/ecommerce/ecommerce/extensions/urls.py", line 11, in <module>
2024-04-15 14:56:18     url(r'^api/', include(('ecommerce.extensions.api.urls', 'api'))),
2024-04-15 14:56:18                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/urls/conf.py", line 34, in include
2024-04-15 14:56:18     urlconf_module = import_module(urlconf_module)
2024-04-15 14:56:18                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/opt/pyenv/versions/3.12.2/lib/python3.12/importlib/__init__.py", line 90, in import_module
2024-04-15 14:56:18     return _bootstrap._gcd_import(name[level:], package, level)
2024-04-15 14:56:18            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/ecommerce/ecommerce/extensions/api/urls.py", line 6, in <module>
2024-04-15 14:56:18     url(r'^v2/', include(('ecommerce.extensions.api.v2.urls', 'v2'))),
2024-04-15 14:56:18                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/django/urls/conf.py", line 34, in include
2024-04-15 14:56:18     urlconf_module = import_module(urlconf_module)
2024-04-15 14:56:18                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/opt/pyenv/versions/3.12.2/lib/python3.12/importlib/__init__.py", line 90, in import_module
2024-04-15 14:56:18     return _bootstrap._gcd_import(name[level:], package, level)
2024-04-15 14:56:18            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/ecommerce/ecommerce/extensions/api/v2/urls.py", line 175, in <module>
2024-04-15 14:56:18     router.register(r'partners', partner_views.PartnerViewSet, basename='partner') \
2024-04-15 14:56:18     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/rest_framework_extensions/routers.py", line 57, in register
2024-04-15 14:56:18     self._register(*args, **kwargs)
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/rest_framework_extensions/routers.py", line 54, in _register
2024-04-15 14:56:18     return super().register(*args, **kwargs)
2024-04-15 14:56:18            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-04-15 14:56:18   File "/openedx/venv/lib/python3.12/site-packages/rest_framework/routers.py", line 59, in register
2024-04-15 14:56:18     raise ImproperlyConfigured(msg)
2024-04-15 14:56:18 django.core.exceptions.ImproperlyConfigured: Router with basename "partner" is already registered. Please provide a unique basename for viewset "<class 'ecommerce.extensions.api.v2.views.partners.PartnerViewSet'>"
@Faraz32123 Faraz32123 force-pushed the update_celery_and_libsass_version_to_work_with_python.3.12 branch from d8469d5 to 118bad7 Compare April 19, 2024 08:15
Copy link
Contributor

@DawoudSheraz DawoudSheraz left a comment

Choose a reason for hiding this comment

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

1-2 small comments to address before merge. CI is green, so 👍🏽

@DawoudSheraz
Copy link
Contributor

DawoudSheraz commented Apr 19, 2024

@feanil Hi. Can you help here in getting a review from Axim, please? Thanks

@Faraz32123 Faraz32123 force-pushed the update_celery_and_libsass_version_to_work_with_python.3.12 branch from 6549510 to d37f44e Compare April 19, 2024 10:28
60.90 Using cached zope.interface-6.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (255 kB)
61.51 Building wheels for collected packages: backports-zoneinfo
61.51   Building wheel for backports-zoneinfo (pyproject.toml): started
61.93   Building wheel for backports-zoneinfo (pyproject.toml): finished with status 'error'
61.94   error: subprocess-exited-with-error
61.94
61.94   × Building wheel for backports-zoneinfo (pyproject.toml) did not run successfully.
61.94   │ exit code: 1
61.94   ╰─> [41 lines of output]
61.94       running bdist_wheel
61.94       running build
61.94       running build_py
61.94       creating build
61.94       creating build/lib.linux-x86_64-cpython-312
61.94       creating build/lib.linux-x86_64-cpython-312/backports
61.94       copying src/backports/__init__.py -> build/lib.linux-x86_64-cpython-312/backports
61.94       creating build/lib.linux-x86_64-cpython-312/backports/zoneinfo
61.94       copying src/backports/zoneinfo/_common.py -> build/lib.linux-x86_64-cpython-312/backports/zoneinfo
61.94       copying src/backports/zoneinfo/_version.py -> build/lib.linux-x86_64-cpython-312/backports/zoneinfo
61.94       copying src/backports/zoneinfo/_zoneinfo.py -> build/lib.linux-x86_64-cpython-312/backports/zoneinfo
61.94       copying src/backports/zoneinfo/__init__.py -> build/lib.linux-x86_64-cpython-312/backports/zoneinfo
61.94       copying src/backports/zoneinfo/_tzpath.py -> build/lib.linux-x86_64-cpython-312/backports/zoneinfo
61.94       running egg_info
61.94       writing src/backports.zoneinfo.egg-info/PKG-INFO
61.94       writing dependency_links to src/backports.zoneinfo.egg-info/dependency_links.txt
61.94       writing requirements to src/backports.zoneinfo.egg-info/requires.txt
61.94       writing top-level names to src/backports.zoneinfo.egg-info/top_level.txt
61.94       reading manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
61.94       reading manifest template 'MANIFEST.in'
61.94       warning: no files found matching '*.png' under directory 'docs'
61.94       warning: no files found matching '*.svg' under directory 'docs'
61.94       no previously-included directories found matching 'docs/_build'
61.94       no previously-included directories found matching 'docs/_output'
61.94       adding license file 'LICENSE'
61.94       adding license file 'licenses/LICENSE_APACHE'
61.94       writing manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
61.94       copying src/backports/zoneinfo/__init__.pyi -> build/lib.linux-x86_64-cpython-312/backports/zoneinfo
61.94       copying src/backports/zoneinfo/py.typed -> build/lib.linux-x86_64-cpython-312/backports/zoneinfo
61.94       running build_ext
61.94       building 'backports.zoneinfo._czoneinfo' extension
61.94       creating build/temp.linux-x86_64-cpython-312
61.94       creating build/temp.linux-x86_64-cpython-312/lib
61.94       gcc -pthread -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fPIC -I/openedx/venv/include -I/opt/pyenv/versions/3.12.2/include/python3.12 -c lib/zoneinfo_module.c -o build/temp.linux-x86_64-cpython-312/lib/zoneinfo_module.o -std=c99
61.94       lib/zoneinfo_module.c: In function ‘zoneinfo_fromutc’:
61.94       lib/zoneinfo_module.c:600:19: error: ‘_PyLong_One’ undeclared (first use in this function); did you mean ‘_PyLong_New’?
61.94         600 |             one = _PyLong_One;
61.94             |                   ^~~~~~~~~~~
61.94             |                   _PyLong_New
61.94       lib/zoneinfo_module.c:600:19: note: each undeclared identifier is reported only once for each function it appears in
61.94       error: command '/usr/bin/gcc' failed with exit code 1
61.94       [end of output]
61.94
61.94   note: This error originates from a subprocess, and is likely not a problem with pip.
61.94   ERROR: Failed building wheel for backports-zoneinfo
61.94 Failed to build backports-zoneinfo
61.95 ERROR: Could not build wheels for backports-zoneinfo, which is required to install pyproject.toml-based projects
------
Dockerfile:83
--------------------
  81 |
  82 |     # python requirements
  83 | >>> RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} pip install -r requirements.txt
  84 |     # https://pypi.org/project/uWSGI/
  85 |     RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} pip install uwsgi==2.0.24
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install -r requirements.txt" did not complete successfully: exit code: 1
@andrey-canon
Copy link

Hi @DawoudSheraz, @feanil I will make a review of this next week :D

Copy link

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

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

I tested this branch in addition with overhangio/tutor-ecommerce#72 and I didn't make a whole test but the application loads and the partner application(That was the unique application whose url definition changed)worked as expected, however, when I tried some commands from the makefile I got the following errors

make requirements

image

looks like the transifex-client dependency is not compatible with python 3.12

make requirements.tox This command is executed by the make static command

This makes a downgrade of pip https://github.com/openedx/ecommerce/blob/master/Makefile#L48 and that generates the following error:
image

Could you fix that ?

@Faraz32123
Copy link
Author

Hello @andrey-canon, thanks for your time.
I have fixed transifex-client compatibility issue with python3.12. The other issue will be fixed in #4153 and to test that PR related to CI, this PR needs to b merged.

Copy link

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

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

Everything looks okay. I tested the Transifex issue, and it was fixed. However, we cannot ensure that 100% of the application is working unless we run tests. To achieve that, we need to rebase this pr onto this one. That's why I approve this under the premise that there are some current issues, which will be addressed in subsequent PRs.

CC @feanil

@feanil feanil merged commit 5e54f4c into openedx:master May 6, 2024
8 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.

4 participants