Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,19 @@ concurrency:
jobs:
tests:
runs-on: ${{ matrix.os }}
services:
# Using SQLite3 for integration tests throws `django.db.utils.OperationalError: database table is locked: workbench_xblockstate`.
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: rootpw
ports:
- 3307:3306
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: [3.8]
toxenv: [py38-django32, py38-django42, integration32, integration42, quality]
os: [ubuntu-latest]
python-version: [3.11, 3.12]
toxenv: [django42, django52, quality]

steps:
- name: checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -54,8 +46,8 @@ jobs:
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38-django32'
uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11' && matrix.toxenv == 'django42'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ on:

jobs:
push:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.11

- name: Install Dependencies
run: pip install -r requirements/pip.txt
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
*~
*.pyc
/.coverage*
.coverage
.coverage.*
coverage.xml
/xblock_problem_builder.egg-info
/workbench*
/dist
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test.unit: ## run all unit tests
tox -- $(TEST)

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

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

Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage:
status:
project:
default:
target: auto
threshold: 0.1%
2 changes: 1 addition & 1 deletion problem_builder/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.1.4"
__version__ = "5.2.0"
2 changes: 1 addition & 1 deletion problem_builder/choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def get_template(cls, template_id):
return {'metadata': {}, 'data': {}}

@classmethod
def parse_xml(cls, node, runtime, keys, id_generator):
def parse_xml(cls, node, runtime, keys):
"""
Construct this XBlock from the given XML node.
"""
Expand Down
2 changes: 1 addition & 1 deletion problem_builder/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_template(cls, template_id):
}}

@classmethod
def parse_xml(cls, node, runtime, keys, id_generator):
def parse_xml(cls, node, runtime, keys):
"""
Construct this XBlock from the given XML node.
"""
Expand Down
2 changes: 1 addition & 1 deletion problem_builder/tip.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def add_error(msg):
add_error(self._("A choice selected for this tip does not exist."))

@classmethod
def parse_xml(cls, node, runtime, keys, id_generator):
def parse_xml(cls, node, runtime, keys):
"""
Construct this XBlock from the given XML node.
"""
Expand Down
2 changes: 1 addition & 1 deletion problem_builder/v1/studio_xml_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
usage_id = self.id_generator.create_usage(def_id)
keys = ScopeIds(None, block_type, def_id, usage_id)
block_class = self.mixologist.mix(self.load_block_type(block_type))
block = block_class.parse_xml(node, self, keys, self.id_generator)
block = block_class.parse_xml(node, self, keys)

Check warning on line 56 in problem_builder/v1/studio_xml_utils.py

View check run for this annotation

Codecov / codecov/patch

problem_builder/v1/studio_xml_utils.py#L56

Added line #L56 was not covered by tests
block.save()
return block

Expand Down
2 changes: 1 addition & 1 deletion problem_builder/v1/tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def create_block_from_node(self, node):
usage_id = self.runtime.id_generator.create_usage(def_id)
keys = ScopeIds(None, block_type, def_id, usage_id)
block_class = self.runtime.mixologist.mix(self.runtime.load_block_type(block_type))
block = block_class.parse_xml(node, self.runtime, keys, self.runtime.id_generator)
block = block_class.parse_xml(node, self.runtime, keys)
block.save()
return block

Expand Down
2 changes: 1 addition & 1 deletion problem_builder/v1/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
pass # Perhaps HtmlModule has been converted to an XBlock?
else:
@classmethod
def parse_xml_for_HtmlDescriptor(cls, node, runtime, keys, id_generator):
def parse_xml_for_HtmlDescriptor(cls, node, runtime, keys):

Check warning on line 73 in problem_builder/v1/upgrade.py

View check run for this annotation

Codecov / codecov/patch

problem_builder/v1/upgrade.py#L73

Added line #L73 was not covered by tests
block = runtime.construct_xblock_from_class(cls, keys)
block.data = node.text if node.text else ""
for child in list(node):
Expand Down
1 change: 1 addition & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ disable=blacklisted-name,
comprehension-escape,
import-outside-toplevel,
use-dict-literal,
too-many-positional-arguments,

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
62 changes: 31 additions & 31 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
appdirs==1.4.4
# via fs
asgiref==3.7.2
asgiref==3.8.1
# via django
boto3==1.34.49
boto3==1.38.37
# via fs-s3fs
botocore==1.34.49
botocore==1.38.37
# via
# boto3
# s3transfer
django==3.2.24
django==4.2.23
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
# openedx-django-pyfs
edx-opaque-keys==2.5.1
dnspython==2.7.0
# via pymongo
edx-opaque-keys==3.0.0
# via -r requirements/base.in
fs==2.4.16
# via
Expand All @@ -34,60 +36,58 @@ jmespath==1.0.1
# botocore
lazy==1.6
# via xblock
lxml==5.1.0
lxml==5.4.0
# via xblock
mako==1.3.2
mako==1.3.10
# via
# xblock
# xblock-utils
markupsafe==2.1.5
markupsafe==3.0.2
# via
# mako
# xblock
openedx-django-pyfs==3.5.0
openedx-django-pyfs==3.8.0
# via xblock
pbr==6.0.0
pbr==6.1.1
# via stevedore
pymongo==3.13.0
pymongo==4.13.2
# via edx-opaque-keys
python-dateutil==2.8.2
python-dateutil==2.9.0.post0
# via
# botocore
# xblock
pytz==2024.1
# via
# django
# xblock
pyyaml==6.0.1
pytz==2025.2
# via xblock
pyyaml==6.0.2
# via xblock
s3transfer==0.10.0
s3transfer==0.13.0
# via boto3
simplejson==3.19.2
simplejson==3.20.1
# via
# xblock
# xblock-utils
six==1.16.0
six==1.17.0
# via
# fs
# fs-s3fs
# python-dateutil
sqlparse==0.4.4
sqlparse==0.5.3
# via django
stevedore==5.2.0
stevedore==5.4.1
# via edx-opaque-keys
typing-extensions==4.10.0
typing-extensions==4.14.0
# via edx-opaque-keys
urllib3==2.2.3
# via
# asgiref
# edx-opaque-keys
urllib3==1.26.18
# via botocore
web-fragments==2.1.0
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# botocore
web-fragments==3.1.0
# via
# xblock
# xblock-utils
webob==1.8.7
webob==1.8.9
# via xblock
xblock[django]==1.10.0
xblock[django]==5.2.0
# via xblock-utils
xblock-utils==4.0.0
# via -r requirements/base.in
Expand Down
20 changes: 8 additions & 12 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# make upgrade
#
distlib==0.3.8
distlib==0.3.9
# via virtualenv
filelock==3.13.1
filelock==3.18.0
# via
# tox
# virtualenv
packaging==23.2
packaging==25.0
# via
# pyproject-api
# tox
platformdirs==4.2.0
platformdirs==4.3.8
# via
# tox
# virtualenv
pluggy==1.4.0
pluggy==1.6.0
# via tox
py==1.11.0
# via tox
six==1.16.0
six==1.17.0
# via tox
tomli==2.0.1
# via
# pyproject-api
# tox
tox==3.28.0
# via
# -r requirements/ci.in
# tox-battery
tox-battery==0.6.2
# via -r requirements/ci.in
virtualenv==20.25.1
virtualenv==20.31.2
# via tox
Loading