From d9af1b83b505c1f09bba48ce826de7a297f67078 Mon Sep 17 00:00:00 2001 From: awais qureshi Date: Mon, 19 Feb 2024 23:31:53 +0500 Subject: [PATCH] feat: adding python3.11 support. --- .github/workflows/ci.yml | 9 ++++++--- credentials/apps/records/tests/test_views.py | 2 +- requirements/constraints.txt | 4 ---- requirements/dev.in | 2 -- requirements/test.txt | 6 +++--- tox.ini | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6cdc56c2..fa20d79b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,11 +9,14 @@ on: jobs: quality_and_translations_tests: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.11"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: ${{ matrix.python-version }} architecture: x64 - name: Install Dependencies run: make requirements @@ -33,13 +36,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["py38"] + python-version: ["3.8", "3.11"] django-version: ["django42"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: ${{ matrix.python-version }} architecture: x64 - name: Setup Nodejs Env run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV diff --git a/credentials/apps/records/tests/test_views.py b/credentials/apps/records/tests/test_views.py index 61595d30f..a4968994d 100644 --- a/credentials/apps/records/tests/test_views.py +++ b/credentials/apps/records/tests/test_views.py @@ -196,7 +196,7 @@ def test_email_content_complete(self): # Check output and make sure it seems correct self.assertEqual(len(mail.outbox), 1) email = mail.outbox[0] - message = str(email.message()) + message = email.Message.as_string() self.assertIn(self.program.title + " Credit Request for", email.subject) self.assertIn( self.user.get_full_name() + " would like to apply for credit in the " + self.pathway.name, message diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 74ee34a5e..7ce842d43 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -11,10 +11,6 @@ # Common constraints for edx repos -c common_constraints.txt -# The update to pyyaml 6.x failed as docker-compose wants <6,>=3.10. Pinning to <6.0. This constraint will be -# re-evaluated as part of APER-1556. -pyyaml<6.0 - # Pinning urllib3 to versions < 2.x as this conflicts with boto. This constraint will be re-evaluated as part of # APER-2422 urllib3<2 diff --git a/requirements/dev.in b/requirements/dev.in index 997441f7c..6999c1301 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -11,8 +11,6 @@ # i18n edx-i18n-tools -# for docker devstack -docker-compose # More efficient checking for runserver reload trigger events pywatchman; "linux" in sys_platform diff --git a/requirements/test.txt b/requirements/test.txt index 1d4472435..4c6831a00 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -25,6 +25,7 @@ backoff==2.2.1 # segment-analytics-python backports-zoneinfo==0.2.1 # via + # -c requirements/constraints.txt # -r requirements/base.txt # django # djangorestframework @@ -256,7 +257,7 @@ jinja2==3.1.3 # -r requirements/base.txt # code-annotations # coreschema -lxml[html-clean]==5.1.1 +lxml[html-clean]==5.1.0 # via # -c requirements/constraints.txt # -r requirements/base.txt @@ -402,9 +403,8 @@ pytz==2024.1 # via # -r requirements/base.txt # drf-yasg -pyyaml==5.4.1 +pyyaml==6.0.1 # via - # -c requirements/constraints.txt # -r requirements/base.txt # code-annotations # drf-yasg diff --git a/tox.ini b/tox.ini index 760922624..9692b74df 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{42} +envlist = py{3.8,3.11}-django{42} skipsdist = true [pytest]