-
Notifications
You must be signed in to change notification settings - Fork 23
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: Python 3.8 dropped and support for 3.12 added #471
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @CodeWithEmad! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently unmaintained. To get help with finding a technical reviewer, tag the community contributions project manager for this PR in a comment and let them know that your changes are ready for review:
Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
cc456ba
to
668888e
Compare
Hey @CodeWithEmad, thank you for this contribution! Let us know when it's ready for review. |
For sure, @itsjeyd. |
@CodeWithEmad Sounds good!
I'll forward this question to @feanil. |
We should continue to run the testing with both Python 3.11 and 3.12 but dropping 3.8 is totally fine across all |
7e6c865
to
9e0156e
Compare
@feanil I'm working on dropping Python 3.8 here, but there are a couple of blockers here:
which is still using Python 3.8, https://github.com/openedx/xblock-sdk/blob/1760448ebb073edba35be87d99f474d90d9421ac/Dockerfile#L19 https://github.com/openedx/edx-cookiecutters/actions/runs/10206678813/job/28240034237?pr=471 |
@CodeWithEmad I'll see if we can land the xblock-sdk issue first then we can update that as a part of the PR here. |
Issue will be fixed in openedx/xblock-sdk#397 |
Thanks, @farhan. I'll continue this in the coming weeks. |
Remove unnecessary branch specification for workflow_dispatch event
All of the functionalities in xblockutils is moved to xblock.utils inside XBlock pakcage
b9e12fd
to
a364d9b
Compare
@@ -5,4 +5,4 @@ django-statici18n | |||
edx-i18n-tools | |||
Mako | |||
XBlock | |||
xblock-utils | |||
importlib-resources>=6.1.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to add it
From Python 3.11 onwards it available in Python package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I'll remove it.
workflow_dispatch: | ||
branches: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow_dispatch trigger does not require or support a branches key. By default, it allows manual triggering regardless of branch.
https://docs.github.com/en/webhooks/webhook-events-and-payloads#workflow_dispatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -24,7 +23,7 @@ class {{cookiecutter.class_name}}(XBlock): | |||
|
|||
def resource_string(self, path): | |||
"""Handy helper for getting resources from our kit.""" | |||
data = pkg_resources.resource_string(__name__, path) | |||
data = resources.files(__package__).joinpath(path).read_bytes() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are calling the xblock/utils/resources.py
methods where applicable and we can use them here. Please study below PR to follow it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
pkg_resources is available in python 3.12 only if setuptools is explicitly installed, which is not always the case.
* dev.stop: Stop the running container * dev.migrate: Run migrations in the container * dev.logs: View logs from the container * dev.exec: Execute to the dev container
0e1e1c0
to
146c66c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work @CodeWithEmad
I will suggest to create an example xblock using the cookie cutter, run it on xblock-sdk or edx-platform and make sure example xblock is rendering/working fine.
@@ -90,13 +100,12 @@ def _get_statici18n_js_url(): | |||
locale_code = translation.get_language() | |||
if locale_code is None: | |||
return None | |||
text_js = 'public/js/translations/{locale_code}/text.js' | |||
text_js = 'static/js/translations/{locale_code}/text.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should stay
'public/js/translations/{locale_code}/text.js'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you're comparing this with invideoquiz xblock
, @farhan.
There's no public directory here. unlike invideoquiz
, all the static files are stored inside static
directory.
workflow_dispatch: | ||
branches: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
146c66c
to
6c28821
Compare
@farhan I created an XBlock from the cookiecutter and installed it in the xblock-sdk as well. It's working as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work ⭐
6c28821
to
f4f5873
Compare
@CodeWithEmad Looks like this PR is ready to merge! 🚀 @farhan Do you have the necessary permissions or will we need to ask Axim to merge the changes? |
I don't have merging rights |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor tweaks, but overall, it looks great!
@@ -54,7 +54,7 @@ Enter the project and take a look around: | |||
ls | |||
Generate a virtualenv and generate requirements files with dependencies | |||
pinned to current versions (make sure you're using pip 9.0.2+ and Python 3.8): | |||
pinned to current versions (make sure you're using pip 9.0.2+ and Python 3.12): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should bump pip version to 23.2
|
||
try: | ||
from xblock.utils.resources import ResourceLoader | ||
except ModuleNotFoundError: | ||
from xblockutils.resources import ResourceLoader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to support xblockutils
in cookiecutter. All new projects should be using xblock.utils
This will update all the actions as follows:
Also, Python 3.12 added everywhere.
Close #460 #485