Skip to content

Commit

Permalink
Add support for Open edX Redwood release
Browse files Browse the repository at this point in the history
* Update the import statement for xblock-utils

  The `xblock-utils` library has been deprecated as a separate package;
  the `utils` library has been moved into the `XBlock` and should now
  be imported from `xblock.utils` instead.
  (openedx/XBlock#675)

* Upgrade to XBlock 2
  Remove the use of deprecated `xblock.fragment` and direct
  id_generator parameters. 9openedx/XBlock#680)

* Add Python 3.11 to test matrix

Fixes: #38
  • Loading branch information
Maari Tamm committed Aug 2, 2024
1 parent 6933eea commit c0f01ff
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
python-version:
- '3.8'
- '3.10'
- '3.11'
pip-version:
- 22.0.4
- 23.2.1
Expand Down
12 changes: 6 additions & 6 deletions markdown_xblock/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from django.conf import settings as django_settings
from xblock.core import XBlock
from xblock.fields import List, Scope, String
from xblock.fragment import Fragment
from xblockutils.resources import ResourceLoader
from xblockutils.settings import XBlockWithSettingsMixin
from xblockutils.studio_editable import StudioEditableXBlockMixin, loader
from web_fragments.fragment import Fragment
from xblock.utils.resources import ResourceLoader
from xblock.utils.settings import XBlockWithSettingsMixin
from xblock.utils.studio_editable import StudioEditableXBlockMixin, loader

from .utils import _

Expand Down Expand Up @@ -276,15 +276,15 @@ def get_editable_fields(self):
return fields

@classmethod
def parse_xml(cls, node, runtime, keys, id_generator):
def parse_xml(cls, node, runtime, keys):
"""
Use `node` to construct a new block.
"""
block = runtime.construct_xblock_from_class(cls, keys)

# Read markdown content from file and add to editor.
url_name = node.get('url_name', node.get('slug'))
location = id_generator.create_definition(node.tag, url_name)
location = runtime.id_generator.create_definition(node.tag, url_name)

filename = node.get('filename')
pointer_path = "{category}/{url_path}".format(
Expand Down
3 changes: 1 addition & 2 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Requirements for app run

xblock-utils<=4.0.0
xblock-sdk<0.9.0
xblock-sdk
django-statici18n<2.5
edx-i18n-tools<1.4
Mako==1.2.4
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ mock==3.0.5

# Github requirements
django-pyfs<3.2
xblock-sdk<0.9.0
xblock-sdk
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def package_data(pkg, roots):
'markdown_xblock',
],
install_requires=[
'XBlock<=1.9',
'XBlock>=2.0',
'markdown2>=2.3.9',
'Pygments>=2.0.1'
],
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[tox]
envlist = py{38,310,312},flake8,report
envlist = py{38,310,311,312},flake8,report

[gh-actions]
python =
3.8: py38,flake8
3.10: py310,flake8
3.11: py311,flake8
3.12: py312,flake8

[flake8]
Expand Down

0 comments on commit c0f01ff

Please sign in to comment.