Skip to content

Commit

Permalink
chore: updated python to 3.11 and replaced pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
beingfaisal committed Sep 5, 2024
1 parent 6b73ac3 commit 4812be3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: setup python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11

- name: Install pip
run: pip install -r requirements/pip.txt
Expand Down
6 changes: 3 additions & 3 deletions audio/audio.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""TO-DO: This XBlock will play an MP3 file as an HTML5 audio element. """


import pkg_resources
import importlib.resources
from xblock.core import XBlock
from xblock.fields import Integer, Scope, String
from xblock.fragment import Fragment
Expand Down Expand Up @@ -35,8 +35,8 @@ class AudioXBlock(XBlock):
@staticmethod
def resource_string(path):
"""Handy helper for getting resources from our kit."""
data = pkg_resources.resource_string(__name__, path)
return data.decode("utf8")
data = importlib.resources.files(__package__).joinpath(path)
return data.read_text(encoding="utf-8")

# TO-DO: change this view to display your data your own way.
def student_view(self, context=None):
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
Expand Down
2 changes: 1 addition & 1 deletion requirements/pip_tools.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
Expand Down

0 comments on commit 4812be3

Please sign in to comment.