Skip to content

Drop support for Python 3.8 and replace pkg_resources with importlib.resources#37

Merged
luisfelipec95 merged 13 commits into
mainfrom
lfc/deprecate-pkg-resources
Feb 11, 2025
Merged

Drop support for Python 3.8 and replace pkg_resources with importlib.resources#37
luisfelipec95 merged 13 commits into
mainfrom
lfc/deprecate-pkg-resources

Conversation

@luisfelipec95

@luisfelipec95 luisfelipec95 commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

Description

  • Dropped support for Python 3.8
  • Upgrade requirements
  • Replace pkg_resources lib with importlib.resources:

pkg_resources (from setuptools) is deprecated and will be removed in future Python versions.
The new implementation uses importlib.resources, which is the recommended alternative and is fully available in Python 3.9+.

Testing instructions

1, Create a Sumac environment using Tutor or TVM.
2. Install xblock-mindmap using this branch you can follow the official tutor documentation.
3. In a course of study:
Navigate to Settings -> Advanced Settings and go to Advanced Module List settings.
Add:
image
4. Create Unit -> Advance ->Mindmap

Other Information

openedx/public-engineering#273

@luisfelipec95
luisfelipec95 requested a review from a team as a code owner February 3, 2025 22:32
@luisfelipec95 luisfelipec95 changed the title refactor: replace deprecated pkg_resources API Drop support for Python 3.8 and replace pkg_resources with importlib.resources Feb 4, 2025

@DeimerM DeimerM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I have checked the xblock in the sumac release and everything seems to work very well https://studio.sumac.releases.edunext.link/container/block-v1:OpenedX+101+2025+type@vertical+block@3ccdd18b73784358b7b9624623bb1f37#

@luisfelipec95
luisfelipec95 requested a review from magajh February 10, 2025 21:42
Comment thread README.rst Outdated
Comment thread README.rst Outdated
Comment thread CHANGELOG.rst Outdated
Comment thread CHANGELOG.rst Outdated

* Remove support for python 3.8 and django 3.2
* Replaced deprecated `pkg_resources` APIs with `importlib.resources` and `importlib.metadata` to ensure compatibility with newer Django and Python versions.
* Starting with this version (9.0.0), it is no longer compatible with Quince.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What are you trying to say here? I don't understand this message

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What do you think about this? Replaced deprecated pkg_resources with importlib.resources for better compatibility with newer Django and Python versions.

Comment thread requirements/constraints.txt Outdated
Comment thread requirements/constraints.txt
Comment thread README.rst Outdated
+------------------+------------------+
| Quince | >= 0.8.0 < 2.0.0 |
+------------------+------------------+
| Redwood | >= 1.1.0 |

@magajh magajh Feb 11, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@luisfelipec95 why are we changing in this table the compatibility with Redwood and Sumac?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@luisfelipec95
luisfelipec95 requested a review from magajh February 11, 2025 19:51
@luisfelipec95
luisfelipec95 merged commit 6dc3b20 into main Feb 11, 2025
@luisfelipec95
luisfelipec95 deleted the lfc/deprecate-pkg-resources branch February 11, 2025 22:49
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.

3 participants