diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00d8585..ab2273d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,8 @@ jobs: os: - ubuntu-latest python-version: - - 3.8 - 3.11 + - 3.12 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 307c8be..d8da3d6 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -15,7 +15,7 @@ jobs: - name: setup python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.11 - name: Install pip run: pip install -r requirements/pip.txt diff --git a/crowdsourcehinter/__init__.py b/crowdsourcehinter/__init__.py index 2a19630..d4c5185 100644 --- a/crowdsourcehinter/__init__.py +++ b/crowdsourcehinter/__init__.py @@ -1,3 +1,3 @@ from .crowdsourcehinter import CrowdsourceHinter -__version__ = '0.7' +__version__ = '0.8' diff --git a/crowdsourcehinter/crowdsourcehinter.py b/crowdsourcehinter/crowdsourcehinter.py index 2f88d85..d3091f0 100644 --- a/crowdsourcehinter/crowdsourcehinter.py +++ b/crowdsourcehinter/crowdsourcehinter.py @@ -3,8 +3,6 @@ import logging import random -import pkg_resources - import six.moves.html_parser import six.moves.urllib.error import six.moves.urllib.parse @@ -12,7 +10,12 @@ from web_fragments.fragment import Fragment from xblock.core import XBlock from xblock.fields import Dict, List, Scope, String +try: + from xblock.utils.resources import ResourceLoader +except ModuleNotFoundError: # For backward compatibility with releases older than Quince. + from xblockutils.resources import ResourceLoader +resource_loader = ResourceLoader(__name__) log = logging.getLogger(__name__) html_parser = six.moves.html_parser.HTMLParser() @@ -443,8 +446,7 @@ def resource_string(self, path): """ This function is used to get the path of static resources. """ - data = pkg_resources.resource_string(__name__, path) - return data.decode("utf8") + return resource_loader.load_unicode(path) def get_user_is_staff(self): """ diff --git a/requirements/base.txt b/requirements/base.txt index 77c66d5..700c266 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -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 @@ -8,9 +8,9 @@ appdirs==1.4.4 # via fs fs==2.4.16 # via xblock -lxml==5.2.1 +lxml==5.3.0 # via xblock -mako==1.3.2 +mako==1.3.5 # via xblock markupsafe==2.1.5 # via @@ -18,11 +18,11 @@ markupsafe==2.1.5 # xblock python-dateutil==2.9.0.post0 # via xblock -pytz==2024.1 +pytz==2024.2 # 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 @@ -33,9 +33,9 @@ web-fragments==2.2.0 # via # -r requirements/base.in # xblock -webob==1.8.7 +webob==1.8.8 # via xblock -xblock==3.1.0 +xblock==5.1.0 # via -r requirements/base.in # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/ci.txt b/requirements/ci.txt index 3ce5b7e..d087374 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -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 # -flake8==7.0.0 +flake8==7.1.1 # via -r requirements/ci.in mccabe==0.7.0 # via flake8 -pycodestyle==2.11.1 +pycodestyle==2.12.1 # via flake8 pyflakes==3.2.0 # via flake8 diff --git a/requirements/pip.txt b/requirements/pip.txt index cf44902..36c777e 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -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.43.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.2.0 +setuptools==75.1.0 # via -r requirements/pip.in diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index 4e1105e..77d81ad 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -1,34 +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.2.1 +build==1.2.2 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==6.11.0 - # via - # -c requirements/common_constraints.txt - # build -packaging==24.0 +packaging==24.1 # via build 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.43.0 +wheel==0.44.0 # via pip-tools -zipp==3.18.1 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/test.txt b/requirements/test.txt index b81ddf9..2357481 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,24 +1,18 @@ # -# 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 # -coverage[toml]==7.4.4 +coverage[toml]==7.6.1 # via pytest-cov -exceptiongroup==1.2.0 - # via pytest iniconfig==2.0.0 # via pytest -packaging==24.0 +packaging==24.1 # via pytest -pluggy==1.4.0 +pluggy==1.5.0 # via pytest -pytest==8.1.1 +pytest==8.3.3 # via pytest-cov pytest-cov==5.0.0 # via -r requirements/test.in -tomli==2.0.1 - # via - # coverage - # pytest diff --git a/setup.py b/setup.py index c08f825..13cf2fd 100644 --- a/setup.py +++ b/setup.py @@ -133,9 +133,8 @@ def get_version(file_path): 'Topic :: Software Development :: Build Tools', 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: Implementation :: CPython', ], )