From 35a78016bf526aa6c1cff8e80ce4246ab128d1c9 Mon Sep 17 00:00:00 2001 From: AlexWells Date: Mon, 20 Jan 2025 09:23:41 +0000 Subject: [PATCH 1/4] Fix linter by using recent Python version We have no particular reason to use 3.7 for this anymore --- .github/workflows/code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code.yml b/.github/workflows/code.yml index 461f1d3a..f6090128 100644 --- a/.github/workflows/code.yml +++ b/.github/workflows/code.yml @@ -22,7 +22,7 @@ jobs: - name: Install Python uses: actions/setup-python@v4 with: - python-version: "3.7" + python-version: "3.12" - name: Install Python Dependencies run: pip install flake8 From af61e494bdf48194ac5d89c56572a52bb5e52ff7 Mon Sep 17 00:00:00 2001 From: AlexWells Date: Mon, 20 Jan 2025 09:26:37 +0000 Subject: [PATCH 2/4] Fix errors in newer flake8 version It seems newer versions don't handle inline comments --- setup.cfg | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index aa771e1d..52d59955 100644 --- a/setup.cfg +++ b/setup.cfg @@ -62,9 +62,12 @@ dev = [flake8] max-line-length = 80 extend-ignore = - F401 F403 F405 # Allow from module import * - E251 # Allow call(param = value) - E301 E302 E303 E305 # Allow any number of blank lines + # Allow from module import * + F401 F403 F405 + # Allow call(param = value) + E251 + # Allow any number of blank lines + E301 E302 E303 E305 [tool:pytest] # Run pytest with all our checkers, and don't spam us with massive tracebacks on error From 40b2804245b9a135e8e61abeeb9feea203d022c9 Mon Sep 17 00:00:00 2001 From: AlexWells Date: Mon, 20 Jan 2025 09:41:07 +0000 Subject: [PATCH 3/4] Fix errors pointed out by the new linter version As best Michael and I can tell, the builder line was introduced during refactoring, and does nothing so can be safely deleted --- softioc/builder.py | 1 - tests/test_record_values.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/softioc/builder.py b/softioc/builder.py index bcbd21d3..71f522cd 100644 --- a/softioc/builder.py +++ b/softioc/builder.py @@ -324,7 +324,6 @@ def ClearRecords(): SetSimpleRecordNames(None, ':') -SetDeviceName = SetPrefix def SetDeviceName(name): SetPrefix(name) diff --git a/tests/test_record_values.py b/tests/test_record_values.py index 1a29be84..3f1fd84b 100644 --- a/tests/test_record_values.py +++ b/tests/test_record_values.py @@ -294,7 +294,7 @@ def record_value_asserts( # This function is shared between functions that may pass in either a # native Python type, or the value returned from p4p, which must be # unwrapped - if type(actual_value) == p4p.nt.enum.ntenum: + if type(actual_value) is p4p.nt.enum.ntenum: actual_val_type = type(actual_value.raw["value"].get("index")) elif isinstance(actual_value, p4p.nt.scalar.ntwrappercommon): actual_val_type = type(actual_value.raw["value"]) @@ -302,7 +302,7 @@ def record_value_asserts( actual_val_type = type(actual_value) try: - if type(expected_value) == float and isnan(expected_value): + if type(expected_value) is float and isnan(expected_value): assert isnan(actual_value) # NaN != Nan, so needs special case elif creation_func in [builder.WaveformOut, builder.WaveformIn]: assert numpy.array_equal(actual_value, expected_value) From 685ab3ecea43388182620b3b591e56de0f8e568e Mon Sep 17 00:00:00 2001 From: AlexWells Date: Mon, 20 Jan 2025 09:56:08 +0000 Subject: [PATCH 4/4] Downgrade docs build to Ubuntu 22 Ubuntu 24 no longer supports Python 3.7. Its a lot of work to update the docs build to more modern python version --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e3866cf4..6b50ec49 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,7 +13,7 @@ on: jobs: build: name: "Docs CI" - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout Source