Skip to content

Drop Python 3.8 & Add Support for Python 3.12#264

Merged
feanil merged 2 commits intoopenedx:masterfrom
ttqureshi:ttqureshi/py-312
May 6, 2025
Merged

Drop Python 3.8 & Add Support for Python 3.12#264
feanil merged 2 commits intoopenedx:masterfrom
ttqureshi:ttqureshi/py-312

Conversation

@ttqureshi
Copy link
Copy Markdown
Member

@ttqureshi
Copy link
Copy Markdown
Member Author

@feanil The tox command runs successfully for python3.11. But for python 3.12 it fails with the following error log. I believe the helper functions defined in utils.py need to be moved to setup.py. But this would make setup.py much bigger.
What are you thoughts and suggestions on it?

Error Log:

  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/home/runner/work/cc2olx/cc2olx/.tox/formatting/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/home/runner/work/cc2olx/cc2olx/.tox/formatting/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/runner/work/cc2olx/cc2olx/.tox/formatting/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-qtw9qvne/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 331, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-qtw9qvne/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line [30](https://github.com/openedx/cc2olx/actions/runs/14732414690/job/41424187947?pr=264#step:5:31)1, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-qtw9qvne/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-qtw9qvne/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line [31](https://github.com/openedx/cc2olx/actions/runs/14732414690/job/41424187947?pr=264#step:5:32)7, in run_setup
          exec(code, locals())
        File "<string>", line 6, in <module>
      ModuleNotFoundError: No module named 'utils'
      [end of output]```
      

@feanil
Copy link
Copy Markdown
Contributor

feanil commented May 5, 2025

@ttqureshi I think it's fine to move all the contents of utils.py into setup.py. Long term we'll need to replace the setup.py with a pyproject.toml anyway so having it be self-contained for now is not a problem. We add similar functions in most of our other setup.py files so it's also not a new pattern to do so here.

@feanil feanil merged commit cf9437b into openedx:master May 6, 2025
12 checks passed
@ttqureshi ttqureshi deleted the ttqureshi/py-312 branch May 6, 2025 14:05
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.

Drop Python 3.8 & Add Support for Python 3.12

2 participants