Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

85 update python #86

Merged
merged 9 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-ver: [3.7, 3.8, 3.9, '3.10', 3.11, 3.12]
os: [ubuntu-latest, windows-latest]
python-ver: [3.8, 3.9, '3.10', 3.11, 3.12]

runs-on: ${{ matrix.os }}

Expand Down
13 changes: 7 additions & 6 deletions sksurgerynditracker/nditracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ def _get_serial_port_name(configuration):
serial_ports = list_ports.comports()
result = None
name = None
if ports_to_probe > len(serial_ports):
ports_to_probe = len(serial_ports)
ports_to_probe = min(ports_to_probe, len(serial_ports))

if serial_port is None:
for port_no in range(ports_to_probe):
Expand All @@ -88,18 +87,20 @@ def _get_serial_port_name(configuration):
print("Probing port: ", serial_port, " got name: ", name,
" Result: ", result, file=fileout)
else:
raise IOError(f'Could not connect to serial port {serial_port} '
f'as there are only {len(serial_ports)} ports available.'
raise IOError(f'Could not connect to serial port'
f'{serial_port} as there are '
f'only {len(serial_ports)} ports available.'
+ serial_connection_errmsg)

if isinstance(serial_port, str):
name = serial_port
result = ndicapy.ndiProbe(name)
print("Probing port: ", name,
" Result: ", result, file=fileout)

if result != ndicapy.NDI_OKAY:
raise IOError(f'Could not connect to an NDI device on the chosen port, {serial_port}.'
raise IOError(f'Could not connect to an NDI device on '
f'the chosen port, {serial_port}.'
+ serial_connection_errmsg)
return name

Expand Down
2 changes: 1 addition & 1 deletion tests/pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ignore=CVS

# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=
ignore-patterns=_version.py

# Pickle collected data for later comparisons.
persistent=yes
Expand Down
3 changes: 1 addition & 2 deletions tests/test_listports.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def test_list_ports():
ndi_port_names.append(ndiDeviceName(port_number))
try:
windows_port_number = int(serial_port.device.replace('COM', ''))
if windows_port_number > max_com_port:
max_com_port = windows_port_number
max_com_port = max(max_com_port, windows_port_number)
except ValueError:
# we're probably not on windows, so don't care
pass
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py37,lint
envlist = py310,lint
skipsdist = True
requires = setuptools >= 47.1

[travis]
python =
3.7: py37, docs, lint
3.10: py310, docs, lint

[testenv]
deps=-rrequirements-dev.txt
Expand All @@ -17,22 +17,22 @@ commands = coverage erase
coverage report -m

[testenv:lint]
basepython=python3.7
basepython=python3.10
deps=pylint
{[testenv]deps}
commands=pylint --rcfile=tests/pylintrc sksurgerynditracker tests

[testenv:docs]
basepython=python3.7
basepython=python3.10
changedir = docs
commands = sphinx-build -M html . build

[testenv:installer]
basepython=python3.7
basepython=python3.10
commands=python -c "print('Installer not needed for this project.')"

[testenv:pip3]
basepython=python3.7
basepython=python3.10
changedir=pip_test
skip_install=True
commands = pip install {posargs}
Expand Down
Loading