From 754aa516779d6b756789ce2b9e270ca3e4e9f1e3 Mon Sep 17 00:00:00 2001 From: salman2013 Date: Mon, 4 Mar 2024 15:57:14 +0500 Subject: [PATCH 1/3] chore: update for python 3.12 --- .github/workflows/ci.yml | 4 ++-- requirements/constraints.txt | 3 ++- setup.py | 2 ++ tox.ini | 5 ++--- xblock/__init__.py | 2 +- xblock/test/test_core.py | 2 +- xblock/test/test_user_service.py | 4 ++-- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0efc7b6b8..5312e89d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,8 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ['3.8'] - toxenv: [quality, django32, django42] + python-version: ['3.8', '3.12'] + toxenv: [quality, django42] steps: - uses: actions/checkout@v3 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 3bb18ffde..6771954d3 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -13,4 +13,5 @@ # diff-cover latest requires (pluggy>=0.13.1,<0.14.0) which conflicts with pytest which requires(pluggy>=0.12,<2.0.0) # Using the same version of diff-cover which is being used currently in edx-platform to avoid this conflict. -diff-cover==4.0.0 +# diff-cover==4.0.0 +lxml<5.0.0 diff --git a/setup.py b/setup.py index ec7ca0f77..f226a2f10 100755 --- a/setup.py +++ b/setup.py @@ -70,10 +70,12 @@ def get_version(*file_paths): 'Framework :: Django', 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.0', + 'Framework :: Django :: 4.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Natural Language :: English', "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.12", ] ) diff --git a/tox.ini b/tox.ini index 16ea4b3d3..8b6671340 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38-django{32,42}, quality, docs +envlist = py{38,312}-django{42}, quality, docs [pytest] DJANGO_SETTINGS_MODULE = xblock.test.settings @@ -9,7 +9,6 @@ norecursedirs = .* docs requirements [testenv] deps = - django32: Django>=3.2,<4.0 django42: Django>=4.2,<4.3 -r requirements/test.txt changedir = {envsitepackagesdir} @@ -33,7 +32,7 @@ commands = [testenv:quality] deps = - django32: Django>=3.2,<4.0 + django42: Django>=4.2,<4.3 -r requirements/test.txt changedir = {toxinidir} commands = diff --git a/xblock/__init__.py b/xblock/__init__.py index d10628e18..a20713f4d 100644 --- a/xblock/__init__.py +++ b/xblock/__init__.py @@ -27,4 +27,4 @@ def __init__(self, *args, **kwargs): # without causing a circular import xblock.fields.XBlockMixin = XBlockMixin -__version__ = '1.10.0' +__version__ = '1.11.0' diff --git a/xblock/test/test_core.py b/xblock/test/test_core.py index 7f7cd4700..ea35a6d9f 100644 --- a/xblock/test/test_core.py +++ b/xblock/test/test_core.py @@ -835,7 +835,7 @@ class HasParent(XBlock): block.parent = "some_parent_id" parent = block.get_parent() assert parent is not None - assert runtime.get_block.called_with("some_parent_id") + assert runtime.get_block.called # Get the parent again. It will be the same parent, and we didn't call the # runtime. diff --git a/xblock/test/test_user_service.py b/xblock/test/test_user_service.py index 7c1104d6e..5c2b1c30e 100644 --- a/xblock/test/test_user_service.py +++ b/xblock/test/test_user_service.py @@ -29,10 +29,10 @@ def test_dummy_user_service_current_user(): assert current_user == user assert current_user.full_name == "tester" # assert that emails is an Iterable but not a string - assert isinstance(current_user.emails, collections.Iterable) + assert isinstance(current_user.emails, collections.abc.Iterable) assert not isinstance(current_user.emails, (str, bytes)) # assert that opt_attrs is a Mapping - assert isinstance(current_user.opt_attrs, collections.Mapping) + assert isinstance(current_user.opt_attrs, collections.abc.Mapping) def test_dummy_user_service_exception(): From 69eb5e7eec3afc83418b0ce440e68371fec18edf Mon Sep 17 00:00:00 2001 From: salman2013 Date: Mon, 4 Mar 2024 16:10:20 +0500 Subject: [PATCH 2/3] chore: fix tests --- setup.py | 1 - xblock/__init__.py | 4 ---- 2 files changed, 5 deletions(-) diff --git a/setup.py b/setup.py index d115193fc..4707b21ff 100755 --- a/setup.py +++ b/setup.py @@ -68,7 +68,6 @@ def get_version(*file_paths): classifiers=[ 'Development Status :: 5 - Production/Stable', 'Framework :: Django', - 'Framework :: Django :: 4.0', 'Framework :: Django :: 4.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', diff --git a/xblock/__init__.py b/xblock/__init__.py index 431307d7e..82fc398f6 100644 --- a/xblock/__init__.py +++ b/xblock/__init__.py @@ -27,8 +27,4 @@ def __init__(self, *args, **kwargs): # without causing a circular import xblock.fields.XBlockMixin = XBlockMixin -<<<<<<< HEAD -__version__ = '1.11.0' -======= __version__ = '2.0.0' ->>>>>>> upstream/master From 2a29c58eb726e38836181e39c0ef1f9fccbfd742 Mon Sep 17 00:00:00 2001 From: salman2013 Date: Mon, 4 Mar 2024 16:15:46 +0500 Subject: [PATCH 3/3] chore: fix test --- requirements/constraints.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 6771954d3..4cba57814 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -13,5 +13,5 @@ # diff-cover latest requires (pluggy>=0.13.1,<0.14.0) which conflicts with pytest which requires(pluggy>=0.12,<2.0.0) # Using the same version of diff-cover which is being used currently in edx-platform to avoid this conflict. -# diff-cover==4.0.0 +diff-cover==4.0.0 lxml<5.0.0