From f6b59985aff8acd4b181aa31231a4a5d7424d21d Mon Sep 17 00:00:00 2001 From: Mike Walters Date: Tue, 3 Dec 2024 13:27:19 +0000 Subject: [PATCH] Update Python versions: drop 3.8, add 3.13 to CI --- .github/workflows/host.yml | 2 +- apollo_fpga/__init__.py | 7 ++----- pyproject.toml | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/host.yml b/.github/workflows/host.yml index 61bc62a..b2be6e3 100644 --- a/.github/workflows/host.yml +++ b/.github/workflows/host.yml @@ -16,11 +16,11 @@ jobs: max-parallel: 5 matrix: python-version: - - '3.8' - '3.9' - '3.10' - '3.11' - '3.12' + - '3.13' name: test (${{ matrix.python-version }}) steps: diff --git a/apollo_fpga/__init__.py b/apollo_fpga/__init__.py index 873b0a1..62dec73 100644 --- a/apollo_fpga/__init__.py +++ b/apollo_fpga/__init__.py @@ -20,6 +20,7 @@ from .onboard_jtag import * import importlib.metadata +import importlib.resources __version__ = importlib.metadata.version(__package__) @@ -168,11 +169,7 @@ def _init_backend(cls): # In Windows, we need to specify the libusb library location to create a backend. if platform.system() == "Windows": # Determine the path to libusb-1.0.dll. - try: - from importlib_resources import files # <= 3.8 - except: - from importlib.resources import files # >= 3.9 - libusb_dll = os.path.join(files("usb1"), "libusb-1.0.dll") + libusb_dll = os.path.join(importlib.resources.files("usb1"), "libusb-1.0.dll") # Create a backend by explicitly passing the path to libusb_dll. cls.backend = usb.backend.libusb1.get_backend(find_library=lambda x: libusb_dll) diff --git a/pyproject.toml b/pyproject.toml index 3c86276..408d2c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ authors = [ license = { text = "BSD" } description = "Python library and host tools for Apollo FPGA debug controllers." readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ 'Programming Language :: Python', 'Development Status :: 5 - Production/Stable', @@ -24,7 +24,6 @@ classifiers = [ 'Topic :: Scientific/Engineering', ] dependencies = [ - "importlib_resources; python_version<'3.9'", "pyusb>1.1.1", "pyvcd>=0.2.4", "prompt-toolkit>3.0.16",