Skip to content

Commit a4cfa28

Browse files
authored
Merge pull request #458 from Faraz32123/fix/parse_xml_error_during_import
fix: parse_xml error during import
2 parents 5602b7b + edde9a6 commit a4cfa28

File tree

23 files changed

+361
-404
lines changed

23 files changed

+361
-404
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,19 @@ concurrency:
1515
jobs:
1616
tests:
1717
runs-on: ${{ matrix.os }}
18-
services:
19-
# Using SQLite3 for integration tests throws `django.db.utils.OperationalError: database table is locked: workbench_xblockstate`.
20-
mysql:
21-
image: mysql:8
22-
env:
23-
MYSQL_ROOT_PASSWORD: rootpw
24-
ports:
25-
- 3307:3306
2618
strategy:
2719
fail-fast: false
2820
matrix:
29-
os: [ubuntu-20.04]
30-
python-version: [3.8]
31-
toxenv: [py38-django32, py38-django42, integration32, integration42, quality]
21+
os: [ubuntu-latest]
22+
python-version: [3.11, 3.12]
23+
toxenv: [django42, django52, quality]
3224

3325
steps:
3426
- name: checkout repo
35-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
3628

3729
- name: setup python
38-
uses: actions/setup-python@v4
30+
uses: actions/setup-python@v5
3931
with:
4032
python-version: ${{ matrix.python-version }}
4133

@@ -54,8 +46,8 @@ jobs:
5446
run: tox
5547

5648
- name: Run coverage
57-
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38-django32'
58-
uses: codecov/codecov-action@v3
49+
if: matrix.python-version == '3.11' && matrix.toxenv == 'django42'
50+
uses: codecov/codecov-action@v5
5951
with:
6052
token: ${{ secrets.CODECOV_TOKEN }}
6153
flags: unittests

.github/workflows/pypi-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ on:
66

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

1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414

1515
- name: setup python
16-
uses: actions/setup-python@v4
16+
uses: actions/setup-python@v5
1717
with:
18-
python-version: 3.8
18+
python-version: 3.11
1919

2020
- name: Install Dependencies
2121
run: pip install -r requirements/pip.txt

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
*~
22
*.pyc
3-
/.coverage*
3+
.coverage
4+
.coverage.*
5+
coverage.xml
46
/xblock_problem_builder.egg-info
57
/workbench*
68
/dist

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

codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto
6+
threshold: 0.1%

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.2.0"

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

0 commit comments

Comments
 (0)