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

xblock-image-explorer | Drop py3.8 support | replace pkg_resource with importlib.resources #153

Merged
merged 7 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: ['3.8', '3.11', '3.12']
python-version: ['3.11', '3.12']
toxenv: [django42, quality, package]

steps:
Expand Down
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 Dependencies
run: pip install -r requirements/pip.txt
Expand Down
6 changes: 3 additions & 3 deletions image_explorer/image_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import textwrap
from io import StringIO
from urllib.parse import urljoin
import pkg_resources
import importlib.resources

from django.conf import settings
from lxml import etree, html
Expand Down Expand Up @@ -465,5 +465,5 @@ def workbench_scenarios():

def resource_string(self, 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")
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ web-fragments==2.2.0
# via xblock
webob==1.8.7
# via xblock
xblock[django]==4.0.1
xblock[django]==5.0.0
# via -r requirements/base.in

# The following packages are considered to be unsafe in a requirements file:
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ webob==1.8.7
# -r requirements/base.txt
# xblock
# xblock-sdk
xblock[django]==4.0.1
xblock[django]==5.0.0
# via
# -r requirements/base.txt
# xblock
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def package_data(pkg, root_list):
long_description_content_type='text/markdown',
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Framework :: Django',
Expand All @@ -127,5 +126,5 @@ def package_data(pkg, root_list):
},
packages=['image_explorer'],
package_data=package_data("image_explorer", ["static", "templates", "public", "translations"]),
python_requires=">=3.8",
python_requires=">=3.11",
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{38,311,312}-django{42},quality,package
envlist = py{311,312}-django{42},quality,package

[pytest]
DJANGO_SETTINGS_MODULE = workbench.settings
Expand Down