From 39760f17646e8f58735d5efc4a76792a0cdb90ea 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 | 12 ++++++--- requirements/all.txt | 51 +++-------------------------------- requirements/base.txt | 6 ++--- requirements/constraints.txt | 8 +++--- requirements/dev.in | 2 -- requirements/dev.txt | 38 +++----------------------- requirements/production.txt | 6 ++--- requirements/test.txt | 6 ++--- requirements/translations.txt | 12 ++++----- tox.ini | 2 +- 10 files changed, 34 insertions(+), 109 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6cdc56c2..390f99f4e 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 @@ -91,10 +94,11 @@ jobs: make static make tests - name: Run code coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: flags: unittests fail_ci_if_error: true + token: ${{secrets.CODECOV_TOKEN}} docs: runs-on: ubuntu-latest diff --git a/requirements/all.txt b/requirements/all.txt index 62b5b204d..bffb95c01 100644 --- a/requirements/all.txt +++ b/requirements/all.txt @@ -21,15 +21,15 @@ attrs==23.2.0 # -r requirements/dev.txt # -r requirements/production.txt # edx-ace - # jsonschema # openedx-events backoff==2.2.1 # via # -r requirements/dev.txt # -r requirements/production.txt # segment-analytics-python -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/dev.txt # -r requirements/production.txt # django @@ -117,7 +117,6 @@ cryptography==42.0.7 # via # -r requirements/dev.txt # -r requirements/production.txt - # paramiko # pyjwt # social-auth-core ddt==1.7.2 @@ -140,10 +139,6 @@ distlib==0.3.8 # via # -r requirements/dev.txt # virtualenv -distro==1.9.0 - # via - # -r requirements/dev.txt - # docker-compose django==4.2.12 # via # -c requirements/common_constraints.txt @@ -250,20 +245,6 @@ dnspython==2.6.1 # -r requirements/dev.txt # -r requirements/production.txt # pymongo -docker[ssh]==7.0.0 - # via - # -r requirements/dev.txt - # docker-compose -docker-compose==1.29.2 - # via -r requirements/dev.txt -dockerpty==0.4.1 - # via - # -r requirements/dev.txt - # docker-compose -docopt==0.6.2 - # via - # -r requirements/dev.txt - # docker-compose drf-jwt==1.19.2 # via # -r requirements/dev.txt @@ -406,10 +387,6 @@ jmespath==1.0.1 # -r requirements/production.txt # boto3 # botocore -jsonschema==3.2.0 - # via - # -r requirements/dev.txt - # docker-compose lxml[html-clean]==5.1.1 # via # -c requirements/constraints.txt @@ -470,16 +447,11 @@ packaging==24.0 # -r requirements/dev.txt # -r requirements/production.txt # black - # docker # drf-yasg # gunicorn # pyproject-api # pytest # tox -paramiko==3.4.0 - # via - # -r requirements/dev.txt - # docker path==16.14.0 # via # -r requirements/dev.txt @@ -573,7 +545,6 @@ pynacl==1.5.0 # -r requirements/dev.txt # -r requirements/production.txt # edx-django-utils - # paramiko pypng==0.20220715.0 # via # -r requirements/dev.txt @@ -601,10 +572,6 @@ python-dateutil==2.9.0.post0 # edx-ace # faker # segment-analytics-python -python-dotenv==0.21.1 - # via - # -r requirements/dev.txt - # docker-compose python-memcached==1.62 # via # -r requirements/dev.txt @@ -627,13 +594,11 @@ pytz==2024.1 # drf-yasg pywatchman==2.0.0 ; "linux" in sys_platform # via -r requirements/dev.txt -pyyaml==5.4.1 +pyyaml==6.0.1 # via - # -c requirements/constraints.txt # -r requirements/dev.txt # -r requirements/production.txt # code-annotations - # docker-compose # drf-yasg # edx-django-release-util # edx-i18n-tools @@ -647,8 +612,6 @@ requests==2.31.0 # -r requirements/dev.txt # -r requirements/production.txt # coreapi - # docker - # docker-compose # edx-drf-extensions # edx-rest-api-client # requests-oauthlib @@ -693,14 +656,11 @@ six==1.16.0 # -r requirements/dev.txt # -r requirements/production.txt # bleach - # dockerpty # edx-ace # edx-auth-backends # edx-django-release-util # edx-lint - # jsonschema # python-dateutil - # websocket-client slumber==0.7.1 # via # -r requirements/dev.txt @@ -738,10 +698,6 @@ text-unidecode==1.3 # -r requirements/dev.txt # -r requirements/production.txt # python-slugify -texttable==1.7.0 - # via - # -r requirements/dev.txt - # docker-compose tomli==2.0.1 # via # -r requirements/dev.txt @@ -778,7 +734,6 @@ urllib3==1.26.18 # -r requirements/dev.txt # -r requirements/production.txt # botocore - # docker # requests # responses virtualenv==20.26.1 diff --git a/requirements/base.txt b/requirements/base.txt index 81a8dbbbf..209ab8938 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -15,8 +15,9 @@ attrs==23.2.0 # openedx-events backoff==2.2.1 # via segment-analytics-python -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # django # djangorestframework bleach==6.1.0 @@ -249,9 +250,8 @@ pytz==2024.1 # via # -r requirements/base.in # drf-yasg -pyyaml==5.4.1 +pyyaml==6.0.1 # via - # -c requirements/constraints.txt # code-annotations # drf-yasg # edx-django-release-util diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 74ee34a5e..d395f13e4 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -11,14 +11,14 @@ # 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 + +# Temporary to Support the python 3.11 Upgrade +backports.zoneinfo;python_version<"3.9" # Newer versions have zoneinfo available in the standard library + # Pinning lxml to < 5.2 as edx-i18n-tools package needs to be updated. # Release notes: https://pypi.org/project/lxml/5.2.0/ # Github issue: https://github.com/openedx/i18n-tools/issues/144 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/dev.txt b/requirements/dev.txt index f79f978c7..a790537b7 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -19,14 +19,14 @@ attrs==23.2.0 # via # -r requirements/test.txt # edx-ace - # jsonschema # openedx-events backoff==2.2.1 # via # -r requirements/test.txt # segment-analytics-python -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/test.txt # django # djangorestframework @@ -92,7 +92,6 @@ coverage==7.5.1 cryptography==42.0.7 # via # -r requirements/test.txt - # paramiko # pyjwt # social-auth-core ddt==1.7.2 @@ -112,8 +111,6 @@ distlib==0.3.8 # via # -r requirements/test.txt # virtualenv -distro==1.9.0 - # via docker-compose django==4.2.12 # via # -c requirements/common_constraints.txt @@ -191,14 +188,6 @@ dnspython==2.6.1 # via # -r requirements/test.txt # pymongo -docker[ssh]==7.0.0 - # via docker-compose -docker-compose==1.29.2 - # via -r requirements/dev.in -dockerpty==0.4.1 - # via docker-compose -docopt==0.6.2 - # via docker-compose drf-jwt==1.19.2 # via # -r requirements/test.txt @@ -298,8 +287,6 @@ jinja2==3.1.4 # -r requirements/test.txt # code-annotations # coreschema -jsonschema==3.2.0 - # via docker-compose lxml[html-clean]==5.1.1 # via # -c requirements/constraints.txt @@ -345,13 +332,10 @@ packaging==24.0 # via # -r requirements/test.txt # black - # docker # drf-yasg # pyproject-api # pytest # tox -paramiko==3.4.0 - # via docker path==16.14.0 # via # -r requirements/test.txt @@ -431,7 +415,6 @@ pynacl==1.5.0 # via # -r requirements/test.txt # edx-django-utils - # paramiko pypng==0.20220715.0 # via # -r requirements/test.txt @@ -454,8 +437,6 @@ python-dateutil==2.9.0.post0 # edx-ace # faker # segment-analytics-python -python-dotenv==0.21.1 - # via docker-compose python-memcached==1.62 # via -r requirements/test.txt python-slugify==8.0.4 @@ -472,12 +453,10 @@ pytz==2024.1 # drf-yasg pywatchman==2.0.0 ; "linux" in sys_platform # via -r requirements/dev.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via - # -c requirements/constraints.txt # -r requirements/test.txt # code-annotations - # docker-compose # drf-yasg # edx-django-release-util # edx-i18n-tools @@ -488,8 +467,6 @@ requests==2.31.0 # via # -r requirements/test.txt # coreapi - # docker - # docker-compose # edx-drf-extensions # edx-rest-api-client # requests-oauthlib @@ -523,14 +500,11 @@ six==1.16.0 # via # -r requirements/test.txt # bleach - # dockerpty # edx-ace # edx-auth-backends # edx-django-release-util # edx-lint - # jsonschema # python-dateutil - # websocket-client slumber==0.7.1 # via # -r requirements/test.txt @@ -562,8 +536,6 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -texttable==1.7.0 - # via docker-compose tomli==2.0.1 # via # -r requirements/test.txt @@ -596,7 +568,6 @@ urllib3==1.26.18 # via # -c requirements/constraints.txt # -r requirements/test.txt - # docker # requests # responses virtualenv==20.26.1 @@ -615,6 +586,3 @@ zipp==3.18.1 # via # -r requirements/test.txt # importlib-metadata - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements/production.txt b/requirements/production.txt index 6eebd4a0d..3e5134754 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -19,8 +19,9 @@ backoff==2.2.1 # via # -r requirements/base.txt # segment-analytics-python -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/base.txt # django # djangorestframework @@ -342,9 +343,8 @@ pytz==2024.1 # -r requirements/base.txt # django-ses # drf-yasg -pyyaml==5.4.1 +pyyaml==6.0.1 # via - # -c requirements/constraints.txt # -r requirements/base.txt # -r requirements/production.in # code-annotations diff --git a/requirements/test.txt b/requirements/test.txt index 5ee74cde4..735101bed 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -23,8 +23,9 @@ backoff==2.2.1 # via # -r requirements/base.txt # segment-analytics-python -backports-zoneinfo==0.2.1 +backports-zoneinfo==0.2.1 ; python_version < "3.9" # via + # -c requirements/constraints.txt # -r requirements/base.txt # django # djangorestframework @@ -406,9 +407,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/requirements/translations.txt b/requirements/translations.txt index 1e95eb911..fc6f30087 100644 --- a/requirements/translations.txt +++ b/requirements/translations.txt @@ -6,8 +6,10 @@ # asgiref==3.8.1 # via django -backports-zoneinfo==0.2.1 - # via django +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django django==4.2.12 # via # -c requirements/common_constraints.txt @@ -22,10 +24,8 @@ path==16.14.0 # via edx-i18n-tools polib==1.2.0 # via edx-i18n-tools -pyyaml==5.4.1 - # via - # -c requirements/constraints.txt - # edx-i18n-tools +pyyaml==6.0.1 + # via edx-i18n-tools sqlparse==0.5.0 # via django typing-extensions==4.11.0 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]