From c8a5cec536218f8058a040a4328c268cbb76e9cc Mon Sep 17 00:00:00 2001 From: Nicholas Felt Date: Wed, 25 Oct 2023 09:06:22 -0700 Subject: [PATCH] ci: Update workflow name and add Python 3.12 classifier (#70) * ci: Update workflow name. * build: manually add python 3.12 classifier * fix: Move attribute instantiation before any function calls in the DeviceManager init. --- .github/workflows/package-release.yml | 2 +- pyproject.toml | 3 ++- src/tm_devices/device_manager.py | 13 +++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index bc3e67f4..eae622d8 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -1,5 +1,5 @@ --- -name: Publish package +name: Publish to GitHub & PyPI on: workflow_dispatch: inputs: diff --git a/pyproject.toml b/pyproject.toml index cf43322a..daddd1d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,8 @@ classifiers = [ "Operating System :: OS Independent", "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", "Topic :: Scientific/Engineering", - "Topic :: System :: Hardware :: Hardware Drivers" + "Topic :: System :: Hardware :: Hardware Drivers", + "Programming Language :: Python :: 3.12" # TODO: remove this once poetry automatically adds it ] description = "Manage connections and interactions with Test & Measurement devices." documentation = "https://tm-devices.readthedocs.io/en/latest/" diff --git a/src/tm_devices/device_manager.py b/src/tm_devices/device_manager.py index 94256ce4..aebab4e1 100644 --- a/src/tm_devices/device_manager.py +++ b/src/tm_devices/device_manager.py @@ -280,17 +280,18 @@ def __init__( self.__verbose_visa = False self.__devices: Dict[str, Union[PIDevice, RESTAPIDevice]] = AliasDict() self._external_device_drivers = external_device_drivers + # initialize for __set_options() + self.__verbose: bool = NotImplemented + self.__teardown_cleanup_enabled: bool = NotImplemented + self.__setup_cleanup_enabled: bool = NotImplemented + self.__visa_library: str = NotImplemented + + # Create the config self.__config = DMConfigParser() if config_options is not None: self.__config.update_options(config_options) if self.__config.options.check_for_updates: # pragma: no cover check_for_update() - - # initialize for __set_options - self.__verbose: bool = NotImplemented - self.__teardown_cleanup_enabled: bool = NotImplemented - self.__setup_cleanup_enabled: bool = NotImplemented - self.__visa_library: str = NotImplemented # actually populate the options self.__set_options(verbose)