Skip to content

Commit e1f104a

Browse files
Merge pull request #181 from DiamondLightSource/fix_linter
Fix issues in the Docs and Code-lint stages of the CI
2 parents 27ae663 + 685ab3e commit e1f104a

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

.github/workflows/code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Install Python
2323
uses: actions/setup-python@v4
2424
with:
25-
python-version: "3.7"
25+
python-version: "3.12"
2626

2727
- name: Install Python Dependencies
2828
run: pip install flake8

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
build:
1515
name: "Docs CI"
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-22.04
1717

1818
steps:
1919
- name: Checkout Source

setup.cfg

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,12 @@ dev =
6262
[flake8]
6363
max-line-length = 80
6464
extend-ignore =
65-
F401 F403 F405 # Allow from module import *
66-
E251 # Allow call(param = value)
67-
E301 E302 E303 E305 # Allow any number of blank lines
65+
# Allow from module import *
66+
F401 F403 F405
67+
# Allow call(param = value)
68+
E251
69+
# Allow any number of blank lines
70+
E301 E302 E303 E305
6871

6972
[tool:pytest]
7073
# Run pytest with all our checkers, and don't spam us with massive tracebacks on error

softioc/builder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ def ClearRecords():
324324

325325
SetSimpleRecordNames(None, ':')
326326

327-
SetDeviceName = SetPrefix
328327
def SetDeviceName(name):
329328
SetPrefix(name)
330329

tests/test_record_values.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ def record_value_asserts(
294294
# This function is shared between functions that may pass in either a
295295
# native Python type, or the value returned from p4p, which must be
296296
# unwrapped
297-
if type(actual_value) == p4p.nt.enum.ntenum:
297+
if type(actual_value) is p4p.nt.enum.ntenum:
298298
actual_val_type = type(actual_value.raw["value"].get("index"))
299299
elif isinstance(actual_value, p4p.nt.scalar.ntwrappercommon):
300300
actual_val_type = type(actual_value.raw["value"])
301301
else:
302302
actual_val_type = type(actual_value)
303303

304304
try:
305-
if type(expected_value) == float and isnan(expected_value):
305+
if type(expected_value) is float and isnan(expected_value):
306306
assert isnan(actual_value) # NaN != Nan, so needs special case
307307
elif creation_func in [builder.WaveformOut, builder.WaveformIn]:
308308
assert numpy.array_equal(actual_value, expected_value)

0 commit comments

Comments
 (0)