From 69544555caced9d01b98abcedf6ce22fa539490e Mon Sep 17 00:00:00 2001 From: Joshua Klein Date: Tue, 7 Nov 2023 20:18:26 -0500 Subject: [PATCH] Remove pkg_resources global import, test on Py311 and 312 --- .github/workflows/pythonpackage.yaml | 2 +- psims/validation/semantic/data/__init__.py | 0 psims/validation/validator.py | 8 ++++---- psims/validation/xsd/__init__.py | 0 4 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 psims/validation/semantic/data/__init__.py create mode 100644 psims/validation/xsd/__init__.py diff --git a/.github/workflows/pythonpackage.yaml b/.github/workflows/pythonpackage.yaml index f94df1a..f7dffd3 100644 --- a/.github/workflows/pythonpackage.yaml +++ b/.github/workflows/pythonpackage.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/psims/validation/semantic/data/__init__.py b/psims/validation/semantic/data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/psims/validation/validator.py b/psims/validation/validator.py index c4b45f9..fc5df31 100644 --- a/psims/validation/validator.py +++ b/psims/validation/validator.py @@ -1,12 +1,12 @@ -import pkg_resources - -from lxml import etree +from importlib import resources from six import raise_from +from lxml import etree + def get_xsd(name): - return pkg_resources.resource_stream(__name__, "xsd/%s" % name) + return resources.open_binary(f"psims.validation.xsd", name) schemas = { diff --git a/psims/validation/xsd/__init__.py b/psims/validation/xsd/__init__.py new file mode 100644 index 0000000..e69de29