From c5dedd146ba707c80a57007f97668330f8ae73dd Mon Sep 17 00:00:00 2001 From: "Roffman, Devin" Date: Wed, 25 Mar 2026 11:31:18 -0500 Subject: [PATCH 1/2] Python 3.11 support added --- azure-pipelines.yml | 4 ++-- pyproject.toml | 4 ++-- src/nitsm/tsmcontext.py | 1 + systemtests/nidigital_codemodules.py | 6 +++--- tests/test_custom_instruments.py | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b41ffd6..4a83c1c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,7 +32,7 @@ jobs: arguments: '-VersionToActivate old' - script: | - tox -- older + python -m tox -- older displayName: 'Run python unit tests with older version of TestStand/TSM' - task: PowerShell@2 @@ -43,7 +43,7 @@ jobs: arguments: '-VersionToActivate new' - script: | - tox -- newer + python -m tox -- newer displayName: 'Run python unit tests with newer version of TestStand/TSM' - task: PublishTestResults@2 diff --git a/pyproject.toml b/pyproject.toml index 66ef436..92b291a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.black] line-length = 100 -target-version = ["py36", "py37", "py38"] +target-version = ["py36", "py37", "py38", "py311"] extend-exclude = "^/src/nitsm/_pinmapinterfaces.py" [tool.ni-python-styleguide] @@ -23,7 +23,7 @@ markers = [ legacy_tox_ini = """ [tox] isolated_build = True -envlist = clean, py3{6,7,8}-tests, py3{6,7,8}-systemtests, report +envlist = clean, py3{6,7,8,11}-tests, py3{6,7,8,11}-systemtests, report [testenv] deps = diff --git a/src/nitsm/tsmcontext.py b/src/nitsm/tsmcontext.py index 2b04bf1..94375c4 100644 --- a/src/nitsm/tsmcontext.py +++ b/src/nitsm/tsmcontext.py @@ -1,4 +1,5 @@ """TSM Context Wrapper""" + import ctypes.wintypes import time import typing diff --git a/systemtests/nidigital_codemodules.py b/systemtests/nidigital_codemodules.py index 04ebbcb..ba91fac 100644 --- a/systemtests/nidigital_codemodules.py +++ b/systemtests/nidigital_codemodules.py @@ -37,9 +37,9 @@ def measure_ppmu( for session, pin_set_string in zip(sessions, pin_set_strings): # call some methods on the session to ensure no errors session.pins[pin_set_string].ppmu_aperture_time = 4e-6 - session.pins[ - pin_set_string - ].ppmu_aperture_time_units = nidigital.PPMUApertureTimeUnits.SECONDS + session.pins[pin_set_string].ppmu_aperture_time_units = ( + nidigital.PPMUApertureTimeUnits.SECONDS + ) session.pins[pin_set_string].ppmu_output_function = nidigital.PPMUOutputFunction.CURRENT session.pins[pin_set_string].ppmu_current_level_range = 2e-6 session.pins[pin_set_string].ppmu_current_level = 2e-6 diff --git a/tests/test_custom_instruments.py b/tests/test_custom_instruments.py index 8defc6a..993e7f0 100644 --- a/tests/test_custom_instruments.py +++ b/tests/test_custom_instruments.py @@ -5,7 +5,7 @@ @pytest.fixture def simulated_custom_instrument_sessions(standalone_tsm_context): - (instrument_names, channel_group_ids, _) = standalone_tsm_context.get_custom_instrument_names( + instrument_names, channel_group_ids, _ = standalone_tsm_context.get_custom_instrument_names( TestCustomInstruments.pin_map_instrument_type_id ) sessions = tuple(range(len(instrument_names))) From 4b942859b7e40ab46873d3b1b03397417c94d07c Mon Sep 17 00:00:00 2001 From: "Roffman, Devin" Date: Mon, 30 Mar 2026 14:43:39 -0500 Subject: [PATCH 2/2] tox version --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4a83c1c..1b3f203 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,7 @@ jobs: displayName: 'Upgrade pip' - script: | - python -m pip install --upgrade tox + python -m pip install --upgrade "tox<4" "virtualenv<20.22" displayName: 'Install or upgrade tox' - task: PowerShell@2