Skip to content

Commit

Permalink
Merge pull request #48 from openedx/zshkoor/django42-upgrade
Browse files Browse the repository at this point in the history
fix: django 42 support added
  • Loading branch information
UsamaSadiq authored Oct 11, 2023
2 parents d4b4717 + d398ecf commit 30ee91b
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [quality, django32]
toxenv: [quality, django32, django42]
exclude:
- python-version: '3.8'
toxenv: quality
Expand All @@ -39,7 +39,7 @@ jobs:
run: tox

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.toxenv=='django32'
if: matrix.python-version == '3.8' && matrix.toxenv=='django42'
uses: codecov/codecov-action@v3
with:
flags: unittests
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
pip-compile --upgrade -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
sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt
sed '/^asgiref==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt
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.1'
__version__ = '4.0.2'
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 @@ -16,7 +16,7 @@ class RedirectMiddlewareTestCase(TestCase):

def setUp(self):
super().setUp()
self.middleware = RedirectMiddleware()
self.middleware = RedirectMiddleware(get_response=lambda request: None)
self.site = Site.objects.get(id=1) # pylint: disable=no-member
self.redirect = Redirect.objects.create(site_id=1, old_path='/foo', new_path='http://example.com/bar')

Expand Down
1 change: 1 addition & 0 deletions requirements/django.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
django==3.2.12
asgiref==3.5.0
2 changes: 2 additions & 0 deletions requirements/django42.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
asgiref==3.6.0
django==4.2.6
4 changes: 0 additions & 4 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#
# make upgrade
#
asgiref==3.5.0
# via
# -r requirements/base.txt
# django
astroid==2.9.3
# via
# pylint
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def get_version(*file_paths):
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
],
keywords='Django sites edx',
url='https://github.com/openedx/edx-django-sites-extensions',
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[tox]
envlist = python{3.8}-django{32},quality,docs
envlist = python{3.8}-django{32, 42},quality,docs

[testenv]
setenv =
PYTHONPATH = {toxinidir}
DJANGO_SETTINGS_MODULE = test_settings
deps =
django32: Django>=3.2,<4.0
django32: -r requirements/django.txt
django42: -r requirements/django42.txt
-r requirements/test.txt
commands =
pytest --cov=django_sites_extensions
Expand Down

0 comments on commit 30ee91b

Please sign in to comment.