diff --git a/.github/workflows/ci-mac-os.yml b/.github/workflows/ci-mac-os.yml index 8816152..ffb29f7 100644 --- a/.github/workflows/ci-mac-os.yml +++ b/.github/workflows/ci-mac-os.yml @@ -23,7 +23,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: [3.8, '3.10', '3.11'] + python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13'] env: # set env variable for Wand MAGICK_HOME: '/opt/homebrew' diff --git a/.github/workflows/ci-ubuntu.yml b/.github/workflows/ci-ubuntu.yml index a58b5bf..caf69a3 100644 --- a/.github/workflows/ci-ubuntu.yml +++ b/.github/workflows/ci-ubuntu.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, '3.10', '3.11'] + python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13'] # unsupported version on ubuntu-latest 3.5, 3.6 # see https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md # Steps represent a sequence of tasks that will be executed as part of the job diff --git a/amc2moodle/amc2moodle/amc2moodle_class.py b/amc2moodle/amc2moodle/amc2moodle_class.py index 67b6ef7..9f088ab 100644 --- a/amc2moodle/amc2moodle/amc2moodle_class.py +++ b/amc2moodle/amc2moodle/amc2moodle_class.py @@ -27,7 +27,7 @@ import shutil from importlib import util # python 3.x import tempfile -from distutils.dir_util import copy_tree +from shutil import copytree import logging from concurrent.futures import ThreadPoolExecutor @@ -341,7 +341,7 @@ def runBuilding(self): dir=getPathFile(self.output)) # Logger.info(' > Save all temp files in: %s' % tempdirSave) - copy_tree(self.tempdir.name, tempdirSave) + copytree(self.tempdir.name, tempdirSave, dirs_exist_ok=True) # clean XML file (experimental) if self.cleanXML: diff --git a/amc2moodle/amc2moodle/convert.py b/amc2moodle/amc2moodle/convert.py index 8f932a7..6b89acd 100755 --- a/amc2moodle/amc2moodle/convert.py +++ b/amc2moodle/amc2moodle/convert.py @@ -899,7 +899,7 @@ def _element_pre_process(self, tree): with CDATA. """ # These elements should be nodes at roots level. - all_para = tree.findall('/para') + all_para = tree.findall('./para') if len(all_para) > 0: Logger.warning(" > {} '\\element' blocks contain text outside ".format(len(all_para)) + "'Question environnement'. " diff --git a/amc2moodle/amc2moodle/test.py b/amc2moodle/amc2moodle/test.py index 39e5974..aba293e 100755 --- a/amc2moodle/amc2moodle/test.py +++ b/amc2moodle/amc2moodle/test.py @@ -166,7 +166,7 @@ def question_fields(self, qname, target_ans_sum, frac = float(a.attrib['fraction']) frac_list.append(frac) s += frac - print('In {}, fraction are {}\n'.format(qname, frac_list)) + Logger.debug('In {}, fraction are {}\n'.format(qname, frac_list)) if abs(s - target_ans_sum) > TOL: ok += 1 else: @@ -360,7 +360,7 @@ def test_numerical(self): # check it equiv = check_hash(fileOut, fileRef) if equiv: - print(' > Converted XML is identical to the ref.') + Logger.info(' > Converted XML is identical to the ref.') # self.assertTrue(equiv, 'The converted file is different from the ref.') def test_tikz(self): @@ -381,7 +381,7 @@ def test_tikz(self): # check it equiv = check_hash(fileOut, fileRef) if equiv: - print(' > Converted XML is identical to the ref.') + Logger.info(' > Converted XML is identical to the ref.') # self.assertTrue(equiv, 'The converted file is different from the ref.') def test_cleaning(self):