Skip to content

Commit

Permalink
Merge pull request #53 from openedx/pythonupgrade
Browse files Browse the repository at this point in the history
Add support for Python 3.11 & 3.12
  • Loading branch information
Feanil Patel authored Apr 17, 2024
2 parents 070304c + 285ae8e commit ebc9e28
Show file tree
Hide file tree
Showing 19 changed files with 262 additions and 204 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, django32, django42]
exclude:
- python-version: '3.8'
toxenv: quality
python-version: ['3.8', '3.11', '3.12']
toxenv: [quality, django42]

steps:
- name: checkout repo
Expand All @@ -40,7 +37,8 @@ jobs:

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.toxenv=='django42'
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
flags: unittests
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
pip-compile --upgrade -o requirements/pip_tools.txt requirements/pip_tools.in
pip install -qr requirements/pip.txt
pip install -qr requirements/pip_tools.txt
pip-compile --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/doc.txt requirements/doc.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/tox.txt requirements/tox.in
pip-compile --upgrade -o requirements/ci.txt requirements/ci.in
pip-compile --upgrade --allow-unsafe -o requirements/base.txt requirements/base.in
pip-compile --upgrade --allow-unsafe -o requirements/doc.txt requirements/doc.in
pip-compile --upgrade --allow-unsafe -o requirements/test.txt requirements/test.in
pip-compile --upgrade --allow-unsafe -o requirements/tox.txt requirements/tox.in
pip-compile --upgrade --allow-unsafe -o requirements/ci.txt requirements/ci.in
# Let tox control the Django version version for tests
grep -e "^django==" requirements/test.txt > requirements/django.txt
grep -e "^asgiref==" requirements/test.txt >> requirements/django.txt
Expand Down
2 changes: 1 addition & 1 deletion django_sites_extensions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
""" django_sites_extensions main module """
__version__ = '4.0.2'
__version__ = '4.1.0'
1 change: 0 additions & 1 deletion django_sites_extensions/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class DjangoSitesExtensionsConfig(AppConfig):
# noinspection PyUnresolvedReferences
def ready(self):
""" Set up for django_sites_extensions app """
# pylint: disable=unused-variable
# pylint: disable=unused-import
# pylint: disable=import-outside-toplevel
from django_sites_extensions import models
Expand Down
2 changes: 1 addition & 1 deletion django_sites_extensions/tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RedirectMiddlewareTestCase(TestCase):
def setUp(self):
super().setUp()
self.middleware = RedirectMiddleware(get_response=lambda request: None)
self.site = Site.objects.get(id=1) # pylint: disable=no-member
self.site = Site.objects.get(id=1)
self.redirect = Redirect.objects.create(site_id=1, old_path='/foo', new_path='http://example.com/bar')

def _make_request(self, path):
Expand Down
2 changes: 1 addition & 1 deletion django_sites_extensions/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
""" ROOT_URLCONF for tests """

from django_sites_extensions.tests import views
from django.urls import path

from django_sites_extensions.tests import views

