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

AudioXBlock: Drop py3.8 support | Replace pkg_resources lib with importlib.resources #163

Merged
merged 4 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
beingfaisal marked this conversation as resolved.
Show resolved Hide resolved

- 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