Skip to content

Commit f833c37

Browse files
Muhammad Faraz  MaqsoodMuhammad Faraz  Maqsood
authored andcommitted
fix: parse_xml error during import
41e1795 In this commit: - fix parse_xml error that occurs during importing a course that contains problem-builder component or during copying pasting the problem-builder component by removing unused & unsupported positional argument i.e. "id_generator". - upgrade requirements especially "xblock[django]" to version "2.0.0" where this extra argument "id_generator" was removed. - With this requirement upgrade, also dropped support for django 3.2. due to conflicts in dependencies in CI. - ERROR: Cannot install Django<5.0 and >=4.2 and django==3.2.25 because these package versions have conflicting dependencies. - update ubuntu version ro ubuntu-latest. - update codecov actions to v5 in CI. Note: This Change will be incompatible with Palm release of openedx.
1 parent 5602b7b commit f833c37

21 files changed

Lines changed: 359 additions & 307 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
os: [ubuntu-20.04]
29+
os: [ubuntu-latest]
3030
python-version: [3.8]
31-
toxenv: [py38-django32, py38-django42, integration32, integration42, quality]
31+
toxenv: [py38-django42, integration42, quality]
3232

3333
steps:
3434
- name: checkout repo
@@ -54,9 +54,8 @@ jobs:
5454
run: tox
5555

5656
- name: Run coverage
57-
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38-django32'
58-
uses: codecov/codecov-action@v3
57+
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38-django42'
58+
uses: codecov/codecov-action@v5
5959
with:
60-
token: ${{ secrets.CODECOV_TOKEN }}
6160
flags: unittests
6261
fail_ci_if_error: true

.github/workflows/pypi-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
push:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-latest
1010

1111
steps:
1212
- name: Checkout

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test.unit: ## run all unit tests
5959
tox -- $(TEST)
6060

6161
test.integration: ## run all integration tests
62-
tox -e integration -- $(TEST)
62+
tox -e integration42 -- $(TEST)
6363

6464
test: test.unit test.integration test.quality ## Run all tests
6565

problem_builder/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "5.1.4"
1+
__version__ = "5.1.5"

problem_builder/choice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def get_template(cls, template_id):
133133
return {'metadata': {}, 'data': {}}
134134

135135
@classmethod
136-
def parse_xml(cls, node, runtime, keys, id_generator):
136+
def parse_xml(cls, node, runtime, keys):
137137
"""
138138
Construct this XBlock from the given XML node.
139139
"""

problem_builder/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def get_template(cls, template_id):
150150
}}
151151

152152
@classmethod
153-
def parse_xml(cls, node, runtime, keys, id_generator):
153+
def parse_xml(cls, node, runtime, keys):
154154
"""
155155
Construct this XBlock from the given XML node.
156156
"""

problem_builder/tip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def add_error(msg):
131131
add_error(self._("A choice selected for this tip does not exist."))
132132

133133
@classmethod
134-
def parse_xml(cls, node, runtime, keys, id_generator):
134+
def parse_xml(cls, node, runtime, keys):
135135
"""
136136
Construct this XBlock from the given XML node.
137137
"""

problem_builder/v1/studio_xml_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def create_block_from_node(self, node):
5353
usage_id = self.id_generator.create_usage(def_id)
5454
keys = ScopeIds(None, block_type, def_id, usage_id)
5555
block_class = self.mixologist.mix(self.load_block_type(block_type))
56-
block = block_class.parse_xml(node, self, keys, self.id_generator)
56+
block = block_class.parse_xml(node, self, keys)
5757
block.save()
5858
return block
5959

problem_builder/v1/tests/test_upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def create_block_from_node(self, node):
8888
usage_id = self.runtime.id_generator.create_usage(def_id)
8989
keys = ScopeIds(None, block_type, def_id, usage_id)
9090
block_class = self.runtime.mixologist.mix(self.runtime.load_block_type(block_type))
91-
block = block_class.parse_xml(node, self.runtime, keys, self.runtime.id_generator)
91+
block = block_class.parse_xml(node, self.runtime, keys)
9292
block.save()
9393
return block
9494

problem_builder/v1/upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def upgrade_block(store, block, from_version="v1"):
7070
pass # Perhaps HtmlModule has been converted to an XBlock?
7171
else:
7272
@classmethod
73-
def parse_xml_for_HtmlDescriptor(cls, node, runtime, keys, id_generator):
73+
def parse_xml_for_HtmlDescriptor(cls, node, runtime, keys):
7474
block = runtime.construct_xblock_from_class(cls, keys)
7575
block.data = node.text if node.text else ""
7676
for child in list(node):

0 commit comments

Comments
 (0)