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

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

luisfelipec95
Copy link

@luisfelipec95 luisfelipec95 commented Feb 4, 2025

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 an environment with Sumac release, you can use Tutor or TVM.

  2. Install and enable tutor-contrib-picasso.

  3. Install and enable tutor-mfe.

  4. Add the following settings in your config.yml:

    PICASSO_DEFAULT_SITE_THEME: test-1
    PICASSO_EOX_THEMING_DPKG:
      name: eox-theming
      repo: '[email protected]:eduNEXT/eox-theming.git'
      version: lfc/deprecate-pkg-resources
    PICASSO_THEMES:
      - name: ednx-test-themes
        repo: '[email protected]:eduNEXT/ednx-test-themes.git'
        version: master
    PICASSO_THEMES_NAME:
      - test-1
      - test-2
      - test-3
    PICASSO_THEMES_ROOT: /openedx/themes
    PICASSO_THEME_DIRS:
      - /openedx/themes/ednx-test-themes/edx-platform
  5. Clone the test themes folder with tutor picasso enable-themes

  6. Add the testing themes running and init the environment with tutor dev launch

  7. Create a new tenant and add this settings to the tenant configs:

    {
        "EDNX_USE_SIGNAL": true,
        "ENABLE_ACCOUNT_MICROFRONTEND": false,
        "ENABLE_AUTHN_MICROFRONTEND": false,
        "PLATFORM_NAME": "Tenant A",
        "SITE_NAME": "tenant-a.local.openedx.io:8000",
        "THEME_OPTIONS": {
            "scripts": {
                "/login": [
                    {
                        "content": "alert('This is a test for the inline script');",
                        "type": "inline"
                    }
                ]
            },
            "theme": {
                "grandparent": "test-3",
                "name": "test-1",
                "parent": "test-2"
            }
        },
        "course_org_filter": [
            "TenantA"
        ],
        "footer_override": "<div style=\"width: 100%;\"><div style=\"position: relative; padding-bottom: 41.67%; padding-top: 0; height: 0;\"><iframe title=\"Footer X\" frameborder=\"0\" width=\"1200\" height=\"500\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\" src=\"https://view.genially.com/66464d3334225f0015c0dc0e\" type=\"text/html\" allowscriptaccess=\"always\" allowfullscreen=\"true\" scrolling=\"yes\" allownetworking=\"all\"></iframe> </div> </div>",
        "header_langselector": true,
        "header_links": [
            {
                "target": "_self",
                "txt": "Courses",
                "url": "/courses"
            },
            {
                "class": "mx-2",
                "target": "_self"
            }
        ],
        "released_languages": "en,vi,es-419"
    }
  8. Go to your admin panel and edit the learner_home_mfe.enabled Waffle Flag with the property Everyone in No to disable the Authn MFE.

  9. Run the test cases. In this file, you can find more information about the plugin configuration.

Other Information

openedx/public-engineering#273

@luisfelipec95 luisfelipec95 requested a review from a team as a code owner February 4, 2025 20:50
@luisfelipec95 luisfelipec95 changed the title chore: refactor: replace deprecated pkg_resources API Drop support for Python 3.8 and replace pkg_resources with importlib.resources Feb 4, 2025
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.

2 participants