From 2305c9ba7c55fa7b502085689d62e0002f44b764 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 7 Nov 2023 09:59:35 -0500 Subject: [PATCH 1/3] test: Don't depend on the xblock-sdk runtime. We don't want to depend on the xblock-sdk WorkbenchRuntime because it will cause a circular dependency between tests in xblock and the released version of the workbench which already depends on XBlock. Instead use the ToyRuntime available for testing in this repository and don't run the workbench during testing. --- requirements/test.in | 1 - xblock/test/settings.py | 1 - xblock/test/utils/test_helpers.py | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/requirements/test.in b/requirements/test.in index 7ddb1238f..4a5d2a57b 100644 --- a/requirements/test.in +++ b/requirements/test.in @@ -18,4 +18,3 @@ pytest pytest-cov pytest-django tox -xblock-sdk diff --git a/xblock/test/settings.py b/xblock/test/settings.py index 5fb5608d9..ee62f3874 100644 --- a/xblock/test/settings.py +++ b/xblock/test/settings.py @@ -109,7 +109,6 @@ # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', - 'workbench' ) # A sample logging configuration. The only tangible logging diff --git a/xblock/test/utils/test_helpers.py b/xblock/test/utils/test_helpers.py index 2c342a2c5..c76344e11 100644 --- a/xblock/test/utils/test_helpers.py +++ b/xblock/test/utils/test_helpers.py @@ -4,9 +4,8 @@ import unittest -from workbench.runtime import WorkbenchRuntime - from xblock.core import XBlock +from xblock.test.toy_runtime import ToyRuntime from xblock.utils.helpers import child_isinstance @@ -45,7 +44,7 @@ def test_child_isinstance(self): """ Check that child_isinstance() works on direct children """ - runtime = WorkbenchRuntime() + runtime = ToyRuntime() root_id = runtime.parse_xml_string(' ') root = runtime.get_block(root_id) self.assertFalse(child_isinstance(root, root.children[0], DogXBlock)) @@ -67,7 +66,7 @@ def test_child_isinstance_descendants(self): """ Check that child_isinstance() works on deeper descendants """ - runtime = WorkbenchRuntime() + runtime = ToyRuntime() root_id = runtime.parse_xml_string(' ') root = runtime.get_block(root_id) block = root.runtime.get_block(root.children[0]) From f9b6a960ae7556541899bfec97655f7a962aa6a6 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 7 Nov 2023 10:06:44 -0500 Subject: [PATCH 2/3] style: Update pylintrc. --- pylintrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pylintrc b/pylintrc index 9642639f9..7d1475a9a 100644 --- a/pylintrc +++ b/pylintrc @@ -64,7 +64,7 @@ # SERIOUSLY. # # ------------------------------ -# Generated by edx-lint version: 5.3.2 +# Generated by edx-lint version: 5.3.4 # ------------------------------ [MASTER] ignore = @@ -383,6 +383,6 @@ ext-import-graph = int-import-graph = [EXCEPTIONS] -overgeneral-exceptions = Exception +overgeneral-exceptions = builtins.Exception -# 4ffcd1a49c7a1312d20c4b5f8ed46fcbe7ea9fa4 +# 5cb04be4e3ce86ceb4bd99d377a603089cc12dd3 From 07b9db3046356886abc400cb5e268ca1e8429fb9 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Tue, 14 Nov 2023 09:18:28 -0500 Subject: [PATCH 3/3] chore: Run `make upgrade` --- requirements/ci.txt | 1 + requirements/dev.txt | 106 +++++----------------------------------- requirements/django.txt | 4 +- requirements/doc.txt | 4 +- requirements/test.txt | 90 ++++++---------------------------- 5 files changed, 30 insertions(+), 175 deletions(-) diff --git a/requirements/ci.txt b/requirements/ci.txt index 05f22599f..286dbfd12 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -24,6 +24,7 @@ packaging==23.2 # tox platformdirs==3.11.0 # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # tox # virtualenv pluggy==1.3.0 diff --git a/requirements/dev.txt b/requirements/dev.txt index e722e28c5..019d9e9c6 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -12,10 +12,6 @@ appdirs==1.4.4 # via # -r requirements/test.txt # fs -arrow==1.3.0 - # via - # -r requirements/test.txt - # cookiecutter astroid==3.0.1 # via # -r requirements/test.txt @@ -25,15 +21,11 @@ attrs==23.1.0 # via # -r requirements/test.txt # hypothesis -binaryornot==0.4.4 - # via - # -r requirements/test.txt - # cookiecutter -boto3==1.28.84 +boto3==1.28.85 # via # -r requirements/test.txt # fs-s3fs -botocore==1.31.84 +botocore==1.31.85 # via # -r requirements/test.txt # boto3 @@ -47,27 +39,17 @@ cachetools==5.3.2 # -r requirements/ci.txt # -r requirements/test.txt # tox -certifi==2023.7.22 - # via - # -r requirements/test.txt - # requests chardet==5.2.0 # via # -r requirements/ci.txt # -r requirements/test.txt - # binaryornot # tox -charset-normalizer==3.3.2 - # via - # -r requirements/test.txt - # requests click==8.1.7 # via # -r requirements/pip-tools.txt # -r requirements/test.txt # click-log # code-annotations - # cookiecutter # edx-lint # pip-tools click-log==0.4.0 @@ -83,10 +65,6 @@ colorama==0.4.6 # -r requirements/ci.txt # -r requirements/test.txt # tox -cookiecutter==2.4.0 - # via - # -r requirements/test.txt - # xblock-sdk coverage[toml]==7.3.2 # via # -r requirements/ci.txt @@ -113,7 +91,6 @@ django==2.2.28 # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt # openedx-django-pyfs - # xblock-sdk edx-lint==5.3.6 # via -r requirements/test.txt exceptiongroup==1.1.3 @@ -132,18 +109,12 @@ fs==2.4.16 # -r requirements/test.txt # fs-s3fs # openedx-django-pyfs - # xblock fs-s3fs==1.1.1 # via # -r requirements/test.txt # openedx-django-pyfs - # xblock-sdk -hypothesis==6.88.3 +hypothesis==6.88.4 # via -r requirements/test.txt -idna==3.4 - # via - # -r requirements/test.txt - # requests importlib-metadata==6.8.0 # via # -r requirements/pip-tools.txt @@ -164,7 +135,6 @@ jinja2==3.1.2 # via # -r requirements/test.txt # code-annotations - # cookiecutter # diff-cover # jinja2-pluralize jinja2-pluralize==0.3.0 @@ -179,32 +149,18 @@ jmespath==1.0.1 lazy==1.6 # via -r requirements/test.txt lxml==4.9.3 - # via - # -r requirements/test.txt - # xblock - # xblock-sdk + # via -r requirements/test.txt mako==1.3.0 - # via - # -r requirements/test.txt - # xblock -markdown-it-py==3.0.0 - # via - # -r requirements/test.txt - # rich + # via -r requirements/test.txt markupsafe==2.1.3 # via # -r requirements/test.txt # jinja2 # mako - # xblock mccabe==0.7.0 # via # -r requirements/test.txt # pylint -mdurl==0.1.2 - # via - # -r requirements/test.txt - # markdown-it-py mock==5.1.0 # via -r requirements/test.txt openedx-django-pyfs==3.4.0 @@ -228,6 +184,7 @@ pip-tools==7.3.0 # via -r requirements/pip-tools.txt platformdirs==3.11.0 # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/ci.txt # -r requirements/test.txt # pylint @@ -242,11 +199,11 @@ pluggy==1.3.0 # tox pycodestyle==2.11.1 # via -r requirements/test.txt -pydantic==2.4.2 +pydantic==2.5.0 # via # -r requirements/test.txt # inflect -pydantic-core==2.10.1 +pydantic-core==2.14.1 # via # -r requirements/test.txt # pydantic @@ -254,7 +211,6 @@ pygments==2.16.1 # via # -r requirements/test.txt # diff-cover - # rich pylint==3.0.2 # via # -r requirements/test.txt @@ -275,10 +231,6 @@ pylint-plugin-utils==0.8.2 # -r requirements/test.txt # pylint-celery # pylint-django -pypng==0.20220715.0 - # via - # -r requirements/test.txt - # xblock-sdk pyproject-api==1.6.1 # via # -r requirements/ci.txt @@ -300,43 +252,25 @@ pytest-django==4.7.0 python-dateutil==2.8.2 # via # -r requirements/test.txt - # arrow # botocore - # xblock python-slugify==8.0.1 # via # -r requirements/test.txt # code-annotations - # cookiecutter pytz==2023.3.post1 # via # -r requirements/test.txt # django - # xblock pyyaml==6.0.1 # via # -r requirements/test.txt # code-annotations - # cookiecutter - # xblock -requests==2.31.0 - # via - # -r requirements/test.txt - # cookiecutter - # xblock-sdk -rich==13.6.0 - # via - # -r requirements/test.txt - # cookiecutter s3transfer==0.7.0 # via # -r requirements/test.txt # boto3 simplejson==3.19.2 - # via - # -r requirements/test.txt - # xblock - # xblock-sdk + # via -r requirements/test.txt six==1.16.0 # via # -r requirements/test.txt @@ -381,10 +315,6 @@ tox==4.11.3 # via # -r requirements/ci.txt # -r requirements/test.txt -types-python-dateutil==2.8.19.14 - # via - # -r requirements/test.txt - # arrow typing-extensions==4.8.0 # via # -r requirements/test.txt @@ -394,37 +324,23 @@ typing-extensions==4.8.0 # pydantic # pydantic-core # pylint - # rich urllib3==1.26.18 # via # -r requirements/test.txt # botocore - # requests virtualenv==20.24.6 # via # -r requirements/ci.txt # -r requirements/test.txt # tox web-fragments==2.1.0 - # via - # -r requirements/test.txt - # xblock - # xblock-sdk + # via -r requirements/test.txt webob==1.8.7 - # via - # -r requirements/test.txt - # xblock - # xblock-sdk + # via -r requirements/test.txt wheel==0.41.3 # via # -r requirements/pip-tools.txt # pip-tools -xblock==1.8.1 - # via - # -r requirements/test.txt - # xblock-sdk -xblock-sdk==0.7.0 - # via -r requirements/test.txt zipp==3.17.0 # via # -r requirements/pip-tools.txt diff --git a/requirements/django.txt b/requirements/django.txt index 5687c3016..772ca0ba0 100644 --- a/requirements/django.txt +++ b/requirements/django.txt @@ -8,9 +8,9 @@ appdirs==1.4.4 # via # -r requirements/base.txt # fs -boto3==1.28.84 +boto3==1.28.85 # via fs-s3fs -botocore==1.31.84 +botocore==1.31.85 # via # boto3 # s3transfer diff --git a/requirements/doc.txt b/requirements/doc.txt index fed4452fd..8d4dcf827 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -18,11 +18,11 @@ babel==2.13.1 # sphinx beautifulsoup4==4.12.2 # via pydata-sphinx-theme -boto3==1.28.84 +boto3==1.28.85 # via # -r requirements/django.txt # fs-s3fs -botocore==1.31.84 +botocore==1.31.85 # via # -r requirements/django.txt # boto3 diff --git a/requirements/test.txt b/requirements/test.txt index af1716867..f5756d82c 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -10,8 +10,6 @@ appdirs==1.4.4 # via # -r requirements/django.txt # fs -arrow==1.3.0 - # via cookiecutter astroid==3.0.1 # via # -r requirements/test.in @@ -19,32 +17,23 @@ astroid==3.0.1 # pylint-celery attrs==23.1.0 # via hypothesis -binaryornot==0.4.4 - # via cookiecutter -boto3==1.28.84 +boto3==1.28.85 # via # -r requirements/django.txt # fs-s3fs -botocore==1.31.84 +botocore==1.31.85 # via # -r requirements/django.txt # boto3 # s3transfer cachetools==5.3.2 # via tox -certifi==2023.7.22 - # via requests chardet==5.2.0 - # via - # binaryornot - # tox -charset-normalizer==3.3.2 - # via requests + # via tox click==8.1.7 # via # click-log # code-annotations - # cookiecutter # edx-lint click-log==0.4.0 # via edx-lint @@ -52,8 +41,6 @@ code-annotations==1.5.0 # via edx-lint colorama==0.4.6 # via tox -cookiecutter==2.4.0 - # via xblock-sdk coverage[toml]==7.3.2 # via # -r requirements/test.in @@ -72,7 +59,6 @@ distlib==0.3.7 # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/django.txt # openedx-django-pyfs - # xblock-sdk edx-lint==5.3.6 # via -r requirements/test.in exceptiongroup==1.1.3 @@ -88,16 +74,12 @@ fs==2.4.16 # -r requirements/django.txt # fs-s3fs # openedx-django-pyfs - # xblock fs-s3fs==1.1.1 # via # -r requirements/django.txt # openedx-django-pyfs - # xblock-sdk -hypothesis==6.88.3 +hypothesis==6.88.4 # via -r requirements/test.in -idna==3.4 - # via requests inflect==7.0.0 # via jinja2-pluralize iniconfig==2.0.0 @@ -107,7 +89,6 @@ isort==5.12.0 jinja2==3.1.2 # via # code-annotations - # cookiecutter # diff-cover # jinja2-pluralize jinja2-pluralize==0.3.0 @@ -120,26 +101,16 @@ jmespath==1.0.1 lazy==1.6 # via -r requirements/django.txt lxml==4.9.3 - # via - # -r requirements/django.txt - # xblock - # xblock-sdk + # via -r requirements/django.txt mako==1.3.0 - # via - # -r requirements/django.txt - # xblock -markdown-it-py==3.0.0 - # via rich + # via -r requirements/django.txt markupsafe==2.1.3 # via # -r requirements/django.txt # jinja2 # mako - # xblock mccabe==0.7.0 # via pylint -mdurl==0.1.2 - # via markdown-it-py mock==5.1.0 # via -r requirements/test.in openedx-django-pyfs==3.4.0 @@ -155,6 +126,7 @@ pbr==6.0.0 # via stevedore platformdirs==3.11.0 # via + # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # pylint # tox # virtualenv @@ -165,14 +137,12 @@ pluggy==1.3.0 # tox pycodestyle==2.11.1 # via -r requirements/test.in -pydantic==2.4.2 +pydantic==2.5.0 # via inflect -pydantic-core==2.10.1 +pydantic-core==2.14.1 # via pydantic pygments==2.16.1 - # via - # diff-cover - # rich + # via diff-cover pylint==3.0.2 # via # -r requirements/test.in @@ -188,8 +158,6 @@ pylint-plugin-utils==0.8.2 # via # pylint-celery # pylint-django -pypng==0.20220715.0 - # via xblock-sdk pyproject-api==1.6.1 # via tox pytest==7.4.3 @@ -204,39 +172,23 @@ pytest-django==4.7.0 python-dateutil==2.8.2 # via # -r requirements/django.txt - # arrow # botocore - # xblock python-slugify==8.0.1 - # via - # code-annotations - # cookiecutter + # via code-annotations pytz==2023.3.post1 # via # -r requirements/django.txt # django - # xblock pyyaml==6.0.1 # via # -r requirements/django.txt # code-annotations - # cookiecutter - # xblock -requests==2.31.0 - # via - # cookiecutter - # xblock-sdk -rich==13.6.0 - # via cookiecutter s3transfer==0.7.0 # via # -r requirements/django.txt # boto3 simplejson==3.19.2 - # via - # -r requirements/django.txt - # xblock - # xblock-sdk + # via -r requirements/django.txt six==1.16.0 # via # -r requirements/django.txt @@ -265,8 +217,6 @@ tomlkit==0.12.2 # via pylint tox==4.11.3 # via -r requirements/test.in -types-python-dateutil==2.8.19.14 - # via arrow typing-extensions==4.8.0 # via # annotated-types @@ -275,28 +225,16 @@ typing-extensions==4.8.0 # pydantic # pydantic-core # pylint - # rich urllib3==1.26.18 # via # -r requirements/django.txt # botocore - # requests virtualenv==20.24.6 # via tox web-fragments==2.1.0 - # via - # -r requirements/django.txt - # xblock - # xblock-sdk + # via -r requirements/django.txt webob==1.8.7 - # via - # -r requirements/django.txt - # xblock - # xblock-sdk -xblock==1.8.1 - # via xblock-sdk -xblock-sdk==0.7.0 - # via -r requirements/test.in + # via -r requirements/django.txt # The following packages are considered to be unsafe in a requirements file: # setuptools