urlpatterns = [
path('home', views.test, name='home'),
Expand Down
4 changes: 2 additions & 2 deletions django_sites_extensions/tests/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
from django.http import HttpResponse


def test(request): # pylint: disable=unused-argument
def test(request):
""" Placeholder test view """
return HttpResponse("ok")


def login(request): # pylint: disable=unused-argument
def login(request):
""" Placeholder test view """
return HttpResponse("login require")
2 changes: 2 additions & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
-c constraints.txt

Django
setuptools
wheel
24 changes: 17 additions & 7 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
asgiref==3.5.0
asgiref==3.8.1
# via django
django==3.2.12
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
django==4.2.11
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
pytz==2021.3
# via django
sqlparse==0.4.2
sqlparse==0.4.4
# via django
typing-extensions==4.11.0
# via asgiref
wheel==0.43.0
# via -r requirements/base.in

# The following packages are considered to be unsafe in a requirements file:
setuptools==69.2.0
# via -r requirements/base.in
52 changes: 23 additions & 29 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,62 +1,56 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
certifi==2021.10.8
# via requests
charset-normalizer==2.0.12
# via requests
coverage==6.3.1
# via codecov
distlib==0.3.4
cachetools==5.3.3
# via
# -r requirements/tox.txt
# virtualenv
filelock==3.5.0
# tox
chardet==5.2.0
# via
# -r requirements/tox.txt
# tox
# virtualenv
idna==3.3
# via requests
packaging==21.3
colorama==0.4.6
# via
# -r requirements/tox.txt
# tox
platformdirs==2.5.0
distlib==0.3.8
# via
# -r requirements/tox.txt
# virtualenv
filelock==3.13.3
# via
# -r requirements/tox.txt
# tox
# virtualenv
pluggy==1.0.0
packaging==24.0
# via
# -r requirements/tox.txt
# pyproject-api
# tox
py==1.11.0
platformdirs==4.2.0
# via
# -r requirements/tox.txt
# tox
pyparsing==3.0.7
# virtualenv
pluggy==1.4.0
# via
# -r requirements/tox.txt
# packaging
requests==2.27.1
# via codecov
six==1.16.0
# tox
pyproject-api==1.6.1
# via
# -r requirements/tox.txt
# tox
# virtualenv
toml==0.10.2
tomli==2.0.1
# via
# -r requirements/tox.txt
# pyproject-api
# tox
tox==3.24.5
tox==4.14.2
# via -r requirements/tox.txt
urllib3==1.26.8
# via requests
virtualenv==20.13.1
virtualenv==20.25.1
# via
# -r requirements/tox.txt
# tox
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 https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/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/django.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
django==3.2.12
asgiref==3.5.0
django==4.2.11
asgiref==3.8.1
75 changes: 44 additions & 31 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
@@ -1,72 +1,85 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
alabaster==0.7.12
alabaster==0.7.13
# via sphinx
asgiref==3.5.0
asgiref==3.8.1
# via django
babel==2.9.1
babel==2.14.0
# via sphinx
certifi==2021.10.8
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
certifi==2024.2.2
# via requests
charset-normalizer==2.0.12
charset-normalizer==3.3.2
# via requests
django==3.2.12
django==4.2.11
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
docutils==0.17.1
docutils==0.20.1
# via
# sphinx
# sphinx-rtd-theme
idna==3.3
idna==3.6
# via requests
imagesize==1.3.0
imagesize==1.4.1
# via sphinx
importlib-metadata==4.11.1
# via sphinx
jinja2==3.0.3
importlib-metadata==6.11.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# sphinx
jinja2==3.1.3
# via sphinx
markupsafe==2.0.1
markupsafe==2.1.5
# via jinja2
packaging==21.3
packaging==24.0
# via sphinx
pygments==2.11.2
pygments==2.17.2
# via sphinx
pyparsing==3.0.7
# via packaging
pytz==2021.3
# via
# babel
# django
requests==2.27.1
pytz==2024.1
# via babel
requests==2.31.0
# via sphinx
snowballstemmer==2.2.0
# via sphinx
sphinx==4.4.0
sphinx==7.1.2
# via
# -r requirements/doc.in
# sphinx-rtd-theme
sphinx-rtd-theme==1.0.0
# sphinxcontrib-jquery
sphinx-rtd-theme==2.0.0
# via -r requirements/doc.in
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-htmlhelp==2.0.1
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
sqlparse==0.4.2
sqlparse==0.4.4
# via django
urllib3==1.26.8
typing-extensions==4.11.0
# via asgiref
urllib3==2.2.1
# via requests
zipp==3.7.0
wheel==0.43.0
# via -r requirements/base.in
zipp==3.18.1
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==69.2.0
# via -r requirements/base.in
14 changes: 6 additions & 8 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
wheel==0.37.1
wheel==0.43.0
# via -r requirements/pip.in

# The following packages are considered to be unsafe in a requirements file:
pip==22.0.3
pip==24.0
# via -r requirements/pip.in
setuptools==69.2.0
# via -r requirements/pip.in
setuptools==59.8.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/pip.in
Loading

0 comments on commit ebc9e28

Please sign in to comment.