From c51f34b244b6d8af2d0dd486cbf3630d049bbc1f Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Mon, 4 Mar 2024 08:44:12 -0600 Subject: [PATCH 1/5] Add JDK 21 to build matrix --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 285259187..c4d54329d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -11,7 +11,7 @@ jobs: build: strategy: matrix: - java: [8, 11, 17] + java: [8, 11, 17, 21] os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.8', '3.9', '3.10', '3.11'] exclude: From 39436c4c78c134d44fd799dbb7ac0bd7a7ba4eaa Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Mon, 4 Mar 2024 08:44:25 -0600 Subject: [PATCH 2/5] Update to latest actions version --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c4d54329d..ebfaa969b 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -37,7 +37,7 @@ jobs: python -m pip install --upgrade pip pip install -r requirements.txt - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: 'zulu' From 69afe37c20a359a604a21eaceb69be3a5eb51e54 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Tue, 5 Mar 2024 11:06:06 -0600 Subject: [PATCH 3/5] Reduce build matrix and include Python 3.12 --- .github/workflows/maven.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ebfaa969b..0e9bce518 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -13,16 +13,15 @@ jobs: matrix: java: [8, 11, 17, 21] os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] - exclude: + include: + - java: 8 + python-version: '3.8' - java: 11 - python-version: '3.9' - - java: 11 - python-version: '3.10' - - java: 17 - python-version: '3.9' + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - java: 17 - python-version: '3.10' + python-version: '3.8' + - java: 21 + python-version: '3.8' runs-on: ${{ matrix.os }} env: maven_commands: install From 1b411a085409c8fb7f4dfcf02b134742d68d2061 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Tue, 5 Mar 2024 11:18:44 -0600 Subject: [PATCH 4/5] Fix matrix definition to use longer exclude list ...instead of trying to be clever with a concise include list. --- .github/workflows/maven.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0e9bce518..1c9daf653 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -13,15 +13,32 @@ jobs: matrix: java: [8, 11, 17, 21] os: [ubuntu-latest, windows-latest, macos-latest] - include: + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + exclude: - java: 8 - python-version: '3.8' - - java: 11 - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: '3.9' + - java: 8 + python-version: '3.10' + - java: 8 + python-version: '3.11' + - java: 8 + python-version: '3.12' + - java: 17 + python-version: '3.9' + - java: 17 + python-version: '3.10' - java: 17 - python-version: '3.8' + python-version: '3.11' + - java: 17 + python-version: '3.12' + - java: 21 + python-version: '3.9' + - java: 21 + python-version: '3.10' + - java: 21 + python-version: '3.11' - java: 21 - python-version: '3.8' + python-version: '3.12' runs-on: ${{ matrix.os }} env: maven_commands: install From 7f99b6a6e47ee1ca5d107c97e3dd6cb5311a0148 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Wed, 6 Mar 2024 16:43:16 -0600 Subject: [PATCH 5/5] Try to replace imp with importlib for Python 3.12 compatibility Largely based on https://discuss.python.org/t/how-do-i-migrate-from-imp/27885 and other discussions linked from https://github.com/python/cpython/issues/104212. --- xsd-fu/python/generateDS/generateDS.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xsd-fu/python/generateDS/generateDS.py b/xsd-fu/python/generateDS/generateDS.py index 12aacd4bb..32ac643a7 100755 --- a/xsd-fu/python/generateDS/generateDS.py +++ b/xsd-fu/python/generateDS/generateDS.py @@ -94,7 +94,7 @@ import time import getopt import urllib.request, urllib.error, urllib.parse -import imp +import importlib from xml.sax import handler, make_parser import xml.sax.xmlreader import logging @@ -4221,8 +4221,9 @@ def parseAndGenerate(outfileName, subclassFilename, prefix, path_list = UserMethodsPath.split('.') mod_name = path_list[-1] mod_path = os.sep.join(path_list[:-1]) - module_spec = imp.find_module(mod_name, [mod_path, ]) - UserMethodsModule = imp.load_module(mod_name, *module_spec) + module_spec = importlib.util.find_spec(mod_name, [mod_path, ]) + UserMethodsModule = importlib.util.module_from_spec(module_spec) + module_spec.loader.exec_module(UserMethodsMdule) ## parser = saxexts.make_parser("xml.sax.drivers2.drv_pyexpat") parser = make_parser() dh = XschemaHandler()