diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b14f6cd5..63fcff23a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,9 @@ name: ci on: pull_request: - branches: [ master ] + branches: + - master + - develop push: branches: - master @@ -17,11 +19,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Display Python version diff --git a/tests/unitutil/cxml.py b/tests/unitutil/cxml.py index 79e217c20..45ff8dcec 100644 --- a/tests/unitutil/cxml.py +++ b/tests/unitutil/cxml.py @@ -10,6 +10,7 @@ from pyparsing import ( Combine, + DelimitedList, Forward, Group, Literal, @@ -18,10 +19,9 @@ Word, alphanums, alphas, - dblQuotedString, - delimitedList, - removeQuotes, - stringEnd, + dbl_quoted_string, + remove_quotes, + string_end, ) from pptx.oxml import parse_xml @@ -43,8 +43,8 @@ def element(cxel_str: str) -> BaseOxmlElement: def xml(cxel_str: str) -> str: """Return the XML generated from `cxel_str`.""" - root_node.parseWithTabs() - root_token = root_node.parseString(cxel_str) + root_node.parse_with_tabs() + root_token = root_node.parse_string(cxel_str) xml = root_token.element.xml return xml @@ -254,28 +254,30 @@ def grammar(): attr_name = Word(alphas + ":") attr_val = Word(alphanums + " %-./:_") attr_def = Group(attr_name + equal + attr_val) - attr_list = open_brace + delimitedList(attr_def) + close_brace + attr_list = open_brace + DelimitedList(attr_def) + close_brace - text = dblQuotedString.setParseAction(removeQuotes) + text = dbl_quoted_string.set_parse_action(remove_quotes) # w:jc{val=right} ---------------------------- element = ( tagname("tagname") + Group(Optional(attr_list))("attr_list") + Optional(text, default="")("text") - ).setParseAction(Element.from_token) + ).set_parse_action(Element.from_token) child_node_list = Forward() node = Group( element("element") + Group(Optional(slash + child_node_list))("child_node_list") - ).setParseAction(connect_node_children) + ).set_parse_action(connect_node_children) - child_node_list << (open_paren + delimitedList(node) + close_paren | node) + child_node_list << (open_paren + DelimitedList(node) + close_paren | node) root_node = ( - element("element") + Group(Optional(slash + child_node_list))("child_node_list") + stringEnd - ).setParseAction(connect_root_node_children) + element("element") + + Group(Optional(slash + child_node_list))("child_node_list") + + string_end + ).set_parse_action(connect_root_node_children) return root_node