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

feat: add python 3.11 support #154

Merged
merged 3 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django32, django42, quality, csslint, eslint]
python-version:
- '3.8'
- '3.11'
toxenv: [django42, quality, csslint, eslint]

steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 6 additions & 1 deletion imagemodal/mixins/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"""
from django.template.context import Context
from xblock.core import XBlock
from xblock.fragment import Fragment


try:
from web_fragments.fragment import Fragment
except Exception: # pylint: disable=broad-except
from xblock.fragment import Fragment # For backward compatibility with quince and earlier.


class XBlockFragmentBuilderMixin:
Expand Down
20 changes: 11 additions & 9 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,30 @@
#
appdirs==1.4.4
# via fs
asgiref==3.7.2
asgiref==3.8.1
# via django
django==3.2.24
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
django==4.2.11
# via
# -c requirements/common_constraints.txt
# -r requirements/base.in
fs==2.4.16
# via xblock
lxml==5.1.0
lxml==5.2.1
# via xblock
mako==1.3.2
# via xblock
markupsafe==2.1.5
# via
# mako
# xblock
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
# via xblock
pytz==2024.1
# via
# django
# xblock
# via xblock
pyyaml==6.0.1
# via xblock
simplejson==3.19.2
Expand All @@ -41,11 +43,11 @@ sqlparse==0.4.4
# via django
typing-extensions==4.10.0
# via asgiref
web-fragments==2.1.0
web-fragments==2.2.0
# via xblock
webob==1.8.7
# via xblock
xblock==1.10.0
xblock==3.1.0
# via -r requirements/base.in

# The following packages are considered to be unsafe in a requirements file:
Expand Down
6 changes: 3 additions & 3 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ distlib==0.3.8
# virtualenv
docopt==0.6.2
# via coveralls
filelock==3.13.1
filelock==3.13.3
# via
# -r requirements/tox.txt
# tox
# virtualenv
idna==3.6
# via requests
packaging==23.2
packaging==24.0
# via
# -r requirements/tox.txt
# pyproject-api
Expand All @@ -62,7 +62,7 @@ tomli==2.0.1
# -r requirements/tox.txt
# pyproject-api
# tox
tox==4.13.0
tox==4.14.2
# via -r requirements/tox.txt
urllib3==2.2.1
# via requests
Expand Down
11 changes: 10 additions & 1 deletion requirements/common_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@


# using LTS django version
Django<4.0
Django<5.0

# elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process.
# elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html
elasticsearch<7.14.0

# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected
django-simple-history==3.0.0

# opentelemetry requires version 6.x at the moment:
# https://github.com/open-telemetry/opentelemetry-python/issues/3570
# Normally this could be added as a constraint in edx-django-utils, where we're
# adding the opentelemetry dependency. However, when we compile pip-tools.txt,
# that uses version 7.x, and then there's no undoing that when compiling base.txt.
# So we need to pin it globally, for now.
# Ticket for unpinning: https://github.com/openedx/edx-lint/issues/407
importlib-metadata<7
4 changes: 4 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@

# This file contains all common constraints for edx-repos
-c common_constraints.txt


# Temporary to Support the python 3.11 Upgrade
backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library
4 changes: 2 additions & 2 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#
# make upgrade
#
wheel==0.42.0
wheel==0.43.0
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==24.0
# via -r requirements/pip.in
setuptools==69.1.1
setuptools==69.2.0
# via -r requirements/pip.in
16 changes: 9 additions & 7 deletions requirements/pip_tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
#
# make upgrade
#
build==1.0.3
build==1.2.1
# via pip-tools
click==8.1.7
# via pip-tools
importlib-metadata==7.0.1
# via build
packaging==23.2
importlib-metadata==6.11.0
# via
# -c requirements/common_constraints.txt
# build
packaging==24.0
# via build
pip-tools==7.4.0
pip-tools==7.4.1
# via -r requirements/pip_tools.in
pyproject-hooks==1.0.0
# via
Expand All @@ -23,9 +25,9 @@ tomli==2.0.1
# build
# pip-tools
# pyproject-hooks
wheel==0.42.0
wheel==0.43.0
# via pip-tools
zipp==3.17.0
zipp==3.18.1
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down
22 changes: 13 additions & 9 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ appdirs==1.4.4
# via
# -r requirements/base.txt
# fs
asgiref==3.7.2
asgiref==3.8.1
# via
# -r requirements/base.txt
# django
Expand All @@ -17,6 +17,11 @@ astroid==3.1.0
# -r requirements/test.txt
# pylint
# pylint-celery
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# django
click==8.1.7
# via
# -r requirements/test.txt
Expand All @@ -27,17 +32,17 @@ click-log==0.4.0
# via
# -r requirements/test.txt
# edx-lint
code-annotations==1.6.0
code-annotations==1.7.0
# via
# -r requirements/test.txt
# edx-lint
coverage==7.4.3
coverage==7.4.4
# via -r requirements/test.txt
dill==0.3.8
# via
# -r requirements/test.txt
# pylint
django==3.2.24
django==4.2.11
# via
# -c requirements/common_constraints.txt
# -r requirements/base.txt
Expand All @@ -57,7 +62,7 @@ jinja2==3.1.3
# via
# -r requirements/test.txt
# code-annotations
lxml==5.1.0
lxml==5.2.1
# via
# -r requirements/base.txt
# xblock
Expand Down Expand Up @@ -113,7 +118,7 @@ pymongo==3.13.0
# via
# -r requirements/test.txt
# edx-opaque-keys
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
# via
# -r requirements/base.txt
# xblock
Expand All @@ -124,7 +129,6 @@ python-slugify==8.0.4
pytz==2024.1
# via
# -r requirements/base.txt
# django
# xblock
pyyaml==6.0.1
# via
Expand Down Expand Up @@ -172,15 +176,15 @@ typing-extensions==4.10.0
# astroid
# edx-opaque-keys
# pylint
web-fragments==2.1.0
web-fragments==2.2.0
# via
# -r requirements/base.txt
# xblock
webob==1.8.7
# via
# -r requirements/base.txt
# xblock
xblock==1.10.0
xblock==3.1.0
# via -r requirements/base.txt

# The following packages are considered to be unsafe in a requirements file:
Expand Down
4 changes: 2 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ click==8.1.7
# edx-lint
click-log==0.4.0
# via edx-lint
code-annotations==1.6.0
code-annotations==1.7.0
# via edx-lint
coverage==7.4.3
coverage==7.4.4
# via -r requirements/test.in
dill==0.3.8
# via pylint
Expand Down
6 changes: 3 additions & 3 deletions requirements/tox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ colorama==0.4.6
# via tox
distlib==0.3.8
# via virtualenv
filelock==3.13.1
filelock==3.13.3
# via
# tox
# virtualenv
packaging==23.2
packaging==24.0
# via
# pyproject-api
# tox
Expand All @@ -32,7 +32,7 @@ tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.13.0
tox==4.14.2
# via -r requirements/tox.in
virtualenv==20.25.1
# via tox
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from setuptools import setup

version = '3.2.0'
version = '3.3.0'
description = __doc__.strip().split('\n')[0]
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.rst')) as file_in:
Expand Down Expand Up @@ -120,10 +120,10 @@ def is_requirement(line):
'Programming Language :: JavaScript',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.11',
'Topic :: Education',
'Topic :: Internet :: WWW/HTTP',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
],
test_suite='imagemodal.tests',
Expand Down
14 changes: 6 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[tox]
envlist = csslint,eslint,py38-django{32,42},quality
envlist = csslint,eslint,py{38, 311}-django{42},quality

[testenv]
deps =
django32: Django>=3.2,<4.0
django42: Django>=4.2,<4.3
-rrequirements/test.txt
commands =
Expand All @@ -19,10 +18,10 @@ deps =
skip_install = True

[testenv:csslint]
allowlist_externals =
allowlist_externals =
make
{toxinidir}/node_modules/csslint/dist/cli.js
passenv =
passenv =
TRAVIS
TRAVIS_JOB_ID
TRAVIS_BRANCH
Expand All @@ -33,10 +32,10 @@ deps =
skip_install = True

[testenv:eslint]
allowlist_externals =
allowlist_externals =
make
{toxinidir}/node_modules/eslint/bin/eslint.js
passenv =
passenv =
TRAVIS
TRAVIS_JOB_ID
TRAVIS_BRANCH
Expand All @@ -47,7 +46,7 @@ deps =
skip_install = True

[testenv:quality]
passenv =
passenv =
TRAVIS
TRAVIS_JOB_ID
TRAVIS_BRANCH
Expand All @@ -62,4 +61,3 @@ deps =
transifex-client
commands =
tx push -s

Loading