From f746b1f8bcc242b41cf2363339514752359670d6 Mon Sep 17 00:00:00 2001 From: Salman Nawaz Date: Mon, 26 Jun 2023 15:58:54 +0500 Subject: [PATCH 1/9] fix: django upgrade 4.2 --- .github/workflows/ci.yml | 2 +- Makefile | 2 ++ requirements/quality.txt | 4 ++-- requirements/test.txt | 5 ++--- tox.ini | 5 ++++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 579032280..2fd581c43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: matrix: os: [ubuntu-20.04] python-version: [3.8] - toxenv: [py38, integration, quality, translations] + toxenv: [py38, django32, django42, integration, quality, translations] steps: - name: checkout repo diff --git a/Makefile b/Makefile index 19ec38314..d86f817fa 100644 --- a/Makefile +++ b/Makefile @@ -111,6 +111,8 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy $(PIP_COMPILE) -o requirements/workbench.txt requirements/workbench.in $(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in $(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in + sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp + mv requirements/test.tmp requirements/test.txt mysql: ## run mysql database for integration tests docker run --rm -it --name mysql -p 3307:3306 -e MYSQL_ROOT_PASSWORD=rootpw -e MYSQL_DATABASE=db mysql:8 diff --git a/requirements/quality.txt b/requirements/quality.txt index 2acaab290..9326168cd 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -28,11 +28,11 @@ bleach[css]==6.0.0 # via -r requirements/test.txt bok-choy==0.7.1 # via -r requirements/test.txt -boto3==1.26.160 +boto3==1.26.161 # via # -r requirements/test.txt # fs-s3fs -botocore==1.29.160 +botocore==1.29.161 # via # -r requirements/test.txt # boto3 diff --git a/requirements/test.txt b/requirements/test.txt index e53152dae..9f5748c23 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -20,9 +20,9 @@ bleach[css]==6.0.0 # via -r requirements/base.txt bok-choy==0.7.1 # via -r requirements/test.in -boto3==1.26.160 +boto3==1.26.161 # via fs-s3fs -botocore==1.29.160 +botocore==1.29.161 # via # boto3 # s3transfer @@ -40,7 +40,6 @@ coverage[toml]==7.2.7 # via pytest-cov ddt==1.6.0 # via -r requirements/test.in -django==3.2.19 # via # -r requirements/base.txt # django-appconf diff --git a/tox.ini b/tox.ini index 0dd8b5f25..0c667ff4f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38 +envlist = py38-django{32,42} [pycodestyle] exclude = .git,.tox @@ -20,6 +20,8 @@ allowlist_externals = make mkdir deps = + django32: Django>=3.2,<4.0 + django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt commands = mkdir -p var @@ -51,5 +53,6 @@ allowlist_externals = make deps = -r{toxinidir}/requirements/test.txt + django32: Django>=3.2,<3.3 commands = make check_translations_up_to_date From c2410565643bbe05764d49034a7f8225072505ec Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Tue, 27 Jun 2023 23:52:09 +0500 Subject: [PATCH 2/9] chore: debugging. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 0c667ff4f..aa8873df1 100644 --- a/tox.ini +++ b/tox.ini @@ -53,6 +53,6 @@ allowlist_externals = make deps = -r{toxinidir}/requirements/test.txt - django32: Django>=3.2,<3.3 + Django>=3.2,<3.3 commands = make check_translations_up_to_date From b08c1059e8aa846fc703d7cb1b85ad3d224a0570 Mon Sep 17 00:00:00 2001 From: Salman Nawaz Date: Mon, 3 Jul 2023 17:49:23 +0500 Subject: [PATCH 3/9] fix: test for integration, quality and translations on django 32,42 --- .github/workflows/ci.yml | 2 +- tox.ini | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fd581c43..c8cb21eb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: matrix: os: [ubuntu-20.04] python-version: [3.8] - toxenv: [py38, django32, django42, integration, quality, translations] + toxenv: [django32, django42, integration-django32, integration-django42, quality-django32, quality-django42, translations-django32, translations-django42] steps: - name: checkout repo diff --git a/tox.ini b/tox.ini index aa8873df1..5b7a7ab5e 100644 --- a/tox.ini +++ b/tox.ini @@ -32,6 +32,8 @@ allowlist_externals = make xvfb-run deps = + django32: Django>=3.2,<4.0 + django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/workbench.txt setenv = PATH = test_helpers/firefox{:}{env:PATH} @@ -42,6 +44,8 @@ commands = [testenv:quality] deps = + django32: Django>=3.2,<4.0 + django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/quality.txt commands = pycodestyle drag_and_drop_v2 tests manage.py setup.py --max-line-length=120 @@ -52,6 +56,8 @@ commands = allowlist_externals = make deps = + django32: Django>=3.2,<4.0 + django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt Django>=3.2,<3.3 commands = From 152f98bf6da3e4a6d0846fdf1df5f1b366c9fb4b Mon Sep 17 00:00:00 2001 From: Usama Sadiq Date: Mon, 3 Jul 2023 18:02:22 +0500 Subject: [PATCH 4/9] fix: update tox env list --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 5b7a7ab5e..8259439d1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,42} +envlist = py38-django{32,42}, quality-django{32,42}, translations-django{32,42} [pycodestyle] exclude = .git,.tox From bf3933c2c8d897b63299a276e888bdbf077758c2 Mon Sep 17 00:00:00 2001 From: Usama Sadiq Date: Mon, 3 Jul 2023 18:05:13 +0500 Subject: [PATCH 5/9] fix: update tox envlist --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 8259439d1..ebc60633c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,42}, quality-django{32,42}, translations-django{32,42} +envlist = {py38,quality,integration,translations}-django{32,42} [pycodestyle] exclude = .git,.tox From 4fcf2db71059a615761974a64d6523bef90d1956 Mon Sep 17 00:00:00 2001 From: Usama Sadiq Date: Mon, 3 Jul 2023 18:10:10 +0500 Subject: [PATCH 6/9] fix: Update tox.ini --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index ebc60633c..5ab96e487 100644 --- a/tox.ini +++ b/tox.ini @@ -59,6 +59,5 @@ deps = django32: Django>=3.2,<4.0 django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt - Django>=3.2,<3.3 commands = make check_translations_up_to_date From 096773a996eccd63406a009543cb8137b5a87e94 Mon Sep 17 00:00:00 2001 From: UsamaSadiq Date: Tue, 4 Jul 2023 15:08:09 +0500 Subject: [PATCH 7/9] fix: update tox envlist combinations --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 5ab96e487..fd9889f6a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = {py38,quality,integration,translations}-django{32,42} +envlist = py38-django{32,42},quality-django{32,42},integration-django{32,42},translations-django{32,42} [pycodestyle] exclude = .git,.tox From d5f2090822abc39837513475989f0eea8917aa6b Mon Sep 17 00:00:00 2001 From: UsamaSadiq Date: Tue, 4 Jul 2023 23:18:15 +0500 Subject: [PATCH 8/9] fix: split tox envs for integration and translation tests --- .github/workflows/ci.yml | 6 +++--- Makefile | 4 ++-- requirements/workbench.txt | 1 - tox.ini | 37 ++++++++++++++++++++++++++++--------- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8cb21eb9..fad7c4586 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: matrix: os: [ubuntu-20.04] python-version: [3.8] - toxenv: [django32, django42, integration-django32, integration-django42, quality-django32, quality-django42, translations-django32, translations-django42] + toxenv: [py38-django32, py38-django42, integration-django32, integration-django42, quality, translations-django32, translations-django42] steps: - name: checkout repo @@ -43,13 +43,13 @@ jobs: # `libgtk2.0-0` and `libxt6` are required by an older version of Firefox. - name: Install Required System Packages - if: matrix.toxenv == 'integration' + if: ${{ startsWith(matrix.toxenv, 'integration') }} run: | sudo apt-get update sudo apt-get install -y libxmlsec1-dev ubuntu-restricted-extras xvfb libxml2-dev libxslt-dev libevent-dev libgtk2.0-0 libxt6 - name: Install translations dependencies - if: matrix.toxenv == 'translations' + if: ${{ startsWith(matrix.toxenv, 'translations') }} run: | sudo apt-get update sudo apt-get install -y gettext diff --git a/Makefile b/Makefile index d86f817fa..a13024bd4 100644 --- a/Makefile +++ b/Makefile @@ -111,8 +111,8 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy $(PIP_COMPILE) -o requirements/workbench.txt requirements/workbench.in $(PIP_COMPILE) -o requirements/ci.txt requirements/ci.in $(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in - sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp - mv requirements/test.tmp requirements/test.txt + sed -i '/^[dD]jango==/d' requirements/test.txt + sed -i '/^[dD]jango==/d' requirements/workbench.txt mysql: ## run mysql database for integration tests docker run --rm -it --name mysql -p 3307:3306 -e MYSQL_ROOT_PASSWORD=rootpw -e MYSQL_DATABASE=db mysql:8 diff --git a/requirements/workbench.txt b/requirements/workbench.txt index abb7f8917..2c18426c1 100644 --- a/requirements/workbench.txt +++ b/requirements/workbench.txt @@ -59,7 +59,6 @@ coverage[toml]==7.2.7 # pytest-cov ddt==1.6.0 # via -r requirements/test.txt -django==3.2.19 # via # -r requirements/test.txt # django-appconf diff --git a/tox.ini b/tox.ini index fd9889f6a..f41696c24 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,42},quality-django{32,42},integration-django{32,42},translations-django{32,42} +envlist = py38-django{32,42},quality,integration-django{32,42},translations-django{32,42} [pycodestyle] exclude = .git,.tox @@ -27,13 +27,26 @@ commands = mkdir -p var pytest {posargs:tests/unit/ --cov drag_and_drop_v2} -[testenv:integration] +[testenv:integration-django32] allowlist_externals = make xvfb-run deps = - django32: Django>=3.2,<4.0 - django42: Django>=4.2,<4.3 + Django>=3.2,<4.0 + -r{toxinidir}/requirements/workbench.txt +setenv = + PATH = test_helpers/firefox{:}{env:PATH} + WORKBENCH_DATABASES = \{"default": \{"ENGINE": "django.db.backends.mysql", "NAME": "db", "USER": "root", "PASSWORD": "rootpw", "HOST": "127.0.0.1", "PORT": "3307"\}\} +commands = + make install_firefox + xvfb-run ./run_tests.py {posargs:tests.integration} + +[testenv:integration-django42] +allowlist_externals = + make + xvfb-run +deps = + Django>=4.2,<4.3 -r{toxinidir}/requirements/workbench.txt setenv = PATH = test_helpers/firefox{:}{env:PATH} @@ -44,20 +57,26 @@ commands = [testenv:quality] deps = - django32: Django>=3.2,<4.0 - django42: Django>=4.2,<4.3 -r{toxinidir}/requirements/quality.txt commands = pycodestyle drag_and_drop_v2 tests manage.py setup.py --max-line-length=120 pylint drag_and_drop_v2 pylint tests --rcfile=tests/pylintrc -[testenv:translations] +[testenv:translations-django32] allowlist_externals = make deps = - django32: Django>=3.2,<4.0 - django42: Django>=4.2,<4.3 + Django>=3.2,<4.0 + -r{toxinidir}/requirements/test.txt +commands = + make check_translations_up_to_date + +[testenv:translations-django42] +allowlist_externals = + make +deps = + Django>=4.2,<4.3 -r{toxinidir}/requirements/test.txt commands = make check_translations_up_to_date From 20d5607d5686d808c8e5f0ba32409c02bb7ed9a5 Mon Sep 17 00:00:00 2001 From: UsamaSadiq Date: Fri, 7 Jul 2023 18:24:52 +0500 Subject: [PATCH 9/9] chore: upgrade i18n-tools version --- requirements/dev.txt | 2 +- requirements/quality.txt | 2 +- requirements/test.txt | 2 +- requirements/workbench.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 2273231a2..3207786f2 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -120,7 +120,7 @@ django-statici18n==2.3.1 # via # -r requirements/quality.txt # -r requirements/workbench.txt -edx-i18n-tools==0.9.2 +edx-i18n-tools==1.0.0 # via # -r requirements/quality.txt # -r requirements/workbench.txt diff --git a/requirements/quality.txt b/requirements/quality.txt index 3787b9dd2..90dab700d 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -84,7 +84,7 @@ django-appconf==1.0.5 # django-statici18n django-statici18n==2.3.1 # via -r requirements/test.txt -edx-i18n-tools==0.9.2 +edx-i18n-tools==1.0.0 # via -r requirements/test.txt edx-lint==5.3.4 # via -r requirements/quality.in diff --git a/requirements/test.txt b/requirements/test.txt index 071bca377..a07413874 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -53,7 +53,7 @@ django-appconf==1.0.5 # django-statici18n django-statici18n==2.3.1 # via -r requirements/base.txt -edx-i18n-tools==0.9.2 +edx-i18n-tools==1.0.0 # via -r requirements/test.in exceptiongroup==1.1.1 # via pytest diff --git a/requirements/workbench.txt b/requirements/workbench.txt index befc2ba74..b44cde71a 100644 --- a/requirements/workbench.txt +++ b/requirements/workbench.txt @@ -72,7 +72,7 @@ django-appconf==1.0.5 # django-statici18n django-statici18n==2.3.1 # via -r requirements/test.txt -edx-i18n-tools==0.9.2 +edx-i18n-tools==1.0.0 # via -r requirements/test.txt exceptiongroup==1.1.1 # via