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

Drop support for Python 3.8 and replace pkg_resources with importlib.resources #81

Merged
merged 12 commits into from
Feb 11, 2025
4 changes: 2 additions & 2 deletions .github/workflows/bumpversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
default_bump: false
default_prerelease_bump: false
dry_run: true
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.11"
- name: Create bumpversion
if: steps.tag_version.outputs.new_version
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.11"]
django: ["42"]

steps:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v9.0.0](https://github.com/eduNEXT/eox-theming/compare/v8.1.0...v9.0.0) - (2025-02-04)

### Changed

* Removed support for Python 3.8.
* Replaced deprecated `pkg_resources` with `importlib.resources` for better compatibility with newer Django and Python versions.
* Starting with this version, this package is no longer compatible with releases older than Redwood.

## [v8.1.0](https://github.com/eduNEXT/eox-theming/compare/v8.0.0...v8.1.0) - (2024-11-27)

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Compatibility Notes
+------------------+---------------+
| Palm | >= 6.0 < 8.0 |
+------------------+---------------+
| Quince | >= 7.0 |
| Quince | >= 7.0 < 9.0 |
+------------------+---------------+
| Redwood | >= 7.2.0 |
+------------------+---------------+
Expand Down
2 changes: 1 addition & 1 deletion eox_theming/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

from __future__ import unicode_literals

__version__ = '8.1.0'
__version__ = '9.0.0'
4 changes: 2 additions & 2 deletions eox_theming/theming/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
See: common.djangoapps.edxmako.paths
"""

import importlib.resources
import os
import re

import pkg_resources
from django.conf import settings
from mako.exceptions import TopLevelLookupException

Expand Down Expand Up @@ -91,7 +91,7 @@ def add_lookup(namespace, directory, package=None, prepend=False):
encoding_errors='replace',
)
if package:
directory = pkg_resources.resource_filename(package, directory)
directory = importlib.resources.files(package) / directory
templates.add_directory(directory, prepend=prepend)


Expand Down
16 changes: 5 additions & 11 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -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
#
asgiref==3.8.1
# via django
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
django==4.2.16
django==4.2.18
# via
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
eox-tenant==12.1.0
eox-tenant==13.0.0
# via -r requirements/base.in
six==1.16.0
six==1.17.0
# via -r requirements/base.in
sqlparse==0.5.2
sqlparse==0.5.3
# via django
typing-extensions==4.12.2
# via asgiref
3 changes: 0 additions & 3 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@

# Common constraints for Open edX repos
-c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt

# backports.zoneinfo is only needed for Python < 3.9
backports.zoneinfo; python_version<'3.9'
2 changes: 1 addition & 1 deletion requirements/django42.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
django==4.2.16
django==4.2.18
12 changes: 2 additions & 10 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#
# 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.2.post1
# via pip-tools
click==8.1.7
click==8.1.8
# via pip-tools
importlib-metadata==8.5.0
# via build
packaging==24.2
# via build
pip-tools==7.4.1
Expand All @@ -18,14 +16,8 @@ pyproject-hooks==1.2.0
# via
# build
# pip-tools
tomli==2.1.0
# via
# build
# pip-tools
wheel==0.45.1
# via pip-tools
zipp==3.20.2
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
Expand Down
50 changes: 17 additions & 33 deletions requirements/test.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,21 +8,15 @@ asgiref==3.8.1
# via
# -r requirements/base.txt
# django
astroid==3.2.4
astroid==3.3.8
# via
# -r requirements/test.in
# pylint
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# django
# djangorestframework
certifi==2024.8.30
certifi==2025.1.31
# via requests
charset-normalizer==3.4.0
charset-normalizer==3.4.1
# via requests
coverage==7.6.1
coverage==7.6.10
# via -r requirements/test.in
dill==0.3.9
# via pylint
Expand All @@ -33,27 +27,25 @@ dill==0.3.9
# djangorestframework
djangorestframework==3.15.2
# via -r requirements/test.in
eox-tenant==12.1.0
eox-tenant==13.0.0
# via -r requirements/base.txt
exceptiongroup==1.2.2
# via pytest
idna==3.10
# via requests
iniconfig==2.0.0
# via pytest
isort==5.13.2
isort==6.0.0
# via pylint
mako==1.3.6
mako==1.3.9
# via -r requirements/test.in
markupsafe==2.1.5
markupsafe==3.0.2
# via mako
mccabe==0.7.0
# via pylint
mock==5.1.0
# via -r requirements/test.in
packaging==24.2
# via pytest
path==17.0.0
path==17.1.0
# via path-py
path-py==12.5.0
# via -r requirements/test.in
Expand All @@ -63,9 +55,9 @@ pluggy==1.5.0
# via pytest
pycodestyle==2.12.1
# via -r requirements/test.in
pylint==3.2.7
pylint==3.3.4
# via -r requirements/test.in
pytest==8.3.3
pytest==8.3.4
# via
# -r requirements/test.in
# pytest-django
Expand All @@ -75,25 +67,17 @@ pyyaml==6.0.2
# via -r requirements/test.in
requests==2.32.3
# via -r requirements/test.in
six==1.16.0
six==1.17.0
# via -r requirements/base.txt
sqlparse==0.5.2
sqlparse==0.5.3
# via
# -r requirements/base.txt
# django
testfixtures==8.3.0
# via -r requirements/test.in
tomli==2.1.0
# via
# pylint
# pytest
tomlkit==0.13.2
# via pylint
typing-extensions==4.12.2
# via
# -r requirements/base.txt
# asgiref
# astroid
# pylint
urllib3==2.2.3
# via requests
# via
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# requests
18 changes: 6 additions & 12 deletions requirements/tox.txt
Original file line number Diff line number Diff line change
@@ -1,18 +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
#
cachetools==5.5.0
cachetools==5.5.1
# via tox
chardet==5.2.0
# via tox
colorama==0.4.6
# via tox
distlib==0.3.9
# via virtualenv
filelock==3.16.1
filelock==3.17.0
# via
# tox
# virtualenv
Expand All @@ -26,15 +26,9 @@ platformdirs==4.3.6
# virtualenv
pluggy==1.5.0
# via tox
pyproject-api==1.8.0
pyproject-api==1.9.0
# via tox
tomli==2.1.0
# via
# pyproject-api
# tox
tox==4.23.2
tox==4.24.1
# via -r requirements/tox.in
typing-extensions==4.12.2
# via tox
virtualenv==20.28.0
virtualenv==20.29.1
# via tox
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 8.1.0
current_version = 9.0.0
commit = False
tag = False

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ def is_requirement(line):
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.11',
],
license='AGPL',
Expand Down
3 changes: 1 addition & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[tox]
envlist = py{38, 311}-django{42}
envlist = py{311}-django{42}


[testenv]
envdir=
py38: {toxworkdir}/py38
py311: {toxworkdir}/py311
deps =
django42: -r requirements/django42.txt
Expand Down