Skip to content

Commit

Permalink
Merge pull request #163 from edly-io/faisal/pkg_resource_update
Browse files Browse the repository at this point in the history
AudioXBlock: Drop py3.8 support | Replace pkg_resources lib with importlib.resources
  • Loading branch information
Feanil Patel authored Oct 1, 2024
2 parents 0bf2dcb + 106ccb2 commit 39be0a9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 32 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.12

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


import pkg_resources
from xblock.core import XBlock
from xblock.fields import Integer, Scope, String
from xblock.fragment import Fragment
Expand Down Expand Up @@ -35,8 +34,7 @@ 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")
return resource_loader.load_unicode(path)

# TO-DO: change this view to display your data your own way.
def student_view(self, context=None):
Expand Down
16 changes: 8 additions & 8 deletions 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 All @@ -8,9 +8,9 @@ appdirs==1.4.4
# via fs
fs==2.4.16
# via xblock
lxml==5.1.0
lxml==5.3.0
# via xblock
mako==1.3.2
mako==1.3.5
# via xblock
markupsafe==2.1.5
# via
Expand All @@ -20,19 +20,19 @@ python-dateutil==2.9.0.post0
# via xblock
pytz==2024.1
# via xblock
pyyaml==6.0.1
pyyaml==6.0.2
# via xblock
simplejson==3.19.2
simplejson==3.19.3
# via xblock
six==1.16.0
# via
# fs
# python-dateutil
web-fragments==2.1.0
web-fragments==2.2.0
# via xblock
webob==1.8.7
webob==1.8.8
# via xblock
xblock==2.0.0
xblock==5.1.0
# via -r requirements/base.in

# The following packages are considered to be unsafe in a requirements file:
Expand Down
8 changes: 4 additions & 4 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#
# 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
#
wheel==0.42.0
wheel==0.44.0
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==24.0
pip==24.2
# via -r requirements/pip.in
setuptools==69.1.1
setuptools==74.1.2
# via -r requirements/pip.in
21 changes: 6 additions & 15 deletions requirements/pip_tools.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
#
# 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
#
build==1.1.1
build==1.2.2
# via pip-tools
click==8.1.7
# via pip-tools
importlib-metadata==7.0.1
packaging==24.1
# via build
packaging==23.2
# via build
pip-tools==7.4.0
pip-tools==7.4.1
# via -r requirements/pip_tools.in
pyproject-hooks==1.0.0
# via
# build
# pip-tools
tomli==2.0.1
pyproject-hooks==1.1.0
# via
# build
# pip-tools
# pyproject-hooks
wheel==0.42.0
wheel==0.44.0
# via pip-tools
zipp==3.17.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def is_requirement(line):

setup(
name='audio-xblock',
version='0.3.0',
version='0.3.1',
description='Audio XBlock, to play audio files in the course',
long_description=README,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 39be0a9

Please sign in to comment.